diff --git a/cmd/osbuild-worker/jobimpl-osbuild.go b/cmd/osbuild-worker/jobimpl-osbuild.go
index 2c186ca94..cc0169681 100644
--- a/cmd/osbuild-worker/jobimpl-osbuild.go
+++ b/cmd/osbuild-worker/jobimpl-osbuild.go
@@ -763,21 +763,29 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
break
}
- c, err := azure.NewClient(*impl.AzureConfig.Creds, targetOptions.TenantID)
+ c, err := azure.NewClient(*impl.AzureConfig.Creds, targetOptions.TenantID, targetOptions.SubscriptionID)
if err != nil {
targetResult.TargetError = clienterrors.WorkerClientError(clienterrors.ErrorInvalidTargetConfig, err.Error(), nil)
break
}
logWithId.Info("[Azure] 🔑 Logged in Azure")
+ location := targetOptions.Location
+ if location == "" {
+ location, err = c.GetResourceGroupLocation(ctx, targetOptions.ResourceGroup)
+ if err != nil {
+ targetResult.TargetError = clienterrors.WorkerClientError(clienterrors.ErrorInvalidTargetConfig, fmt.Sprintf("retrieving resource group location failed: %v", err), nil)
+ break
+ }
+ }
+
storageAccountTag := azure.Tag{
Name: "imageBuilderStorageAccount",
- Value: fmt.Sprintf("location=%s", targetOptions.Location),
+ Value: fmt.Sprintf("location=%s", location),
}
storageAccount, err := c.GetResourceNameByTag(
ctx,
- targetOptions.SubscriptionID,
targetOptions.ResourceGroup,
storageAccountTag,
)
@@ -793,10 +801,9 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
err := c.CreateStorageAccount(
ctx,
- targetOptions.SubscriptionID,
targetOptions.ResourceGroup,
storageAccount,
- targetOptions.Location,
+ location,
storageAccountTag,
)
if err != nil {
@@ -808,7 +815,6 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
logWithId.Info("[Azure] 🔑📦 Retrieving a storage account key")
storageAccessKey, err := c.GetStorageAccountKey(
ctx,
- targetOptions.SubscriptionID,
targetOptions.ResourceGroup,
storageAccount,
)
@@ -873,7 +879,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
storageContainer,
blobName,
jobTarget.ImageName,
- targetOptions.Location,
+ location,
)
if err != nil {
targetResult.TargetError = clienterrors.WorkerClientError(clienterrors.ErrorImportingImage, fmt.Sprintf("registering the image failed: %v", err), nil)
diff --git a/go.mod b/go.mod
index 6bd88507f..87f6613bf 100644
--- a/go.mod
+++ b/go.mod
@@ -8,6 +8,10 @@ require (
cloud.google.com/go/compute v1.23.3
cloud.google.com/go/storage v1.36.0
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
+ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0
+ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.3.0
+ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0
+ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1
github.com/Azure/go-autorest/autorest v0.11.29
github.com/Azure/go-autorest/autorest/azure/auth v0.5.12
@@ -62,6 +66,7 @@ require (
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
+ github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
@@ -100,6 +105,7 @@ require (
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/validate v0.22.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
+ github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
@@ -127,6 +133,7 @@ require (
github.com/klauspost/compress v1.17.3 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/kr/text v0.2.0 // indirect
+ github.com/kylelemons/godebug v1.1.0 // indirect
github.com/letsencrypt/boulder v0.0.0-20230213213521-fdfea0d469b6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
@@ -146,6 +153,7 @@ require (
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
github.com/opencontainers/runc v1.1.10 // indirect
github.com/opencontainers/runtime-spec v1.1.0 // indirect
+ github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/proglottis/gpgme v0.1.3 // indirect
diff --git a/go.sum b/go.sum
index 474a3ac39..ed7d6f05e 100644
--- a/go.sum
+++ b/go.sum
@@ -15,9 +15,17 @@ github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1/go.mod h1:RKUqNu35KJYcVG/fqTRqmuXJZYNhYkBrnC/hX7yGbTA=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI=
+github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xOGA5UNsXnkaYZz9vdPGhA=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI=
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.3.0 h1:qgs/VAMSR+9qFhwTw4OwF2NbVuw+2m83pVZJjqkKQMw=
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.3.0/go.mod h1:uYt4CfhkJA9o0FN7jfE5minm/i4nUE4MjGUJkzB6Zs8=
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do=
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0 h1:pPvTJ1dY0sA35JOeFq6TsY2xj6Z85Yo23Pj4wCCvu4o=
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM=
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70=
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0/go.mod h1:T5RfihdXtBDxt1Ch2wobif3TvzTdumDy29kahv6AV9A=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 h1:AMf7YbZOZIW5b66cXNHMWWT/zkjhz5+a+k/3x40EO7E=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1/go.mod h1:uwfk06ZBcvL/g4VHNjurPfVln9NMbsk2XIZxJ+hu81k=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
@@ -48,6 +56,7 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ
github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk=
+github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
@@ -226,6 +235,7 @@ github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE=
+github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ=
@@ -383,6 +393,7 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
+github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg=
github.com/labstack/echo/v4 v4.11.4 h1:vDZmA+qNeh1pd/cCkEicDMrjtrnMGQ1QFI9gWN1zGq8=
github.com/labstack/echo/v4 v4.11.4/go.mod h1:noh7EvLwqDsmh/X/HWKPUl1AjzJrhyptRyEbQJfxen8=
@@ -471,6 +482,7 @@ github.com/osbuild/pulp-client v0.1.0/go.mod h1:rd/MLdfwwO2cQI1s056h8z32zAi3Bo90
github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU=
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
+github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -697,6 +709,7 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
diff --git a/internal/upload/azure/azure.go b/internal/upload/azure/azure.go
index ce92db95a..6e7914a5c 100644
--- a/internal/upload/azure/azure.go
+++ b/internal/upload/azure/azure.go
@@ -5,29 +5,43 @@ import (
"errors"
"fmt"
- "github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute"
- "github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/resources/mgmt/resources"
- "github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/storage/mgmt/storage"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure/auth"
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+
+ "github.com/osbuild/osbuild-composer/internal/common"
)
type Client struct {
- authorizer autorest.Authorizer
+ creds *azidentity.ClientSecretCredential
+ resFact *armresources.ClientFactory
+ storFact *armstorage.ClientFactory
}
// NewClient creates a client for accessing the Azure API.
// See https://docs.microsoft.com/en-us/rest/api/azure/
// If you need to work with the Azure Storage API, see NewStorageClient
-func NewClient(credentials Credentials, tenantID string) (*Client, error) {
- credentialsConfig := auth.NewClientCredentialsConfig(credentials.clientID, credentials.clientSecret, tenantID)
- authorizer, err := credentialsConfig.Authorizer()
+func NewClient(credentials Credentials, tenantID, subscriptionID string) (*Client, error) {
+ creds, err := azidentity.NewClientSecretCredential(tenantID, credentials.clientID, credentials.clientSecret, nil)
if err != nil {
- return nil, fmt.Errorf("creating an azure authorizer failed: %v", err)
+ return nil, fmt.Errorf("creating azure ClientSecretCredential failed: %v", err)
+ }
+
+ resFact, err := armresources.NewClientFactory(subscriptionID, creds, nil)
+ if err != nil {
+ return nil, fmt.Errorf("creating resources client factory failed: %v", err)
+ }
+
+ storFact, err := armstorage.NewClientFactory(subscriptionID, creds, nil)
+ if err != nil {
+ return nil, fmt.Errorf("creating storage client factory failed: %v", err)
}
return &Client{
- authorizer: authorizer,
+ creds,
+ resFact,
+ storFact,
}, nil
}
@@ -41,29 +55,29 @@ type Tag struct {
// given `tag`. Note that if multiple resources with the same tag exists
// in the specified resource group, only one name is returned. It's undefined
// which one it is.
-func (ac Client) GetResourceNameByTag(ctx context.Context, subscriptionID, resourceGroup string, tag Tag) (string, error) {
- c := resources.NewClient(subscriptionID)
- c.Authorizer = ac.authorizer
+func (ac Client) GetResourceNameByTag(ctx context.Context, resourceGroup string, tag Tag) (string, error) {
+ c := ac.resFact.NewClient()
- filter := fmt.Sprintf("tagName eq '%s' and tagValue eq '%s'", tag.Name, tag.Value)
- result, err := c.ListByResourceGroup(ctx, resourceGroup, filter, "", nil)
+ pager := c.NewListByResourceGroupPager(resourceGroup, &armresources.ClientListByResourceGroupOptions{
+ Filter: common.ToPtr(fmt.Sprintf("tagName eq '%s' and tagValue eq '%s'", tag.Name, tag.Value)),
+ })
+
+ result, err := pager.NextPage(ctx)
if err != nil {
return "", fmt.Errorf("listing resources failed: %v", err)
}
- if len(result.Values()) < 1 {
+ if len(result.Value) < 1 {
return "", nil
}
-
- return *result.Values()[0].Name, nil
+ return *result.Value[0].Name, nil
}
// GetResourceGroupLocation returns the location of the given resource group.
-func (ac Client) GetResourceGroupLocation(ctx context.Context, subscriptionID, resourceGroup string) (string, error) {
- c := resources.NewGroupsClient(subscriptionID)
- c.Authorizer = ac.authorizer
+func (ac Client) GetResourceGroupLocation(ctx context.Context, resourceGroup string) (string, error) {
+ c := ac.resFact.NewResourceGroupsClient()
- group, err := c.Get(ctx, resourceGroup)
+ group, err := c.Get(ctx, resourceGroup, nil)
if err != nil {
return "", fmt.Errorf("retrieving resource group failed: %v", err)
}
@@ -76,38 +90,32 @@ func (ac Client) GetResourceGroupLocation(ctx context.Context, subscriptionID, r
// can be used to specify a tag attached to the account.
// The location is optional and if not provided, it is determined
// from the resource group.
-func (ac Client) CreateStorageAccount(ctx context.Context, subscriptionID, resourceGroup, name, location string, tag Tag) error {
- c := storage.NewAccountsClient(subscriptionID)
- c.Authorizer = ac.authorizer
+func (ac Client) CreateStorageAccount(ctx context.Context, resourceGroup, name, location string, tag Tag) error {
+ c := ac.storFact.NewAccountsClient()
var err error
if location == "" {
- location, err = ac.GetResourceGroupLocation(ctx, subscriptionID, resourceGroup)
+ location, err = ac.GetResourceGroupLocation(ctx, resourceGroup)
if err != nil {
return fmt.Errorf("retrieving resource group location failed: %v", err)
}
}
- result, err := c.Create(ctx, resourceGroup, name, storage.AccountCreateParameters{
- Sku: &storage.Sku{
- Name: storage.StandardLRS,
- Tier: storage.Standard,
+ poller, err := c.BeginCreate(ctx, resourceGroup, name, armstorage.AccountCreateParameters{
+ SKU: &armstorage.SKU{
+ Name: common.ToPtr(armstorage.SKUNameStandardLRS),
+ Tier: common.ToPtr(armstorage.SKUTierStandard),
},
Location: &location,
Tags: map[string]*string{
tag.Name: &tag.Value,
},
- })
+ }, nil)
if err != nil {
return fmt.Errorf("sending the create storage account request failed: %v", err)
}
- err = result.WaitForCompletionRef(ctx, c.Client)
- if err != nil {
- return fmt.Errorf("waiting for the create storage account request failed: %v", err)
- }
-
- _, err = result.Result(c)
+ _, err = poller.PollUntilDone(ctx, nil)
if err != nil {
return fmt.Errorf("create storage account request failed: %v", err)
}
@@ -118,63 +126,56 @@ func (ac Client) CreateStorageAccount(ctx context.Context, subscriptionID, resou
// GetStorageAccountKey returns a storage account key that can be used to
// access the given storage account. This method always returns only the first
// key.
-func (ac Client) GetStorageAccountKey(ctx context.Context, subscriptionID, resourceGroup string, storageAccount string) (string, error) {
- c := storage.NewAccountsClient(subscriptionID)
- c.Authorizer = ac.authorizer
-
- keys, err := c.ListKeys(ctx, resourceGroup, storageAccount)
+func (ac Client) GetStorageAccountKey(ctx context.Context, resourceGroup string, storageAccount string) (string, error) {
+ c := ac.storFact.NewAccountsClient()
+ keys, err := c.ListKeys(ctx, resourceGroup, storageAccount, nil)
if err != nil {
return "", fmt.Errorf("retrieving keys for a storage account failed: %v", err)
}
- if len(*keys.Keys) == 0 {
+ if len(keys.Keys) == 0 {
return "", errors.New("azure returned an empty list of keys")
}
- return *(*keys.Keys)[0].Value, nil
+ return *keys.Keys[0].Value, nil
}
// RegisterImage creates a generalized V1 Linux image from a given blob.
// The location is optional and if not provided, it is determined
// from the resource group.
func (ac Client) RegisterImage(ctx context.Context, subscriptionID, resourceGroup, storageAccount, storageContainer, blobName, imageName, location string) error {
- c := compute.NewImagesClient(subscriptionID)
- c.Authorizer = ac.authorizer
+ c, err := armcompute.NewImagesClient(subscriptionID, ac.creds, nil)
+ if err != nil {
+ return fmt.Errorf("unable to create compute client: %v", err)
+ }
blobURI := fmt.Sprintf("https://%s.blob.core.windows.net/%s/%s", storageAccount, storageContainer, blobName)
- var err error
if location == "" {
- location, err = ac.GetResourceGroupLocation(ctx, subscriptionID, resourceGroup)
+ location, err = ac.GetResourceGroupLocation(ctx, resourceGroup)
if err != nil {
return fmt.Errorf("retrieving resource group location failed: %v", err)
}
}
- imageFuture, err := c.CreateOrUpdate(ctx, resourceGroup, imageName, compute.Image{
- Response: autorest.Response{},
- ImageProperties: &compute.ImageProperties{
+ imageFuture, err := c.BeginCreateOrUpdate(ctx, resourceGroup, imageName, armcompute.Image{
+ Properties: &armcompute.ImageProperties{
SourceVirtualMachine: nil,
- StorageProfile: &compute.ImageStorageProfile{
- OsDisk: &compute.ImageOSDisk{
- OsType: compute.Linux,
+ StorageProfile: &armcompute.ImageStorageProfile{
+ OSDisk: &armcompute.ImageOSDisk{
+ OSType: common.ToPtr(armcompute.OperatingSystemTypesLinux),
BlobURI: &blobURI,
- OsState: compute.Generalized,
+ OSState: common.ToPtr(armcompute.OperatingSystemStateTypesGeneralized),
},
},
},
Location: &location,
- })
+ }, nil)
if err != nil {
return fmt.Errorf("sending the create image request failed: %v", err)
}
- err = imageFuture.WaitForCompletionRef(ctx, c.Client)
- if err != nil {
- return fmt.Errorf("waiting for the create image request failed: %v", err)
- }
-
- _, err = imageFuture.Result(c)
+ _, err = imageFuture.PollUntilDone(ctx, nil)
if err != nil {
return fmt.Errorf("create image request failed: %v", err)
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute/models.go
deleted file mode 100644
index b25110ee2..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute/models.go
+++ /dev/null
@@ -1,992 +0,0 @@
-//go:build go1.9
-// +build go1.9
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder
-
-package compute
-
-import (
- "context"
-
- original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute"
-)
-
-const (
- DefaultBaseURI = original.DefaultBaseURI
-)
-
-type AccessLevel = original.AccessLevel
-
-const (
- None AccessLevel = original.None
- Read AccessLevel = original.Read
-)
-
-type CachingTypes = original.CachingTypes
-
-const (
- CachingTypesNone CachingTypes = original.CachingTypesNone
- CachingTypesReadOnly CachingTypes = original.CachingTypesReadOnly
- CachingTypesReadWrite CachingTypes = original.CachingTypesReadWrite
-)
-
-type ComponentNames = original.ComponentNames
-
-const (
- MicrosoftWindowsShellSetup ComponentNames = original.MicrosoftWindowsShellSetup
-)
-
-type DiskCreateOption = original.DiskCreateOption
-
-const (
- Attach DiskCreateOption = original.Attach
- Copy DiskCreateOption = original.Copy
- Empty DiskCreateOption = original.Empty
- FromImage DiskCreateOption = original.FromImage
- Import DiskCreateOption = original.Import
-)
-
-type DiskCreateOptionTypes = original.DiskCreateOptionTypes
-
-const (
- DiskCreateOptionTypesAttach DiskCreateOptionTypes = original.DiskCreateOptionTypesAttach
- DiskCreateOptionTypesEmpty DiskCreateOptionTypes = original.DiskCreateOptionTypesEmpty
- DiskCreateOptionTypesFromImage DiskCreateOptionTypes = original.DiskCreateOptionTypesFromImage
-)
-
-type IPVersion = original.IPVersion
-
-const (
- IPv4 IPVersion = original.IPv4
- IPv6 IPVersion = original.IPv6
-)
-
-type InstanceViewTypes = original.InstanceViewTypes
-
-const (
- InstanceView InstanceViewTypes = original.InstanceView
-)
-
-type IntervalInMins = original.IntervalInMins
-
-const (
- FiveMins IntervalInMins = original.FiveMins
- SixtyMins IntervalInMins = original.SixtyMins
- ThirtyMins IntervalInMins = original.ThirtyMins
- ThreeMins IntervalInMins = original.ThreeMins
-)
-
-type MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypes
-
-const (
- MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesMaintenanceAborted
- MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesMaintenanceCompleted
- MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesNone
- MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesRetryLater
-)
-
-type OperatingSystemStateTypes = original.OperatingSystemStateTypes
-
-const (
- Generalized OperatingSystemStateTypes = original.Generalized
- Specialized OperatingSystemStateTypes = original.Specialized
-)
-
-type OperatingSystemTypes = original.OperatingSystemTypes
-
-const (
- Linux OperatingSystemTypes = original.Linux
- Windows OperatingSystemTypes = original.Windows
-)
-
-type PassNames = original.PassNames
-
-const (
- OobeSystem PassNames = original.OobeSystem
-)
-
-type ProtocolTypes = original.ProtocolTypes
-
-const (
- HTTP ProtocolTypes = original.HTTP
- HTTPS ProtocolTypes = original.HTTPS
-)
-
-type ResourceIdentityType = original.ResourceIdentityType
-
-const (
- ResourceIdentityTypeNone ResourceIdentityType = original.ResourceIdentityTypeNone
- ResourceIdentityTypeSystemAssigned ResourceIdentityType = original.ResourceIdentityTypeSystemAssigned
- ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = original.ResourceIdentityTypeSystemAssignedUserAssigned
- ResourceIdentityTypeUserAssigned ResourceIdentityType = original.ResourceIdentityTypeUserAssigned
-)
-
-type ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleType
-
-const (
- ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleTypeAutomatic
- ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleTypeManual
- ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleTypeNone
-)
-
-type ResourceSkuRestrictionsReasonCode = original.ResourceSkuRestrictionsReasonCode
-
-const (
- NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = original.NotAvailableForSubscription
- QuotaID ResourceSkuRestrictionsReasonCode = original.QuotaID
-)
-
-type ResourceSkuRestrictionsType = original.ResourceSkuRestrictionsType
-
-const (
- Location ResourceSkuRestrictionsType = original.Location
- Zone ResourceSkuRestrictionsType = original.Zone
-)
-
-type RollingUpgradeActionType = original.RollingUpgradeActionType
-
-const (
- Cancel RollingUpgradeActionType = original.Cancel
- Start RollingUpgradeActionType = original.Start
-)
-
-type RollingUpgradeStatusCode = original.RollingUpgradeStatusCode
-
-const (
- Cancelled RollingUpgradeStatusCode = original.Cancelled
- Completed RollingUpgradeStatusCode = original.Completed
- Faulted RollingUpgradeStatusCode = original.Faulted
- RollingForward RollingUpgradeStatusCode = original.RollingForward
-)
-
-type SettingNames = original.SettingNames
-
-const (
- AutoLogon SettingNames = original.AutoLogon
- FirstLogonCommands SettingNames = original.FirstLogonCommands
-)
-
-type StatusLevelTypes = original.StatusLevelTypes
-
-const (
- Error StatusLevelTypes = original.Error
- Info StatusLevelTypes = original.Info
- Warning StatusLevelTypes = original.Warning
-)
-
-type StorageAccountTypes = original.StorageAccountTypes
-
-const (
- PremiumLRS StorageAccountTypes = original.PremiumLRS
- StandardLRS StorageAccountTypes = original.StandardLRS
-)
-
-type UpgradeMode = original.UpgradeMode
-
-const (
- Automatic UpgradeMode = original.Automatic
- Manual UpgradeMode = original.Manual
- Rolling UpgradeMode = original.Rolling
-)
-
-type UpgradeOperationInvoker = original.UpgradeOperationInvoker
-
-const (
- Platform UpgradeOperationInvoker = original.Platform
- Unknown UpgradeOperationInvoker = original.Unknown
- User UpgradeOperationInvoker = original.User
-)
-
-type UpgradeState = original.UpgradeState
-
-const (
- UpgradeStateCancelled UpgradeState = original.UpgradeStateCancelled
- UpgradeStateCompleted UpgradeState = original.UpgradeStateCompleted
- UpgradeStateFaulted UpgradeState = original.UpgradeStateFaulted
- UpgradeStateRollingForward UpgradeState = original.UpgradeStateRollingForward
-)
-
-type VirtualMachineEvictionPolicyTypes = original.VirtualMachineEvictionPolicyTypes
-
-const (
- Deallocate VirtualMachineEvictionPolicyTypes = original.Deallocate
- Delete VirtualMachineEvictionPolicyTypes = original.Delete
-)
-
-type VirtualMachinePriorityTypes = original.VirtualMachinePriorityTypes
-
-const (
- Low VirtualMachinePriorityTypes = original.Low
- Regular VirtualMachinePriorityTypes = original.Regular
-)
-
-type VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleType
-
-const (
- VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleTypeAutomatic
- VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleTypeNone
-)
-
-type VirtualMachineSizeTypes = original.VirtualMachineSizeTypes
-
-const (
- BasicA0 VirtualMachineSizeTypes = original.BasicA0
- BasicA1 VirtualMachineSizeTypes = original.BasicA1
- BasicA2 VirtualMachineSizeTypes = original.BasicA2
- BasicA3 VirtualMachineSizeTypes = original.BasicA3
- BasicA4 VirtualMachineSizeTypes = original.BasicA4
- StandardA0 VirtualMachineSizeTypes = original.StandardA0
- StandardA1 VirtualMachineSizeTypes = original.StandardA1
- StandardA10 VirtualMachineSizeTypes = original.StandardA10
- StandardA11 VirtualMachineSizeTypes = original.StandardA11
- StandardA1V2 VirtualMachineSizeTypes = original.StandardA1V2
- StandardA2 VirtualMachineSizeTypes = original.StandardA2
- StandardA2mV2 VirtualMachineSizeTypes = original.StandardA2mV2
- StandardA2V2 VirtualMachineSizeTypes = original.StandardA2V2
- StandardA3 VirtualMachineSizeTypes = original.StandardA3
- StandardA4 VirtualMachineSizeTypes = original.StandardA4
- StandardA4mV2 VirtualMachineSizeTypes = original.StandardA4mV2
- StandardA4V2 VirtualMachineSizeTypes = original.StandardA4V2
- StandardA5 VirtualMachineSizeTypes = original.StandardA5
- StandardA6 VirtualMachineSizeTypes = original.StandardA6
- StandardA7 VirtualMachineSizeTypes = original.StandardA7
- StandardA8 VirtualMachineSizeTypes = original.StandardA8
- StandardA8mV2 VirtualMachineSizeTypes = original.StandardA8mV2
- StandardA8V2 VirtualMachineSizeTypes = original.StandardA8V2
- StandardA9 VirtualMachineSizeTypes = original.StandardA9
- StandardB1ms VirtualMachineSizeTypes = original.StandardB1ms
- StandardB1s VirtualMachineSizeTypes = original.StandardB1s
- StandardB2ms VirtualMachineSizeTypes = original.StandardB2ms
- StandardB2s VirtualMachineSizeTypes = original.StandardB2s
- StandardB4ms VirtualMachineSizeTypes = original.StandardB4ms
- StandardB8ms VirtualMachineSizeTypes = original.StandardB8ms
- StandardD1 VirtualMachineSizeTypes = original.StandardD1
- StandardD11 VirtualMachineSizeTypes = original.StandardD11
- StandardD11V2 VirtualMachineSizeTypes = original.StandardD11V2
- StandardD12 VirtualMachineSizeTypes = original.StandardD12
- StandardD12V2 VirtualMachineSizeTypes = original.StandardD12V2
- StandardD13 VirtualMachineSizeTypes = original.StandardD13
- StandardD13V2 VirtualMachineSizeTypes = original.StandardD13V2
- StandardD14 VirtualMachineSizeTypes = original.StandardD14
- StandardD14V2 VirtualMachineSizeTypes = original.StandardD14V2
- StandardD15V2 VirtualMachineSizeTypes = original.StandardD15V2
- StandardD16sV3 VirtualMachineSizeTypes = original.StandardD16sV3
- StandardD16V3 VirtualMachineSizeTypes = original.StandardD16V3
- StandardD1V2 VirtualMachineSizeTypes = original.StandardD1V2
- StandardD2 VirtualMachineSizeTypes = original.StandardD2
- StandardD2sV3 VirtualMachineSizeTypes = original.StandardD2sV3
- StandardD2V2 VirtualMachineSizeTypes = original.StandardD2V2
- StandardD2V3 VirtualMachineSizeTypes = original.StandardD2V3
- StandardD3 VirtualMachineSizeTypes = original.StandardD3
- StandardD32sV3 VirtualMachineSizeTypes = original.StandardD32sV3
- StandardD32V3 VirtualMachineSizeTypes = original.StandardD32V3
- StandardD3V2 VirtualMachineSizeTypes = original.StandardD3V2
- StandardD4 VirtualMachineSizeTypes = original.StandardD4
- StandardD4sV3 VirtualMachineSizeTypes = original.StandardD4sV3
- StandardD4V2 VirtualMachineSizeTypes = original.StandardD4V2
- StandardD4V3 VirtualMachineSizeTypes = original.StandardD4V3
- StandardD5V2 VirtualMachineSizeTypes = original.StandardD5V2
- StandardD64sV3 VirtualMachineSizeTypes = original.StandardD64sV3
- StandardD64V3 VirtualMachineSizeTypes = original.StandardD64V3
- StandardD8sV3 VirtualMachineSizeTypes = original.StandardD8sV3
- StandardD8V3 VirtualMachineSizeTypes = original.StandardD8V3
- StandardDS1 VirtualMachineSizeTypes = original.StandardDS1
- StandardDS11 VirtualMachineSizeTypes = original.StandardDS11
- StandardDS11V2 VirtualMachineSizeTypes = original.StandardDS11V2
- StandardDS12 VirtualMachineSizeTypes = original.StandardDS12
- StandardDS12V2 VirtualMachineSizeTypes = original.StandardDS12V2
- StandardDS13 VirtualMachineSizeTypes = original.StandardDS13
- StandardDS132V2 VirtualMachineSizeTypes = original.StandardDS132V2
- StandardDS134V2 VirtualMachineSizeTypes = original.StandardDS134V2
- StandardDS13V2 VirtualMachineSizeTypes = original.StandardDS13V2
- StandardDS14 VirtualMachineSizeTypes = original.StandardDS14
- StandardDS144V2 VirtualMachineSizeTypes = original.StandardDS144V2
- StandardDS148V2 VirtualMachineSizeTypes = original.StandardDS148V2
- StandardDS14V2 VirtualMachineSizeTypes = original.StandardDS14V2
- StandardDS15V2 VirtualMachineSizeTypes = original.StandardDS15V2
- StandardDS1V2 VirtualMachineSizeTypes = original.StandardDS1V2
- StandardDS2 VirtualMachineSizeTypes = original.StandardDS2
- StandardDS2V2 VirtualMachineSizeTypes = original.StandardDS2V2
- StandardDS3 VirtualMachineSizeTypes = original.StandardDS3
- StandardDS3V2 VirtualMachineSizeTypes = original.StandardDS3V2
- StandardDS4 VirtualMachineSizeTypes = original.StandardDS4
- StandardDS4V2 VirtualMachineSizeTypes = original.StandardDS4V2
- StandardDS5V2 VirtualMachineSizeTypes = original.StandardDS5V2
- StandardE16sV3 VirtualMachineSizeTypes = original.StandardE16sV3
- StandardE16V3 VirtualMachineSizeTypes = original.StandardE16V3
- StandardE2sV3 VirtualMachineSizeTypes = original.StandardE2sV3
- StandardE2V3 VirtualMachineSizeTypes = original.StandardE2V3
- StandardE3216V3 VirtualMachineSizeTypes = original.StandardE3216V3
- StandardE328sV3 VirtualMachineSizeTypes = original.StandardE328sV3
- StandardE32sV3 VirtualMachineSizeTypes = original.StandardE32sV3
- StandardE32V3 VirtualMachineSizeTypes = original.StandardE32V3
- StandardE4sV3 VirtualMachineSizeTypes = original.StandardE4sV3
- StandardE4V3 VirtualMachineSizeTypes = original.StandardE4V3
- StandardE6416sV3 VirtualMachineSizeTypes = original.StandardE6416sV3
- StandardE6432sV3 VirtualMachineSizeTypes = original.StandardE6432sV3
- StandardE64sV3 VirtualMachineSizeTypes = original.StandardE64sV3
- StandardE64V3 VirtualMachineSizeTypes = original.StandardE64V3
- StandardE8sV3 VirtualMachineSizeTypes = original.StandardE8sV3
- StandardE8V3 VirtualMachineSizeTypes = original.StandardE8V3
- StandardF1 VirtualMachineSizeTypes = original.StandardF1
- StandardF16 VirtualMachineSizeTypes = original.StandardF16
- StandardF16s VirtualMachineSizeTypes = original.StandardF16s
- StandardF16sV2 VirtualMachineSizeTypes = original.StandardF16sV2
- StandardF1s VirtualMachineSizeTypes = original.StandardF1s
- StandardF2 VirtualMachineSizeTypes = original.StandardF2
- StandardF2s VirtualMachineSizeTypes = original.StandardF2s
- StandardF2sV2 VirtualMachineSizeTypes = original.StandardF2sV2
- StandardF32sV2 VirtualMachineSizeTypes = original.StandardF32sV2
- StandardF4 VirtualMachineSizeTypes = original.StandardF4
- StandardF4s VirtualMachineSizeTypes = original.StandardF4s
- StandardF4sV2 VirtualMachineSizeTypes = original.StandardF4sV2
- StandardF64sV2 VirtualMachineSizeTypes = original.StandardF64sV2
- StandardF72sV2 VirtualMachineSizeTypes = original.StandardF72sV2
- StandardF8 VirtualMachineSizeTypes = original.StandardF8
- StandardF8s VirtualMachineSizeTypes = original.StandardF8s
- StandardF8sV2 VirtualMachineSizeTypes = original.StandardF8sV2
- StandardG1 VirtualMachineSizeTypes = original.StandardG1
- StandardG2 VirtualMachineSizeTypes = original.StandardG2
- StandardG3 VirtualMachineSizeTypes = original.StandardG3
- StandardG4 VirtualMachineSizeTypes = original.StandardG4
- StandardG5 VirtualMachineSizeTypes = original.StandardG5
- StandardGS1 VirtualMachineSizeTypes = original.StandardGS1
- StandardGS2 VirtualMachineSizeTypes = original.StandardGS2
- StandardGS3 VirtualMachineSizeTypes = original.StandardGS3
- StandardGS4 VirtualMachineSizeTypes = original.StandardGS4
- StandardGS44 VirtualMachineSizeTypes = original.StandardGS44
- StandardGS48 VirtualMachineSizeTypes = original.StandardGS48
- StandardGS5 VirtualMachineSizeTypes = original.StandardGS5
- StandardGS516 VirtualMachineSizeTypes = original.StandardGS516
- StandardGS58 VirtualMachineSizeTypes = original.StandardGS58
- StandardH16 VirtualMachineSizeTypes = original.StandardH16
- StandardH16m VirtualMachineSizeTypes = original.StandardH16m
- StandardH16mr VirtualMachineSizeTypes = original.StandardH16mr
- StandardH16r VirtualMachineSizeTypes = original.StandardH16r
- StandardH8 VirtualMachineSizeTypes = original.StandardH8
- StandardH8m VirtualMachineSizeTypes = original.StandardH8m
- StandardL16s VirtualMachineSizeTypes = original.StandardL16s
- StandardL32s VirtualMachineSizeTypes = original.StandardL32s
- StandardL4s VirtualMachineSizeTypes = original.StandardL4s
- StandardL8s VirtualMachineSizeTypes = original.StandardL8s
- StandardM12832ms VirtualMachineSizeTypes = original.StandardM12832ms
- StandardM12864ms VirtualMachineSizeTypes = original.StandardM12864ms
- StandardM128ms VirtualMachineSizeTypes = original.StandardM128ms
- StandardM128s VirtualMachineSizeTypes = original.StandardM128s
- StandardM6416ms VirtualMachineSizeTypes = original.StandardM6416ms
- StandardM6432ms VirtualMachineSizeTypes = original.StandardM6432ms
- StandardM64ms VirtualMachineSizeTypes = original.StandardM64ms
- StandardM64s VirtualMachineSizeTypes = original.StandardM64s
- StandardNC12 VirtualMachineSizeTypes = original.StandardNC12
- StandardNC12sV2 VirtualMachineSizeTypes = original.StandardNC12sV2
- StandardNC12sV3 VirtualMachineSizeTypes = original.StandardNC12sV3
- StandardNC24 VirtualMachineSizeTypes = original.StandardNC24
- StandardNC24r VirtualMachineSizeTypes = original.StandardNC24r
- StandardNC24rsV2 VirtualMachineSizeTypes = original.StandardNC24rsV2
- StandardNC24rsV3 VirtualMachineSizeTypes = original.StandardNC24rsV3
- StandardNC24sV2 VirtualMachineSizeTypes = original.StandardNC24sV2
- StandardNC24sV3 VirtualMachineSizeTypes = original.StandardNC24sV3
- StandardNC6 VirtualMachineSizeTypes = original.StandardNC6
- StandardNC6sV2 VirtualMachineSizeTypes = original.StandardNC6sV2
- StandardNC6sV3 VirtualMachineSizeTypes = original.StandardNC6sV3
- StandardND12s VirtualMachineSizeTypes = original.StandardND12s
- StandardND24rs VirtualMachineSizeTypes = original.StandardND24rs
- StandardND24s VirtualMachineSizeTypes = original.StandardND24s
- StandardND6s VirtualMachineSizeTypes = original.StandardND6s
- StandardNV12 VirtualMachineSizeTypes = original.StandardNV12
- StandardNV24 VirtualMachineSizeTypes = original.StandardNV24
- StandardNV6 VirtualMachineSizeTypes = original.StandardNV6
-)
-
-type APIEntityReference = original.APIEntityReference
-type APIError = original.APIError
-type APIErrorBase = original.APIErrorBase
-type AccessURI = original.AccessURI
-type AccessURIOutput = original.AccessURIOutput
-type AccessURIRaw = original.AccessURIRaw
-type AdditionalUnattendContent = original.AdditionalUnattendContent
-type AutoOSUpgradePolicy = original.AutoOSUpgradePolicy
-type AvailabilitySet = original.AvailabilitySet
-type AvailabilitySetListResult = original.AvailabilitySetListResult
-type AvailabilitySetListResultIterator = original.AvailabilitySetListResultIterator
-type AvailabilitySetListResultPage = original.AvailabilitySetListResultPage
-type AvailabilitySetProperties = original.AvailabilitySetProperties
-type AvailabilitySetUpdate = original.AvailabilitySetUpdate
-type AvailabilitySetsClient = original.AvailabilitySetsClient
-type BaseClient = original.BaseClient
-type BootDiagnostics = original.BootDiagnostics
-type BootDiagnosticsInstanceView = original.BootDiagnosticsInstanceView
-type CreationData = original.CreationData
-type DataDisk = original.DataDisk
-type DataDiskImage = original.DataDiskImage
-type DiagnosticsProfile = original.DiagnosticsProfile
-type Disk = original.Disk
-type DiskEncryptionSettings = original.DiskEncryptionSettings
-type DiskInstanceView = original.DiskInstanceView
-type DiskList = original.DiskList
-type DiskListIterator = original.DiskListIterator
-type DiskListPage = original.DiskListPage
-type DiskProperties = original.DiskProperties
-type DiskSku = original.DiskSku
-type DiskUpdate = original.DiskUpdate
-type DiskUpdateProperties = original.DiskUpdateProperties
-type DisksClient = original.DisksClient
-type DisksCreateOrUpdateFuture = original.DisksCreateOrUpdateFuture
-type DisksDeleteFuture = original.DisksDeleteFuture
-type DisksGrantAccessFuture = original.DisksGrantAccessFuture
-type DisksRevokeAccessFuture = original.DisksRevokeAccessFuture
-type DisksUpdateFuture = original.DisksUpdateFuture
-type EncryptionSettings = original.EncryptionSettings
-type GrantAccessData = original.GrantAccessData
-type HardwareProfile = original.HardwareProfile
-type Image = original.Image
-type ImageDataDisk = original.ImageDataDisk
-type ImageDiskReference = original.ImageDiskReference
-type ImageListResult = original.ImageListResult
-type ImageListResultIterator = original.ImageListResultIterator
-type ImageListResultPage = original.ImageListResultPage
-type ImageOSDisk = original.ImageOSDisk
-type ImageProperties = original.ImageProperties
-type ImageReference = original.ImageReference
-type ImageStorageProfile = original.ImageStorageProfile
-type ImageUpdate = original.ImageUpdate
-type ImagesClient = original.ImagesClient
-type ImagesCreateOrUpdateFuture = original.ImagesCreateOrUpdateFuture
-type ImagesDeleteFuture = original.ImagesDeleteFuture
-type ImagesUpdateFuture = original.ImagesUpdateFuture
-type InnerError = original.InnerError
-type InstanceViewStatus = original.InstanceViewStatus
-type KeyVaultAndKeyReference = original.KeyVaultAndKeyReference
-type KeyVaultAndSecretReference = original.KeyVaultAndSecretReference
-type KeyVaultKeyReference = original.KeyVaultKeyReference
-type KeyVaultSecretReference = original.KeyVaultSecretReference
-type LinuxConfiguration = original.LinuxConfiguration
-type ListUsagesResult = original.ListUsagesResult
-type ListUsagesResultIterator = original.ListUsagesResultIterator
-type ListUsagesResultPage = original.ListUsagesResultPage
-type ListVirtualMachineExtensionImage = original.ListVirtualMachineExtensionImage
-type ListVirtualMachineImageResource = original.ListVirtualMachineImageResource
-type LogAnalyticsClient = original.LogAnalyticsClient
-type LogAnalyticsExportRequestRateByIntervalFuture = original.LogAnalyticsExportRequestRateByIntervalFuture
-type LogAnalyticsExportThrottledRequestsFuture = original.LogAnalyticsExportThrottledRequestsFuture
-type LogAnalyticsInputBase = original.LogAnalyticsInputBase
-type LogAnalyticsOperationResult = original.LogAnalyticsOperationResult
-type LogAnalyticsOutput = original.LogAnalyticsOutput
-type LongRunningOperationProperties = original.LongRunningOperationProperties
-type MaintenanceRedeployStatus = original.MaintenanceRedeployStatus
-type ManagedDiskParameters = original.ManagedDiskParameters
-type NetworkInterfaceReference = original.NetworkInterfaceReference
-type NetworkInterfaceReferenceProperties = original.NetworkInterfaceReferenceProperties
-type NetworkProfile = original.NetworkProfile
-type OSDisk = original.OSDisk
-type OSDiskImage = original.OSDiskImage
-type OSProfile = original.OSProfile
-type OperationListResult = original.OperationListResult
-type OperationStatusResponse = original.OperationStatusResponse
-type OperationValue = original.OperationValue
-type OperationValueDisplay = original.OperationValueDisplay
-type OperationsClient = original.OperationsClient
-type Plan = original.Plan
-type PurchasePlan = original.PurchasePlan
-type RecoveryWalkResponse = original.RecoveryWalkResponse
-type RequestRateByIntervalInput = original.RequestRateByIntervalInput
-type Resource = original.Resource
-type ResourceSku = original.ResourceSku
-type ResourceSkuCapabilities = original.ResourceSkuCapabilities
-type ResourceSkuCapacity = original.ResourceSkuCapacity
-type ResourceSkuCosts = original.ResourceSkuCosts
-type ResourceSkuLocationInfo = original.ResourceSkuLocationInfo
-type ResourceSkuRestrictionInfo = original.ResourceSkuRestrictionInfo
-type ResourceSkuRestrictions = original.ResourceSkuRestrictions
-type ResourceSkusClient = original.ResourceSkusClient
-type ResourceSkusResult = original.ResourceSkusResult
-type ResourceSkusResultIterator = original.ResourceSkusResultIterator
-type ResourceSkusResultPage = original.ResourceSkusResultPage
-type ResourceUpdate = original.ResourceUpdate
-type RollbackStatusInfo = original.RollbackStatusInfo
-type RollingUpgradePolicy = original.RollingUpgradePolicy
-type RollingUpgradeProgressInfo = original.RollingUpgradeProgressInfo
-type RollingUpgradeRunningStatus = original.RollingUpgradeRunningStatus
-type RollingUpgradeStatusInfo = original.RollingUpgradeStatusInfo
-type RollingUpgradeStatusInfoProperties = original.RollingUpgradeStatusInfoProperties
-type RunCommandDocument = original.RunCommandDocument
-type RunCommandDocumentBase = original.RunCommandDocumentBase
-type RunCommandInput = original.RunCommandInput
-type RunCommandInputParameter = original.RunCommandInputParameter
-type RunCommandListResult = original.RunCommandListResult
-type RunCommandListResultIterator = original.RunCommandListResultIterator
-type RunCommandListResultPage = original.RunCommandListResultPage
-type RunCommandParameterDefinition = original.RunCommandParameterDefinition
-type RunCommandResult = original.RunCommandResult
-type RunCommandResultProperties = original.RunCommandResultProperties
-type SSHConfiguration = original.SSHConfiguration
-type SSHPublicKey = original.SSHPublicKey
-type Sku = original.Sku
-type Snapshot = original.Snapshot
-type SnapshotList = original.SnapshotList
-type SnapshotListIterator = original.SnapshotListIterator
-type SnapshotListPage = original.SnapshotListPage
-type SnapshotUpdate = original.SnapshotUpdate
-type SnapshotsClient = original.SnapshotsClient
-type SnapshotsCreateOrUpdateFuture = original.SnapshotsCreateOrUpdateFuture
-type SnapshotsDeleteFuture = original.SnapshotsDeleteFuture
-type SnapshotsGrantAccessFuture = original.SnapshotsGrantAccessFuture
-type SnapshotsRevokeAccessFuture = original.SnapshotsRevokeAccessFuture
-type SnapshotsUpdateFuture = original.SnapshotsUpdateFuture
-type SourceVault = original.SourceVault
-type StorageProfile = original.StorageProfile
-type SubResource = original.SubResource
-type SubResourceReadOnly = original.SubResourceReadOnly
-type ThrottledRequestsInput = original.ThrottledRequestsInput
-type UpdateResource = original.UpdateResource
-type UpgradeOperationHistoricalStatusInfo = original.UpgradeOperationHistoricalStatusInfo
-type UpgradeOperationHistoricalStatusInfoProperties = original.UpgradeOperationHistoricalStatusInfoProperties
-type UpgradeOperationHistoryStatus = original.UpgradeOperationHistoryStatus
-type UpgradePolicy = original.UpgradePolicy
-type Usage = original.Usage
-type UsageClient = original.UsageClient
-type UsageName = original.UsageName
-type VaultCertificate = original.VaultCertificate
-type VaultSecretGroup = original.VaultSecretGroup
-type VirtualHardDisk = original.VirtualHardDisk
-type VirtualMachine = original.VirtualMachine
-type VirtualMachineAgentInstanceView = original.VirtualMachineAgentInstanceView
-type VirtualMachineCaptureParameters = original.VirtualMachineCaptureParameters
-type VirtualMachineCaptureResult = original.VirtualMachineCaptureResult
-type VirtualMachineCaptureResultProperties = original.VirtualMachineCaptureResultProperties
-type VirtualMachineExtension = original.VirtualMachineExtension
-type VirtualMachineExtensionHandlerInstanceView = original.VirtualMachineExtensionHandlerInstanceView
-type VirtualMachineExtensionImage = original.VirtualMachineExtensionImage
-type VirtualMachineExtensionImageProperties = original.VirtualMachineExtensionImageProperties
-type VirtualMachineExtensionImagesClient = original.VirtualMachineExtensionImagesClient
-type VirtualMachineExtensionInstanceView = original.VirtualMachineExtensionInstanceView
-type VirtualMachineExtensionProperties = original.VirtualMachineExtensionProperties
-type VirtualMachineExtensionUpdate = original.VirtualMachineExtensionUpdate
-type VirtualMachineExtensionUpdateProperties = original.VirtualMachineExtensionUpdateProperties
-type VirtualMachineExtensionsClient = original.VirtualMachineExtensionsClient
-type VirtualMachineExtensionsCreateOrUpdateFuture = original.VirtualMachineExtensionsCreateOrUpdateFuture
-type VirtualMachineExtensionsDeleteFuture = original.VirtualMachineExtensionsDeleteFuture
-type VirtualMachineExtensionsListResult = original.VirtualMachineExtensionsListResult
-type VirtualMachineExtensionsUpdateFuture = original.VirtualMachineExtensionsUpdateFuture
-type VirtualMachineHealthStatus = original.VirtualMachineHealthStatus
-type VirtualMachineIdentity = original.VirtualMachineIdentity
-type VirtualMachineImage = original.VirtualMachineImage
-type VirtualMachineImageProperties = original.VirtualMachineImageProperties
-type VirtualMachineImageResource = original.VirtualMachineImageResource
-type VirtualMachineImagesClient = original.VirtualMachineImagesClient
-type VirtualMachineInstanceView = original.VirtualMachineInstanceView
-type VirtualMachineListResult = original.VirtualMachineListResult
-type VirtualMachineListResultIterator = original.VirtualMachineListResultIterator
-type VirtualMachineListResultPage = original.VirtualMachineListResultPage
-type VirtualMachineProperties = original.VirtualMachineProperties
-type VirtualMachineRunCommandsClient = original.VirtualMachineRunCommandsClient
-type VirtualMachineScaleSet = original.VirtualMachineScaleSet
-type VirtualMachineScaleSetDataDisk = original.VirtualMachineScaleSetDataDisk
-type VirtualMachineScaleSetExtension = original.VirtualMachineScaleSetExtension
-type VirtualMachineScaleSetExtensionListResult = original.VirtualMachineScaleSetExtensionListResult
-type VirtualMachineScaleSetExtensionListResultIterator = original.VirtualMachineScaleSetExtensionListResultIterator
-type VirtualMachineScaleSetExtensionListResultPage = original.VirtualMachineScaleSetExtensionListResultPage
-type VirtualMachineScaleSetExtensionProfile = original.VirtualMachineScaleSetExtensionProfile
-type VirtualMachineScaleSetExtensionProperties = original.VirtualMachineScaleSetExtensionProperties
-type VirtualMachineScaleSetExtensionsClient = original.VirtualMachineScaleSetExtensionsClient
-type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture = original.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture
-type VirtualMachineScaleSetExtensionsDeleteFuture = original.VirtualMachineScaleSetExtensionsDeleteFuture
-type VirtualMachineScaleSetIPConfiguration = original.VirtualMachineScaleSetIPConfiguration
-type VirtualMachineScaleSetIPConfigurationProperties = original.VirtualMachineScaleSetIPConfigurationProperties
-type VirtualMachineScaleSetIdentity = original.VirtualMachineScaleSetIdentity
-type VirtualMachineScaleSetInstanceView = original.VirtualMachineScaleSetInstanceView
-type VirtualMachineScaleSetInstanceViewStatusesSummary = original.VirtualMachineScaleSetInstanceViewStatusesSummary
-type VirtualMachineScaleSetListOSUpgradeHistory = original.VirtualMachineScaleSetListOSUpgradeHistory
-type VirtualMachineScaleSetListOSUpgradeHistoryIterator = original.VirtualMachineScaleSetListOSUpgradeHistoryIterator
-type VirtualMachineScaleSetListOSUpgradeHistoryPage = original.VirtualMachineScaleSetListOSUpgradeHistoryPage
-type VirtualMachineScaleSetListResult = original.VirtualMachineScaleSetListResult
-type VirtualMachineScaleSetListResultIterator = original.VirtualMachineScaleSetListResultIterator
-type VirtualMachineScaleSetListResultPage = original.VirtualMachineScaleSetListResultPage
-type VirtualMachineScaleSetListSkusResult = original.VirtualMachineScaleSetListSkusResult
-type VirtualMachineScaleSetListSkusResultIterator = original.VirtualMachineScaleSetListSkusResultIterator
-type VirtualMachineScaleSetListSkusResultPage = original.VirtualMachineScaleSetListSkusResultPage
-type VirtualMachineScaleSetListWithLinkResult = original.VirtualMachineScaleSetListWithLinkResult
-type VirtualMachineScaleSetListWithLinkResultIterator = original.VirtualMachineScaleSetListWithLinkResultIterator
-type VirtualMachineScaleSetListWithLinkResultPage = original.VirtualMachineScaleSetListWithLinkResultPage
-type VirtualMachineScaleSetManagedDiskParameters = original.VirtualMachineScaleSetManagedDiskParameters
-type VirtualMachineScaleSetNetworkConfiguration = original.VirtualMachineScaleSetNetworkConfiguration
-type VirtualMachineScaleSetNetworkConfigurationDNSSettings = original.VirtualMachineScaleSetNetworkConfigurationDNSSettings
-type VirtualMachineScaleSetNetworkConfigurationProperties = original.VirtualMachineScaleSetNetworkConfigurationProperties
-type VirtualMachineScaleSetNetworkProfile = original.VirtualMachineScaleSetNetworkProfile
-type VirtualMachineScaleSetOSDisk = original.VirtualMachineScaleSetOSDisk
-type VirtualMachineScaleSetOSProfile = original.VirtualMachineScaleSetOSProfile
-type VirtualMachineScaleSetProperties = original.VirtualMachineScaleSetProperties
-type VirtualMachineScaleSetPublicIPAddressConfiguration = original.VirtualMachineScaleSetPublicIPAddressConfiguration
-type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings = original.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings
-type VirtualMachineScaleSetPublicIPAddressConfigurationProperties = original.VirtualMachineScaleSetPublicIPAddressConfigurationProperties
-type VirtualMachineScaleSetRollingUpgradesCancelFuture = original.VirtualMachineScaleSetRollingUpgradesCancelFuture
-type VirtualMachineScaleSetRollingUpgradesClient = original.VirtualMachineScaleSetRollingUpgradesClient
-type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture = original.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture
-type VirtualMachineScaleSetSku = original.VirtualMachineScaleSetSku
-type VirtualMachineScaleSetSkuCapacity = original.VirtualMachineScaleSetSkuCapacity
-type VirtualMachineScaleSetStorageProfile = original.VirtualMachineScaleSetStorageProfile
-type VirtualMachineScaleSetUpdate = original.VirtualMachineScaleSetUpdate
-type VirtualMachineScaleSetUpdateIPConfiguration = original.VirtualMachineScaleSetUpdateIPConfiguration
-type VirtualMachineScaleSetUpdateIPConfigurationProperties = original.VirtualMachineScaleSetUpdateIPConfigurationProperties
-type VirtualMachineScaleSetUpdateNetworkConfiguration = original.VirtualMachineScaleSetUpdateNetworkConfiguration
-type VirtualMachineScaleSetUpdateNetworkConfigurationProperties = original.VirtualMachineScaleSetUpdateNetworkConfigurationProperties
-type VirtualMachineScaleSetUpdateNetworkProfile = original.VirtualMachineScaleSetUpdateNetworkProfile
-type VirtualMachineScaleSetUpdateOSDisk = original.VirtualMachineScaleSetUpdateOSDisk
-type VirtualMachineScaleSetUpdateOSProfile = original.VirtualMachineScaleSetUpdateOSProfile
-type VirtualMachineScaleSetUpdateProperties = original.VirtualMachineScaleSetUpdateProperties
-type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration = original.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration
-type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = original.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties
-type VirtualMachineScaleSetUpdateStorageProfile = original.VirtualMachineScaleSetUpdateStorageProfile
-type VirtualMachineScaleSetUpdateVMProfile = original.VirtualMachineScaleSetUpdateVMProfile
-type VirtualMachineScaleSetVM = original.VirtualMachineScaleSetVM
-type VirtualMachineScaleSetVMExtensionsSummary = original.VirtualMachineScaleSetVMExtensionsSummary
-type VirtualMachineScaleSetVMInstanceIDs = original.VirtualMachineScaleSetVMInstanceIDs
-type VirtualMachineScaleSetVMInstanceRequiredIDs = original.VirtualMachineScaleSetVMInstanceRequiredIDs
-type VirtualMachineScaleSetVMInstanceView = original.VirtualMachineScaleSetVMInstanceView
-type VirtualMachineScaleSetVMListResult = original.VirtualMachineScaleSetVMListResult
-type VirtualMachineScaleSetVMListResultIterator = original.VirtualMachineScaleSetVMListResultIterator
-type VirtualMachineScaleSetVMListResultPage = original.VirtualMachineScaleSetVMListResultPage
-type VirtualMachineScaleSetVMProfile = original.VirtualMachineScaleSetVMProfile
-type VirtualMachineScaleSetVMProperties = original.VirtualMachineScaleSetVMProperties
-type VirtualMachineScaleSetVMsClient = original.VirtualMachineScaleSetVMsClient
-type VirtualMachineScaleSetVMsDeallocateFuture = original.VirtualMachineScaleSetVMsDeallocateFuture
-type VirtualMachineScaleSetVMsDeleteFuture = original.VirtualMachineScaleSetVMsDeleteFuture
-type VirtualMachineScaleSetVMsPerformMaintenanceFuture = original.VirtualMachineScaleSetVMsPerformMaintenanceFuture
-type VirtualMachineScaleSetVMsPowerOffFuture = original.VirtualMachineScaleSetVMsPowerOffFuture
-type VirtualMachineScaleSetVMsRedeployFuture = original.VirtualMachineScaleSetVMsRedeployFuture
-type VirtualMachineScaleSetVMsReimageAllFuture = original.VirtualMachineScaleSetVMsReimageAllFuture
-type VirtualMachineScaleSetVMsReimageFuture = original.VirtualMachineScaleSetVMsReimageFuture
-type VirtualMachineScaleSetVMsRestartFuture = original.VirtualMachineScaleSetVMsRestartFuture
-type VirtualMachineScaleSetVMsStartFuture = original.VirtualMachineScaleSetVMsStartFuture
-type VirtualMachineScaleSetVMsUpdateFuture = original.VirtualMachineScaleSetVMsUpdateFuture
-type VirtualMachineScaleSetsClient = original.VirtualMachineScaleSetsClient
-type VirtualMachineScaleSetsCreateOrUpdateFuture = original.VirtualMachineScaleSetsCreateOrUpdateFuture
-type VirtualMachineScaleSetsDeallocateFuture = original.VirtualMachineScaleSetsDeallocateFuture
-type VirtualMachineScaleSetsDeleteFuture = original.VirtualMachineScaleSetsDeleteFuture
-type VirtualMachineScaleSetsDeleteInstancesFuture = original.VirtualMachineScaleSetsDeleteInstancesFuture
-type VirtualMachineScaleSetsPerformMaintenanceFuture = original.VirtualMachineScaleSetsPerformMaintenanceFuture
-type VirtualMachineScaleSetsPowerOffFuture = original.VirtualMachineScaleSetsPowerOffFuture
-type VirtualMachineScaleSetsRedeployFuture = original.VirtualMachineScaleSetsRedeployFuture
-type VirtualMachineScaleSetsReimageAllFuture = original.VirtualMachineScaleSetsReimageAllFuture
-type VirtualMachineScaleSetsReimageFuture = original.VirtualMachineScaleSetsReimageFuture
-type VirtualMachineScaleSetsRestartFuture = original.VirtualMachineScaleSetsRestartFuture
-type VirtualMachineScaleSetsStartFuture = original.VirtualMachineScaleSetsStartFuture
-type VirtualMachineScaleSetsUpdateFuture = original.VirtualMachineScaleSetsUpdateFuture
-type VirtualMachineScaleSetsUpdateInstancesFuture = original.VirtualMachineScaleSetsUpdateInstancesFuture
-type VirtualMachineSize = original.VirtualMachineSize
-type VirtualMachineSizeListResult = original.VirtualMachineSizeListResult
-type VirtualMachineSizesClient = original.VirtualMachineSizesClient
-type VirtualMachineStatusCodeCount = original.VirtualMachineStatusCodeCount
-type VirtualMachineUpdate = original.VirtualMachineUpdate
-type VirtualMachinesCaptureFuture = original.VirtualMachinesCaptureFuture
-type VirtualMachinesClient = original.VirtualMachinesClient
-type VirtualMachinesConvertToManagedDisksFuture = original.VirtualMachinesConvertToManagedDisksFuture
-type VirtualMachinesCreateOrUpdateFuture = original.VirtualMachinesCreateOrUpdateFuture
-type VirtualMachinesDeallocateFuture = original.VirtualMachinesDeallocateFuture
-type VirtualMachinesDeleteFuture = original.VirtualMachinesDeleteFuture
-type VirtualMachinesPerformMaintenanceFuture = original.VirtualMachinesPerformMaintenanceFuture
-type VirtualMachinesPowerOffFuture = original.VirtualMachinesPowerOffFuture
-type VirtualMachinesRedeployFuture = original.VirtualMachinesRedeployFuture
-type VirtualMachinesRestartFuture = original.VirtualMachinesRestartFuture
-type VirtualMachinesRunCommandFuture = original.VirtualMachinesRunCommandFuture
-type VirtualMachinesStartFuture = original.VirtualMachinesStartFuture
-type VirtualMachinesUpdateFuture = original.VirtualMachinesUpdateFuture
-type WinRMConfiguration = original.WinRMConfiguration
-type WinRMListener = original.WinRMListener
-type WindowsConfiguration = original.WindowsConfiguration
-
-func New(subscriptionID string) BaseClient {
- return original.New(subscriptionID)
-}
-func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator {
- return original.NewAvailabilitySetListResultIterator(page)
-}
-func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage {
- return original.NewAvailabilitySetListResultPage(cur, getNextPage)
-}
-func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient {
- return original.NewAvailabilitySetsClient(subscriptionID)
-}
-func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient {
- return original.NewAvailabilitySetsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewDiskListIterator(page DiskListPage) DiskListIterator {
- return original.NewDiskListIterator(page)
-}
-func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage {
- return original.NewDiskListPage(cur, getNextPage)
-}
-func NewDisksClient(subscriptionID string) DisksClient {
- return original.NewDisksClient(subscriptionID)
-}
-func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient {
- return original.NewDisksClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator {
- return original.NewImageListResultIterator(page)
-}
-func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage {
- return original.NewImageListResultPage(cur, getNextPage)
-}
-func NewImagesClient(subscriptionID string) ImagesClient {
- return original.NewImagesClient(subscriptionID)
-}
-func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient {
- return original.NewImagesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator {
- return original.NewListUsagesResultIterator(page)
-}
-func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage {
- return original.NewListUsagesResultPage(cur, getNextPage)
-}
-func NewLogAnalyticsClient(subscriptionID string) LogAnalyticsClient {
- return original.NewLogAnalyticsClient(subscriptionID)
-}
-func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) LogAnalyticsClient {
- return original.NewLogAnalyticsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewOperationsClient(subscriptionID string) OperationsClient {
- return original.NewOperationsClient(subscriptionID)
-}
-func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
- return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewResourceSkusClient(subscriptionID string) ResourceSkusClient {
- return original.NewResourceSkusClient(subscriptionID)
-}
-func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient {
- return original.NewResourceSkusClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator {
- return original.NewResourceSkusResultIterator(page)
-}
-func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage {
- return original.NewResourceSkusResultPage(cur, getNextPage)
-}
-func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator {
- return original.NewRunCommandListResultIterator(page)
-}
-func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage {
- return original.NewRunCommandListResultPage(cur, getNextPage)
-}
-func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator {
- return original.NewSnapshotListIterator(page)
-}
-func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage {
- return original.NewSnapshotListPage(cur, getNextPage)
-}
-func NewSnapshotsClient(subscriptionID string) SnapshotsClient {
- return original.NewSnapshotsClient(subscriptionID)
-}
-func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient {
- return original.NewSnapshotsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewUsageClient(subscriptionID string) UsageClient {
- return original.NewUsageClient(subscriptionID)
-}
-func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient {
- return original.NewUsageClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient {
- return original.NewVirtualMachineExtensionImagesClient(subscriptionID)
-}
-func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient {
- return original.NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient {
- return original.NewVirtualMachineExtensionsClient(subscriptionID)
-}
-func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient {
- return original.NewVirtualMachineExtensionsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient {
- return original.NewVirtualMachineImagesClient(subscriptionID)
-}
-func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient {
- return original.NewVirtualMachineImagesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator {
- return original.NewVirtualMachineListResultIterator(page)
-}
-func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage {
- return original.NewVirtualMachineListResultPage(cur, getNextPage)
-}
-func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient {
- return original.NewVirtualMachineRunCommandsClient(subscriptionID)
-}
-func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient {
- return original.NewVirtualMachineRunCommandsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator {
- return original.NewVirtualMachineScaleSetExtensionListResultIterator(page)
-}
-func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage {
- return original.NewVirtualMachineScaleSetExtensionListResultPage(cur, getNextPage)
-}
-func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient {
- return original.NewVirtualMachineScaleSetExtensionsClient(subscriptionID)
-}
-func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient {
- return original.NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator {
- return original.NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page)
-}
-func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage {
- return original.NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur, getNextPage)
-}
-func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator {
- return original.NewVirtualMachineScaleSetListResultIterator(page)
-}
-func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage {
- return original.NewVirtualMachineScaleSetListResultPage(cur, getNextPage)
-}
-func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator {
- return original.NewVirtualMachineScaleSetListSkusResultIterator(page)
-}
-func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage {
- return original.NewVirtualMachineScaleSetListSkusResultPage(cur, getNextPage)
-}
-func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator {
- return original.NewVirtualMachineScaleSetListWithLinkResultIterator(page)
-}
-func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage {
- return original.NewVirtualMachineScaleSetListWithLinkResultPage(cur, getNextPage)
-}
-func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient {
- return original.NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID)
-}
-func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient {
- return original.NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator {
- return original.NewVirtualMachineScaleSetVMListResultIterator(page)
-}
-func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage {
- return original.NewVirtualMachineScaleSetVMListResultPage(cur, getNextPage)
-}
-func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient {
- return original.NewVirtualMachineScaleSetVMsClient(subscriptionID)
-}
-func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient {
- return original.NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient {
- return original.NewVirtualMachineScaleSetsClient(subscriptionID)
-}
-func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient {
- return original.NewVirtualMachineScaleSetsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient {
- return original.NewVirtualMachineSizesClient(subscriptionID)
-}
-func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient {
- return original.NewVirtualMachineSizesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient {
- return original.NewVirtualMachinesClient(subscriptionID)
-}
-func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient {
- return original.NewVirtualMachinesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return original.NewWithBaseURI(baseURI, subscriptionID)
-}
-func PossibleAccessLevelValues() []AccessLevel {
- return original.PossibleAccessLevelValues()
-}
-func PossibleCachingTypesValues() []CachingTypes {
- return original.PossibleCachingTypesValues()
-}
-func PossibleComponentNamesValues() []ComponentNames {
- return original.PossibleComponentNamesValues()
-}
-func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes {
- return original.PossibleDiskCreateOptionTypesValues()
-}
-func PossibleDiskCreateOptionValues() []DiskCreateOption {
- return original.PossibleDiskCreateOptionValues()
-}
-func PossibleIPVersionValues() []IPVersion {
- return original.PossibleIPVersionValues()
-}
-func PossibleInstanceViewTypesValues() []InstanceViewTypes {
- return original.PossibleInstanceViewTypesValues()
-}
-func PossibleIntervalInMinsValues() []IntervalInMins {
- return original.PossibleIntervalInMinsValues()
-}
-func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes {
- return original.PossibleMaintenanceOperationResultCodeTypesValues()
-}
-func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes {
- return original.PossibleOperatingSystemStateTypesValues()
-}
-func PossibleOperatingSystemTypesValues() []OperatingSystemTypes {
- return original.PossibleOperatingSystemTypesValues()
-}
-func PossiblePassNamesValues() []PassNames {
- return original.PossiblePassNamesValues()
-}
-func PossibleProtocolTypesValues() []ProtocolTypes {
- return original.PossibleProtocolTypesValues()
-}
-func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
- return original.PossibleResourceIdentityTypeValues()
-}
-func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType {
- return original.PossibleResourceSkuCapacityScaleTypeValues()
-}
-func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode {
- return original.PossibleResourceSkuRestrictionsReasonCodeValues()
-}
-func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType {
- return original.PossibleResourceSkuRestrictionsTypeValues()
-}
-func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType {
- return original.PossibleRollingUpgradeActionTypeValues()
-}
-func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode {
- return original.PossibleRollingUpgradeStatusCodeValues()
-}
-func PossibleSettingNamesValues() []SettingNames {
- return original.PossibleSettingNamesValues()
-}
-func PossibleStatusLevelTypesValues() []StatusLevelTypes {
- return original.PossibleStatusLevelTypesValues()
-}
-func PossibleStorageAccountTypesValues() []StorageAccountTypes {
- return original.PossibleStorageAccountTypesValues()
-}
-func PossibleUpgradeModeValues() []UpgradeMode {
- return original.PossibleUpgradeModeValues()
-}
-func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker {
- return original.PossibleUpgradeOperationInvokerValues()
-}
-func PossibleUpgradeStateValues() []UpgradeState {
- return original.PossibleUpgradeStateValues()
-}
-func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes {
- return original.PossibleVirtualMachineEvictionPolicyTypesValues()
-}
-func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes {
- return original.PossibleVirtualMachinePriorityTypesValues()
-}
-func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType {
- return original.PossibleVirtualMachineScaleSetSkuScaleTypeValues()
-}
-func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes {
- return original.PossibleVirtualMachineSizeTypesValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/2019-03-01"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/resources/mgmt/resources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/resources/mgmt/resources/models.go
deleted file mode 100644
index 1fa6e9612..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/resources/mgmt/resources/models.go
+++ /dev/null
@@ -1,241 +0,0 @@
-//go:build go1.9
-// +build go1.9
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder
-
-package resources
-
-import (
- "context"
-
- original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources"
-)
-
-const (
- DefaultBaseURI = original.DefaultBaseURI
-)
-
-type DeploymentMode = original.DeploymentMode
-
-const (
- Complete DeploymentMode = original.Complete
- Incremental DeploymentMode = original.Incremental
-)
-
-type OnErrorDeploymentType = original.OnErrorDeploymentType
-
-const (
- LastSuccessful OnErrorDeploymentType = original.LastSuccessful
- SpecificDeployment OnErrorDeploymentType = original.SpecificDeployment
-)
-
-type ResourceIdentityType = original.ResourceIdentityType
-
-const (
- None ResourceIdentityType = original.None
- SystemAssigned ResourceIdentityType = original.SystemAssigned
- SystemAssignedUserAssigned ResourceIdentityType = original.SystemAssignedUserAssigned
- UserAssigned ResourceIdentityType = original.UserAssigned
-)
-
-type AliasPathType = original.AliasPathType
-type AliasType = original.AliasType
-type BaseClient = original.BaseClient
-type BasicDependency = original.BasicDependency
-type Client = original.Client
-type CloudError = original.CloudError
-type CreateOrUpdateByIDFuture = original.CreateOrUpdateByIDFuture
-type CreateOrUpdateFuture = original.CreateOrUpdateFuture
-type DebugSetting = original.DebugSetting
-type DeleteByIDFuture = original.DeleteByIDFuture
-type DeleteFuture = original.DeleteFuture
-type Dependency = original.Dependency
-type Deployment = original.Deployment
-type DeploymentExportResult = original.DeploymentExportResult
-type DeploymentExtended = original.DeploymentExtended
-type DeploymentExtendedFilter = original.DeploymentExtendedFilter
-type DeploymentListResult = original.DeploymentListResult
-type DeploymentListResultIterator = original.DeploymentListResultIterator
-type DeploymentListResultPage = original.DeploymentListResultPage
-type DeploymentOperation = original.DeploymentOperation
-type DeploymentOperationProperties = original.DeploymentOperationProperties
-type DeploymentOperationsClient = original.DeploymentOperationsClient
-type DeploymentOperationsListResult = original.DeploymentOperationsListResult
-type DeploymentOperationsListResultIterator = original.DeploymentOperationsListResultIterator
-type DeploymentOperationsListResultPage = original.DeploymentOperationsListResultPage
-type DeploymentProperties = original.DeploymentProperties
-type DeploymentPropertiesExtended = original.DeploymentPropertiesExtended
-type DeploymentValidateResult = original.DeploymentValidateResult
-type DeploymentsClient = original.DeploymentsClient
-type DeploymentsCreateOrUpdateAtSubscriptionScopeFuture = original.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture
-type DeploymentsCreateOrUpdateFuture = original.DeploymentsCreateOrUpdateFuture
-type DeploymentsDeleteAtSubscriptionScopeFuture = original.DeploymentsDeleteAtSubscriptionScopeFuture
-type DeploymentsDeleteFuture = original.DeploymentsDeleteFuture
-type ErrorAdditionalInfo = original.ErrorAdditionalInfo
-type ErrorResponse = original.ErrorResponse
-type ExportTemplateRequest = original.ExportTemplateRequest
-type GenericResource = original.GenericResource
-type GenericResourceExpanded = original.GenericResourceExpanded
-type GenericResourceFilter = original.GenericResourceFilter
-type Group = original.Group
-type GroupExportResult = original.GroupExportResult
-type GroupFilter = original.GroupFilter
-type GroupListResult = original.GroupListResult
-type GroupListResultIterator = original.GroupListResultIterator
-type GroupListResultPage = original.GroupListResultPage
-type GroupPatchable = original.GroupPatchable
-type GroupProperties = original.GroupProperties
-type GroupsClient = original.GroupsClient
-type GroupsDeleteFuture = original.GroupsDeleteFuture
-type HTTPMessage = original.HTTPMessage
-type Identity = original.Identity
-type IdentityUserAssignedIdentitiesValue = original.IdentityUserAssignedIdentitiesValue
-type ListResult = original.ListResult
-type ListResultIterator = original.ListResultIterator
-type ListResultPage = original.ListResultPage
-type ManagementErrorWithDetails = original.ManagementErrorWithDetails
-type MoveInfo = original.MoveInfo
-type MoveResourcesFuture = original.MoveResourcesFuture
-type OnErrorDeployment = original.OnErrorDeployment
-type OnErrorDeploymentExtended = original.OnErrorDeploymentExtended
-type Operation = original.Operation
-type OperationDisplay = original.OperationDisplay
-type OperationListResult = original.OperationListResult
-type OperationListResultIterator = original.OperationListResultIterator
-type OperationListResultPage = original.OperationListResultPage
-type OperationsClient = original.OperationsClient
-type ParametersLink = original.ParametersLink
-type Plan = original.Plan
-type Provider = original.Provider
-type ProviderListResult = original.ProviderListResult
-type ProviderListResultIterator = original.ProviderListResultIterator
-type ProviderListResultPage = original.ProviderListResultPage
-type ProviderOperationDisplayProperties = original.ProviderOperationDisplayProperties
-type ProviderResourceType = original.ProviderResourceType
-type ProvidersClient = original.ProvidersClient
-type Resource = original.Resource
-type Sku = original.Sku
-type SubResource = original.SubResource
-type TagCount = original.TagCount
-type TagDetails = original.TagDetails
-type TagValue = original.TagValue
-type TagsClient = original.TagsClient
-type TagsListResult = original.TagsListResult
-type TagsListResultIterator = original.TagsListResultIterator
-type TagsListResultPage = original.TagsListResultPage
-type TargetResource = original.TargetResource
-type TemplateHashResult = original.TemplateHashResult
-type TemplateLink = original.TemplateLink
-type UpdateByIDFuture = original.UpdateByIDFuture
-type UpdateFuture = original.UpdateFuture
-type ValidateMoveResourcesFuture = original.ValidateMoveResourcesFuture
-
-func New(subscriptionID string) BaseClient {
- return original.New(subscriptionID)
-}
-func NewClient(subscriptionID string) Client {
- return original.NewClient(subscriptionID)
-}
-func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
- return original.NewClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewDeploymentListResultIterator(page DeploymentListResultPage) DeploymentListResultIterator {
- return original.NewDeploymentListResultIterator(page)
-}
-func NewDeploymentListResultPage(cur DeploymentListResult, getNextPage func(context.Context, DeploymentListResult) (DeploymentListResult, error)) DeploymentListResultPage {
- return original.NewDeploymentListResultPage(cur, getNextPage)
-}
-func NewDeploymentOperationsClient(subscriptionID string) DeploymentOperationsClient {
- return original.NewDeploymentOperationsClient(subscriptionID)
-}
-func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentOperationsClient {
- return original.NewDeploymentOperationsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewDeploymentOperationsListResultIterator(page DeploymentOperationsListResultPage) DeploymentOperationsListResultIterator {
- return original.NewDeploymentOperationsListResultIterator(page)
-}
-func NewDeploymentOperationsListResultPage(cur DeploymentOperationsListResult, getNextPage func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)) DeploymentOperationsListResultPage {
- return original.NewDeploymentOperationsListResultPage(cur, getNextPage)
-}
-func NewDeploymentsClient(subscriptionID string) DeploymentsClient {
- return original.NewDeploymentsClient(subscriptionID)
-}
-func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentsClient {
- return original.NewDeploymentsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewGroupListResultIterator(page GroupListResultPage) GroupListResultIterator {
- return original.NewGroupListResultIterator(page)
-}
-func NewGroupListResultPage(cur GroupListResult, getNextPage func(context.Context, GroupListResult) (GroupListResult, error)) GroupListResultPage {
- return original.NewGroupListResultPage(cur, getNextPage)
-}
-func NewGroupsClient(subscriptionID string) GroupsClient {
- return original.NewGroupsClient(subscriptionID)
-}
-func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsClient {
- return original.NewGroupsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewListResultIterator(page ListResultPage) ListResultIterator {
- return original.NewListResultIterator(page)
-}
-func NewListResultPage(cur ListResult, getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage {
- return original.NewListResultPage(cur, getNextPage)
-}
-func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
- return original.NewOperationListResultIterator(page)
-}
-func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
- return original.NewOperationListResultPage(cur, getNextPage)
-}
-func NewOperationsClient(subscriptionID string) OperationsClient {
- return original.NewOperationsClient(subscriptionID)
-}
-func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
- return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewProviderListResultIterator(page ProviderListResultPage) ProviderListResultIterator {
- return original.NewProviderListResultIterator(page)
-}
-func NewProviderListResultPage(cur ProviderListResult, getNextPage func(context.Context, ProviderListResult) (ProviderListResult, error)) ProviderListResultPage {
- return original.NewProviderListResultPage(cur, getNextPage)
-}
-func NewProvidersClient(subscriptionID string) ProvidersClient {
- return original.NewProvidersClient(subscriptionID)
-}
-func NewProvidersClientWithBaseURI(baseURI string, subscriptionID string) ProvidersClient {
- return original.NewProvidersClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewTagsClient(subscriptionID string) TagsClient {
- return original.NewTagsClient(subscriptionID)
-}
-func NewTagsClientWithBaseURI(baseURI string, subscriptionID string) TagsClient {
- return original.NewTagsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewTagsListResultIterator(page TagsListResultPage) TagsListResultIterator {
- return original.NewTagsListResultIterator(page)
-}
-func NewTagsListResultPage(cur TagsListResult, getNextPage func(context.Context, TagsListResult) (TagsListResult, error)) TagsListResultPage {
- return original.NewTagsListResultPage(cur, getNextPage)
-}
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return original.NewWithBaseURI(baseURI, subscriptionID)
-}
-func PossibleDeploymentModeValues() []DeploymentMode {
- return original.PossibleDeploymentModeValues()
-}
-func PossibleOnErrorDeploymentTypeValues() []OnErrorDeploymentType {
- return original.PossibleOnErrorDeploymentTypeValues()
-}
-func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
- return original.PossibleResourceIdentityTypeValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/2019-03-01"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/storage/mgmt/storage/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/storage/mgmt/storage/models.go
deleted file mode 100644
index 37c212b5d..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/storage/mgmt/storage/models.go
+++ /dev/null
@@ -1,325 +0,0 @@
-//go:build go1.9
-// +build go1.9
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder
-
-package storage
-
-import original "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage"
-
-const (
- DefaultBaseURI = original.DefaultBaseURI
-)
-
-type AccessTier = original.AccessTier
-
-const (
- Cool AccessTier = original.Cool
- Hot AccessTier = original.Hot
-)
-
-type AccountStatus = original.AccountStatus
-
-const (
- Available AccountStatus = original.Available
- Unavailable AccountStatus = original.Unavailable
-)
-
-type Action = original.Action
-
-const (
- Allow Action = original.Allow
-)
-
-type Bypass = original.Bypass
-
-const (
- AzureServices Bypass = original.AzureServices
- Logging Bypass = original.Logging
- Metrics Bypass = original.Metrics
- None Bypass = original.None
-)
-
-type DefaultAction = original.DefaultAction
-
-const (
- DefaultActionAllow DefaultAction = original.DefaultActionAllow
- DefaultActionDeny DefaultAction = original.DefaultActionDeny
-)
-
-type HTTPProtocol = original.HTTPProtocol
-
-const (
- HTTPS HTTPProtocol = original.HTTPS
- Httpshttp HTTPProtocol = original.Httpshttp
-)
-
-type KeyPermission = original.KeyPermission
-
-const (
- Full KeyPermission = original.Full
- Read KeyPermission = original.Read
-)
-
-type KeySource = original.KeySource
-
-const (
- MicrosoftKeyvault KeySource = original.MicrosoftKeyvault
- MicrosoftStorage KeySource = original.MicrosoftStorage
-)
-
-type Kind = original.Kind
-
-const (
- BlobStorage Kind = original.BlobStorage
- Storage Kind = original.Storage
- StorageV2 Kind = original.StorageV2
-)
-
-type Permissions = original.Permissions
-
-const (
- A Permissions = original.A
- C Permissions = original.C
- D Permissions = original.D
- L Permissions = original.L
- P Permissions = original.P
- R Permissions = original.R
- U Permissions = original.U
- W Permissions = original.W
-)
-
-type ProvisioningState = original.ProvisioningState
-
-const (
- Creating ProvisioningState = original.Creating
- ResolvingDNS ProvisioningState = original.ResolvingDNS
- Succeeded ProvisioningState = original.Succeeded
-)
-
-type Reason = original.Reason
-
-const (
- AccountNameInvalid Reason = original.AccountNameInvalid
- AlreadyExists Reason = original.AlreadyExists
-)
-
-type ReasonCode = original.ReasonCode
-
-const (
- NotAvailableForSubscription ReasonCode = original.NotAvailableForSubscription
- QuotaID ReasonCode = original.QuotaID
-)
-
-type Services = original.Services
-
-const (
- B Services = original.B
- F Services = original.F
- Q Services = original.Q
- T Services = original.T
-)
-
-type SignedResource = original.SignedResource
-
-const (
- SignedResourceB SignedResource = original.SignedResourceB
- SignedResourceC SignedResource = original.SignedResourceC
- SignedResourceF SignedResource = original.SignedResourceF
- SignedResourceS SignedResource = original.SignedResourceS
-)
-
-type SignedResourceTypes = original.SignedResourceTypes
-
-const (
- SignedResourceTypesC SignedResourceTypes = original.SignedResourceTypesC
- SignedResourceTypesO SignedResourceTypes = original.SignedResourceTypesO
- SignedResourceTypesS SignedResourceTypes = original.SignedResourceTypesS
-)
-
-type SkuName = original.SkuName
-
-const (
- PremiumLRS SkuName = original.PremiumLRS
- StandardGRS SkuName = original.StandardGRS
- StandardLRS SkuName = original.StandardLRS
- StandardRAGRS SkuName = original.StandardRAGRS
- StandardZRS SkuName = original.StandardZRS
-)
-
-type SkuTier = original.SkuTier
-
-const (
- Premium SkuTier = original.Premium
- Standard SkuTier = original.Standard
-)
-
-type State = original.State
-
-const (
- StateDeprovisioning State = original.StateDeprovisioning
- StateFailed State = original.StateFailed
- StateNetworkSourceDeleted State = original.StateNetworkSourceDeleted
- StateProvisioning State = original.StateProvisioning
- StateSucceeded State = original.StateSucceeded
-)
-
-type UsageUnit = original.UsageUnit
-
-const (
- Bytes UsageUnit = original.Bytes
- BytesPerSecond UsageUnit = original.BytesPerSecond
- Count UsageUnit = original.Count
- CountsPerSecond UsageUnit = original.CountsPerSecond
- Percent UsageUnit = original.Percent
- Seconds UsageUnit = original.Seconds
-)
-
-type Account = original.Account
-type AccountCheckNameAvailabilityParameters = original.AccountCheckNameAvailabilityParameters
-type AccountCreateParameters = original.AccountCreateParameters
-type AccountKey = original.AccountKey
-type AccountListKeysResult = original.AccountListKeysResult
-type AccountListResult = original.AccountListResult
-type AccountProperties = original.AccountProperties
-type AccountPropertiesCreateParameters = original.AccountPropertiesCreateParameters
-type AccountPropertiesUpdateParameters = original.AccountPropertiesUpdateParameters
-type AccountRegenerateKeyParameters = original.AccountRegenerateKeyParameters
-type AccountSasParameters = original.AccountSasParameters
-type AccountUpdateParameters = original.AccountUpdateParameters
-type AccountsClient = original.AccountsClient
-type AccountsCreateFuture = original.AccountsCreateFuture
-type BaseClient = original.BaseClient
-type CheckNameAvailabilityResult = original.CheckNameAvailabilityResult
-type CustomDomain = original.CustomDomain
-type Dimension = original.Dimension
-type Encryption = original.Encryption
-type EncryptionService = original.EncryptionService
-type EncryptionServices = original.EncryptionServices
-type Endpoints = original.Endpoints
-type IPRule = original.IPRule
-type Identity = original.Identity
-type KeyVaultProperties = original.KeyVaultProperties
-type ListAccountSasResponse = original.ListAccountSasResponse
-type ListServiceSasResponse = original.ListServiceSasResponse
-type MetricSpecification = original.MetricSpecification
-type NetworkRuleSet = original.NetworkRuleSet
-type Operation = original.Operation
-type OperationDisplay = original.OperationDisplay
-type OperationListResult = original.OperationListResult
-type OperationProperties = original.OperationProperties
-type OperationsClient = original.OperationsClient
-type Resource = original.Resource
-type Restriction = original.Restriction
-type SKUCapability = original.SKUCapability
-type ServiceSasParameters = original.ServiceSasParameters
-type ServiceSpecification = original.ServiceSpecification
-type Sku = original.Sku
-type SkuListResult = original.SkuListResult
-type SkusClient = original.SkusClient
-type Usage = original.Usage
-type UsageClient = original.UsageClient
-type UsageListResult = original.UsageListResult
-type UsageName = original.UsageName
-type VirtualNetworkRule = original.VirtualNetworkRule
-
-func New(subscriptionID string) BaseClient {
- return original.New(subscriptionID)
-}
-func NewAccountsClient(subscriptionID string) AccountsClient {
- return original.NewAccountsClient(subscriptionID)
-}
-func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient {
- return original.NewAccountsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewOperationsClient(subscriptionID string) OperationsClient {
- return original.NewOperationsClient(subscriptionID)
-}
-func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
- return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewSkusClient(subscriptionID string) SkusClient {
- return original.NewSkusClient(subscriptionID)
-}
-func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient {
- return original.NewSkusClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewUsageClient(subscriptionID string) UsageClient {
- return original.NewUsageClient(subscriptionID)
-}
-func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient {
- return original.NewUsageClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return original.NewWithBaseURI(baseURI, subscriptionID)
-}
-func PossibleAccessTierValues() []AccessTier {
- return original.PossibleAccessTierValues()
-}
-func PossibleAccountStatusValues() []AccountStatus {
- return original.PossibleAccountStatusValues()
-}
-func PossibleActionValues() []Action {
- return original.PossibleActionValues()
-}
-func PossibleBypassValues() []Bypass {
- return original.PossibleBypassValues()
-}
-func PossibleDefaultActionValues() []DefaultAction {
- return original.PossibleDefaultActionValues()
-}
-func PossibleHTTPProtocolValues() []HTTPProtocol {
- return original.PossibleHTTPProtocolValues()
-}
-func PossibleKeyPermissionValues() []KeyPermission {
- return original.PossibleKeyPermissionValues()
-}
-func PossibleKeySourceValues() []KeySource {
- return original.PossibleKeySourceValues()
-}
-func PossibleKindValues() []Kind {
- return original.PossibleKindValues()
-}
-func PossiblePermissionsValues() []Permissions {
- return original.PossiblePermissionsValues()
-}
-func PossibleProvisioningStateValues() []ProvisioningState {
- return original.PossibleProvisioningStateValues()
-}
-func PossibleReasonCodeValues() []ReasonCode {
- return original.PossibleReasonCodeValues()
-}
-func PossibleReasonValues() []Reason {
- return original.PossibleReasonValues()
-}
-func PossibleServicesValues() []Services {
- return original.PossibleServicesValues()
-}
-func PossibleSignedResourceTypesValues() []SignedResourceTypes {
- return original.PossibleSignedResourceTypesValues()
-}
-func PossibleSignedResourceValues() []SignedResource {
- return original.PossibleSignedResourceValues()
-}
-func PossibleSkuNameValues() []SkuName {
- return original.PossibleSkuNameValues()
-}
-func PossibleSkuTierValues() []SkuTier {
- return original.PossibleSkuTierValues()
-}
-func PossibleStateValues() []State {
- return original.PossibleStateValues()
-}
-func PossibleUsageUnitValues() []UsageUnit {
- return original.PossibleUsageUnitValues()
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/2019-03-01"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/client.go
new file mode 100644
index 000000000..c373cc43f
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/client.go
@@ -0,0 +1,72 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package arm
+
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy"
+ armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
+)
+
+// ClientOptions contains configuration settings for a client's pipeline.
+type ClientOptions = armpolicy.ClientOptions
+
+// Client is a HTTP client for use with ARM endpoints. It consists of an endpoint, pipeline, and tracing provider.
+type Client struct {
+ ep string
+ pl runtime.Pipeline
+ tr tracing.Tracer
+}
+
+// NewClient creates a new Client instance with the provided values.
+// This client is intended to be used with Azure Resource Manager endpoints.
+// - moduleName - the fully qualified name of the module where the client is defined; used by the telemetry policy and tracing provider.
+// - moduleVersion - the semantic version of the module; used by the telemetry policy and tracing provider.
+// - cred - the TokenCredential used to authenticate the request
+// - options - optional client configurations; pass nil to accept the default values
+func NewClient(moduleName, moduleVersion string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error) {
+ if options == nil {
+ options = &ClientOptions{}
+ }
+
+ if !options.Telemetry.Disabled {
+ if err := shared.ValidateModVer(moduleVersion); err != nil {
+ return nil, err
+ }
+ }
+
+ ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint
+ if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok {
+ ep = c.Endpoint
+ }
+ pl, err := armruntime.NewPipeline(moduleName, moduleVersion, cred, runtime.PipelineOptions{}, options)
+ if err != nil {
+ return nil, err
+ }
+
+ tr := options.TracingProvider.NewTracer(moduleName, moduleVersion)
+ return &Client{ep: ep, pl: pl, tr: tr}, nil
+}
+
+// Endpoint returns the service's base URL for this client.
+func (c *Client) Endpoint() string {
+ return c.ep
+}
+
+// Pipeline returns the pipeline for this client.
+func (c *Client) Pipeline() runtime.Pipeline {
+ return c.pl
+}
+
+// Tracer returns the tracer for this client.
+func (c *Client) Tracer() tracing.Tracer {
+ return c.tr
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/doc.go
new file mode 100644
index 000000000..1bdd16a3d
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/doc.go
@@ -0,0 +1,9 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright 2017 Microsoft Corporation. All rights reserved.
+// Use of this source code is governed by an MIT
+// license that can be found in the LICENSE file.
+
+// Package arm contains functionality specific to Azure Resource Manager clients.
+package arm
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go
new file mode 100644
index 000000000..187fe82b9
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go
@@ -0,0 +1,224 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package resource
+
+import (
+ "fmt"
+ "strings"
+)
+
+const (
+ providersKey = "providers"
+ subscriptionsKey = "subscriptions"
+ resourceGroupsLowerKey = "resourcegroups"
+ locationsKey = "locations"
+ builtInResourceNamespace = "Microsoft.Resources"
+)
+
+// RootResourceID defines the tenant as the root parent of all other ResourceID.
+var RootResourceID = &ResourceID{
+ Parent: nil,
+ ResourceType: TenantResourceType,
+ Name: "",
+}
+
+// ResourceID represents a resource ID such as `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg`.
+// Don't create this type directly, use ParseResourceID instead.
+type ResourceID struct {
+ // Parent is the parent ResourceID of this instance.
+ // Can be nil if there is no parent.
+ Parent *ResourceID
+
+ // SubscriptionID is the subscription ID in this resource ID.
+ // The value can be empty if the resource ID does not contain a subscription ID.
+ SubscriptionID string
+
+ // ResourceGroupName is the resource group name in this resource ID.
+ // The value can be empty if the resource ID does not contain a resource group name.
+ ResourceGroupName string
+
+ // Provider represents the provider name in this resource ID.
+ // This is only valid when the resource ID represents a resource provider.
+ // Example: `/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Insights`
+ Provider string
+
+ // Location is the location in this resource ID.
+ // The value can be empty if the resource ID does not contain a location name.
+ Location string
+
+ // ResourceType represents the type of this resource ID.
+ ResourceType ResourceType
+
+ // Name is the resource name of this resource ID.
+ Name string
+
+ isChild bool
+ stringValue string
+}
+
+// ParseResourceID parses a string to an instance of ResourceID
+func ParseResourceID(id string) (*ResourceID, error) {
+ if len(id) == 0 {
+ return nil, fmt.Errorf("invalid resource ID: id cannot be empty")
+ }
+
+ if !strings.HasPrefix(id, "/") {
+ return nil, fmt.Errorf("invalid resource ID: resource id '%s' must start with '/'", id)
+ }
+
+ parts := splitStringAndOmitEmpty(id, "/")
+
+ if len(parts) < 2 {
+ return nil, fmt.Errorf("invalid resource ID: %s", id)
+ }
+
+ if !strings.EqualFold(parts[0], subscriptionsKey) && !strings.EqualFold(parts[0], providersKey) {
+ return nil, fmt.Errorf("invalid resource ID: %s", id)
+ }
+
+ return appendNext(RootResourceID, parts, id)
+}
+
+// String returns the string of the ResourceID
+func (id *ResourceID) String() string {
+ if len(id.stringValue) > 0 {
+ return id.stringValue
+ }
+
+ if id.Parent == nil {
+ return ""
+ }
+
+ builder := strings.Builder{}
+ builder.WriteString(id.Parent.String())
+
+ if id.isChild {
+ builder.WriteString(fmt.Sprintf("/%s", id.ResourceType.lastType()))
+ if len(id.Name) > 0 {
+ builder.WriteString(fmt.Sprintf("/%s", id.Name))
+ }
+ } else {
+ builder.WriteString(fmt.Sprintf("/providers/%s/%s/%s", id.ResourceType.Namespace, id.ResourceType.Type, id.Name))
+ }
+
+ id.stringValue = builder.String()
+
+ return id.stringValue
+}
+
+func newResourceID(parent *ResourceID, resourceTypeName string, resourceName string) *ResourceID {
+ id := &ResourceID{}
+ id.init(parent, chooseResourceType(resourceTypeName, parent), resourceName, true)
+ return id
+}
+
+func newResourceIDWithResourceType(parent *ResourceID, resourceType ResourceType, resourceName string) *ResourceID {
+ id := &ResourceID{}
+ id.init(parent, resourceType, resourceName, true)
+ return id
+}
+
+func newResourceIDWithProvider(parent *ResourceID, providerNamespace, resourceTypeName, resourceName string) *ResourceID {
+ id := &ResourceID{}
+ id.init(parent, NewResourceType(providerNamespace, resourceTypeName), resourceName, false)
+ return id
+}
+
+func chooseResourceType(resourceTypeName string, parent *ResourceID) ResourceType {
+ if strings.EqualFold(resourceTypeName, resourceGroupsLowerKey) {
+ return ResourceGroupResourceType
+ } else if strings.EqualFold(resourceTypeName, subscriptionsKey) && parent != nil && parent.ResourceType.String() == TenantResourceType.String() {
+ return SubscriptionResourceType
+ }
+
+ return parent.ResourceType.AppendChild(resourceTypeName)
+}
+
+func (id *ResourceID) init(parent *ResourceID, resourceType ResourceType, name string, isChild bool) {
+ if parent != nil {
+ id.Provider = parent.Provider
+ id.SubscriptionID = parent.SubscriptionID
+ id.ResourceGroupName = parent.ResourceGroupName
+ id.Location = parent.Location
+ }
+
+ if resourceType.String() == SubscriptionResourceType.String() {
+ id.SubscriptionID = name
+ }
+
+ if resourceType.lastType() == locationsKey {
+ id.Location = name
+ }
+
+ if resourceType.String() == ResourceGroupResourceType.String() {
+ id.ResourceGroupName = name
+ }
+
+ if resourceType.String() == ProviderResourceType.String() {
+ id.Provider = name
+ }
+
+ if parent == nil {
+ id.Parent = RootResourceID
+ } else {
+ id.Parent = parent
+ }
+ id.isChild = isChild
+ id.ResourceType = resourceType
+ id.Name = name
+}
+
+func appendNext(parent *ResourceID, parts []string, id string) (*ResourceID, error) {
+ if len(parts) == 0 {
+ return parent, nil
+ }
+
+ if len(parts) == 1 {
+ // subscriptions and resourceGroups are not valid ids without their names
+ if strings.EqualFold(parts[0], subscriptionsKey) || strings.EqualFold(parts[0], resourceGroupsLowerKey) {
+ return nil, fmt.Errorf("invalid resource ID: %s", id)
+ }
+
+ // resourceGroup must contain either child or provider resource type
+ if parent.ResourceType.String() == ResourceGroupResourceType.String() {
+ return nil, fmt.Errorf("invalid resource ID: %s", id)
+ }
+
+ return newResourceID(parent, parts[0], ""), nil
+ }
+
+ if strings.EqualFold(parts[0], providersKey) && (len(parts) == 2 || strings.EqualFold(parts[2], providersKey)) {
+ //provider resource can only be on a tenant or a subscription parent
+ if parent.ResourceType.String() != SubscriptionResourceType.String() && parent.ResourceType.String() != TenantResourceType.String() {
+ return nil, fmt.Errorf("invalid resource ID: %s", id)
+ }
+
+ return appendNext(newResourceIDWithResourceType(parent, ProviderResourceType, parts[1]), parts[2:], id)
+ }
+
+ if len(parts) > 3 && strings.EqualFold(parts[0], providersKey) {
+ return appendNext(newResourceIDWithProvider(parent, parts[1], parts[2], parts[3]), parts[4:], id)
+ }
+
+ if len(parts) > 1 && !strings.EqualFold(parts[0], providersKey) {
+ return appendNext(newResourceID(parent, parts[0], parts[1]), parts[2:], id)
+ }
+
+ return nil, fmt.Errorf("invalid resource ID: %s", id)
+}
+
+func splitStringAndOmitEmpty(v, sep string) []string {
+ r := make([]string, 0)
+ for _, s := range strings.Split(v, sep) {
+ if len(s) == 0 {
+ continue
+ }
+ r = append(r, s)
+ }
+
+ return r
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go
new file mode 100644
index 000000000..ca03ac971
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go
@@ -0,0 +1,114 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package resource
+
+import (
+ "fmt"
+ "strings"
+)
+
+// SubscriptionResourceType is the ResourceType of a subscription
+var SubscriptionResourceType = NewResourceType(builtInResourceNamespace, "subscriptions")
+
+// ResourceGroupResourceType is the ResourceType of a resource group
+var ResourceGroupResourceType = NewResourceType(builtInResourceNamespace, "resourceGroups")
+
+// TenantResourceType is the ResourceType of a tenant
+var TenantResourceType = NewResourceType(builtInResourceNamespace, "tenants")
+
+// ProviderResourceType is the ResourceType of a provider
+var ProviderResourceType = NewResourceType(builtInResourceNamespace, "providers")
+
+// ResourceType represents an Azure resource type, e.g. "Microsoft.Network/virtualNetworks/subnets".
+// Don't create this type directly, use ParseResourceType or NewResourceType instead.
+type ResourceType struct {
+ // Namespace is the namespace of the resource type.
+ // e.g. "Microsoft.Network" in resource type "Microsoft.Network/virtualNetworks/subnets"
+ Namespace string
+
+ // Type is the full type name of the resource type.
+ // e.g. "virtualNetworks/subnets" in resource type "Microsoft.Network/virtualNetworks/subnets"
+ Type string
+
+ // Types is the slice of all the sub-types of this resource type.
+ // e.g. ["virtualNetworks", "subnets"] in resource type "Microsoft.Network/virtualNetworks/subnets"
+ Types []string
+
+ stringValue string
+}
+
+// String returns the string of the ResourceType
+func (t ResourceType) String() string {
+ return t.stringValue
+}
+
+// IsParentOf returns true when the receiver is the parent resource type of the child.
+func (t ResourceType) IsParentOf(child ResourceType) bool {
+ if !strings.EqualFold(t.Namespace, child.Namespace) {
+ return false
+ }
+ if len(t.Types) >= len(child.Types) {
+ return false
+ }
+ for i := range t.Types {
+ if !strings.EqualFold(t.Types[i], child.Types[i]) {
+ return false
+ }
+ }
+
+ return true
+}
+
+// AppendChild creates an instance of ResourceType using the receiver as the parent with childType appended to it.
+func (t ResourceType) AppendChild(childType string) ResourceType {
+ return NewResourceType(t.Namespace, fmt.Sprintf("%s/%s", t.Type, childType))
+}
+
+// NewResourceType creates an instance of ResourceType using a provider namespace
+// such as "Microsoft.Network" and type such as "virtualNetworks/subnets".
+func NewResourceType(providerNamespace, typeName string) ResourceType {
+ return ResourceType{
+ Namespace: providerNamespace,
+ Type: typeName,
+ Types: splitStringAndOmitEmpty(typeName, "/"),
+ stringValue: fmt.Sprintf("%s/%s", providerNamespace, typeName),
+ }
+}
+
+// ParseResourceType parses the ResourceType from a resource type string (e.g. Microsoft.Network/virtualNetworks/subsets)
+// or a resource identifier string.
+// e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/mySubnet)
+func ParseResourceType(resourceIDOrType string) (ResourceType, error) {
+ // split the path into segments
+ parts := splitStringAndOmitEmpty(resourceIDOrType, "/")
+
+ // There must be at least a namespace and type name
+ if len(parts) < 1 {
+ return ResourceType{}, fmt.Errorf("invalid resource ID or type: %s", resourceIDOrType)
+ }
+
+ // if the type is just subscriptions, it is a built-in type in the Microsoft.Resources namespace
+ if len(parts) == 1 {
+ // Simple resource type
+ return NewResourceType(builtInResourceNamespace, parts[0]), nil
+ } else if strings.Contains(parts[0], ".") {
+ // Handle resource types (Microsoft.Compute/virtualMachines, Microsoft.Network/virtualNetworks/subnets)
+ // it is a full type name
+ return NewResourceType(parts[0], strings.Join(parts[1:], "/")), nil
+ } else {
+ // Check if ResourceID
+ id, err := ParseResourceID(resourceIDOrType)
+ if err != nil {
+ return ResourceType{}, err
+ }
+ return NewResourceType(id.ResourceType.Namespace, id.ResourceType.Type), nil
+ }
+}
+
+func (t ResourceType) lastType() string {
+ return t.Types[len(t.Types)-1]
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go
new file mode 100644
index 000000000..83cf91e3e
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go
@@ -0,0 +1,98 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package policy
+
+import (
+ "time"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+)
+
+// BearerTokenOptions configures the bearer token policy's behavior.
+type BearerTokenOptions struct {
+ // AuxiliaryTenants are additional tenant IDs for authenticating cross-tenant requests.
+ // The policy will add a token from each of these tenants to every request. The
+ // authenticating user or service principal must be a guest in these tenants, and the
+ // policy's credential must support multitenant authentication.
+ AuxiliaryTenants []string
+
+ // Scopes contains the list of permission scopes required for the token.
+ Scopes []string
+}
+
+// RegistrationOptions configures the registration policy's behavior.
+// All zero-value fields will be initialized with their default values.
+type RegistrationOptions struct {
+ policy.ClientOptions
+
+ // MaxAttempts is the total number of times to attempt automatic registration
+ // in the event that an attempt fails.
+ // The default value is 3.
+ // Set to a value less than zero to disable the policy.
+ MaxAttempts int
+
+ // PollingDelay is the amount of time to sleep between polling intervals.
+ // The default value is 15 seconds.
+ // A value less than zero means no delay between polling intervals (not recommended).
+ PollingDelay time.Duration
+
+ // PollingDuration is the amount of time to wait before abandoning polling.
+ // The default valule is 5 minutes.
+ // NOTE: Setting this to a small value might cause the policy to prematurely fail.
+ PollingDuration time.Duration
+}
+
+// ClientOptions contains configuration settings for a client's pipeline.
+type ClientOptions struct {
+ policy.ClientOptions
+
+ // AuxiliaryTenants are additional tenant IDs for authenticating cross-tenant requests.
+ // The client will add a token from each of these tenants to every request. The
+ // authenticating user or service principal must be a guest in these tenants, and the
+ // client's credential must support multitenant authentication.
+ AuxiliaryTenants []string
+
+ // DisableRPRegistration disables the auto-RP registration policy. Defaults to false.
+ DisableRPRegistration bool
+}
+
+// Clone return a deep copy of the current options.
+func (o *ClientOptions) Clone() *ClientOptions {
+ if o == nil {
+ return nil
+ }
+ copiedOptions := *o
+ copiedOptions.Cloud.Services = copyMap(copiedOptions.Cloud.Services)
+ copiedOptions.Logging.AllowedHeaders = copyArray(copiedOptions.Logging.AllowedHeaders)
+ copiedOptions.Logging.AllowedQueryParams = copyArray(copiedOptions.Logging.AllowedQueryParams)
+ copiedOptions.Retry.StatusCodes = copyArray(copiedOptions.Retry.StatusCodes)
+ copiedOptions.PerRetryPolicies = copyArray(copiedOptions.PerRetryPolicies)
+ copiedOptions.PerCallPolicies = copyArray(copiedOptions.PerCallPolicies)
+ return &copiedOptions
+}
+
+// copyMap return a new map with all the key value pair in the src map
+func copyMap[K comparable, V any](src map[K]V) map[K]V {
+ if src == nil {
+ return nil
+ }
+ copiedMap := make(map[K]V)
+ for k, v := range src {
+ copiedMap[k] = v
+ }
+ return copiedMap
+}
+
+// copyMap return a new array with all the elements in the src array
+func copyArray[T any](src []T) []T {
+ if src == nil {
+ return nil
+ }
+ copiedArray := make([]T, len(src))
+ copy(copiedArray, src)
+ return copiedArray
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go
new file mode 100644
index 000000000..d35d6374f
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go
@@ -0,0 +1,23 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package arm
+
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource"
+)
+
+// RootResourceID defines the tenant as the root parent of all other ResourceID.
+var RootResourceID = resource.RootResourceID
+
+// ResourceID represents a resource ID such as `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg`.
+// Don't create this type directly, use ParseResourceID instead.
+type ResourceID = resource.ResourceID
+
+// ParseResourceID parses a string to an instance of ResourceID
+func ParseResourceID(id string) (*ResourceID, error) {
+ return resource.ParseResourceID(id)
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go
new file mode 100644
index 000000000..fc7fbffd2
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go
@@ -0,0 +1,40 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package arm
+
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource"
+)
+
+// SubscriptionResourceType is the ResourceType of a subscription
+var SubscriptionResourceType = resource.SubscriptionResourceType
+
+// ResourceGroupResourceType is the ResourceType of a resource group
+var ResourceGroupResourceType = resource.ResourceGroupResourceType
+
+// TenantResourceType is the ResourceType of a tenant
+var TenantResourceType = resource.TenantResourceType
+
+// ProviderResourceType is the ResourceType of a provider
+var ProviderResourceType = resource.ProviderResourceType
+
+// ResourceType represents an Azure resource type, e.g. "Microsoft.Network/virtualNetworks/subnets".
+// Don't create this type directly, use ParseResourceType or NewResourceType instead.
+type ResourceType = resource.ResourceType
+
+// NewResourceType creates an instance of ResourceType using a provider namespace
+// such as "Microsoft.Network" and type such as "virtualNetworks/subnets".
+func NewResourceType(providerNamespace, typeName string) ResourceType {
+ return resource.NewResourceType(providerNamespace, typeName)
+}
+
+// ParseResourceType parses the ResourceType from a resource type string (e.g. Microsoft.Network/virtualNetworks/subsets)
+// or a resource identifier string.
+// e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/mySubnet)
+func ParseResourceType(resourceIDOrType string) (ResourceType, error) {
+ return resource.ParseResourceType(resourceIDOrType)
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go
new file mode 100644
index 000000000..302c19cd4
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go
@@ -0,0 +1,65 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package runtime
+
+import (
+ "errors"
+ "reflect"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
+ azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+)
+
+// NewPipeline creates a pipeline from connection options. Policies from ClientOptions are
+// placed after policies from PipelineOptions. The telemetry policy, when enabled, will
+// use the specified module and version info.
+func NewPipeline(module, version string, cred azcore.TokenCredential, plOpts azruntime.PipelineOptions, options *armpolicy.ClientOptions) (azruntime.Pipeline, error) {
+ if options == nil {
+ options = &armpolicy.ClientOptions{}
+ }
+ conf, err := getConfiguration(&options.ClientOptions)
+ if err != nil {
+ return azruntime.Pipeline{}, err
+ }
+ authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{
+ AuxiliaryTenants: options.AuxiliaryTenants,
+ Scopes: []string{conf.Audience + "/.default"},
+ })
+ perRetry := make([]azpolicy.Policy, len(plOpts.PerRetry), len(plOpts.PerRetry)+1)
+ copy(perRetry, plOpts.PerRetry)
+ plOpts.PerRetry = append(perRetry, authPolicy, exported.PolicyFunc(httpTraceNamespacePolicy))
+ if !options.DisableRPRegistration {
+ regRPOpts := armpolicy.RegistrationOptions{ClientOptions: options.ClientOptions}
+ regPolicy, err := NewRPRegistrationPolicy(cred, ®RPOpts)
+ if err != nil {
+ return azruntime.Pipeline{}, err
+ }
+ perCall := make([]azpolicy.Policy, len(plOpts.PerCall), len(plOpts.PerCall)+1)
+ copy(perCall, plOpts.PerCall)
+ plOpts.PerCall = append(perCall, regPolicy)
+ }
+ if plOpts.APIVersion.Name == "" {
+ plOpts.APIVersion.Name = "api-version"
+ }
+ return azruntime.NewPipeline(module, version, plOpts, &options.ClientOptions), nil
+}
+
+func getConfiguration(o *azpolicy.ClientOptions) (cloud.ServiceConfiguration, error) {
+ c := cloud.AzurePublic
+ if !reflect.ValueOf(o.Cloud).IsZero() {
+ c = o.Cloud
+ }
+ if conf, ok := c.Services[cloud.ResourceManager]; ok && conf.Endpoint != "" && conf.Audience != "" {
+ return conf, nil
+ } else {
+ return conf, errors.New("provided Cloud field is missing Azure Resource Manager configuration")
+ }
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go
new file mode 100644
index 000000000..54b3bb78d
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go
@@ -0,0 +1,145 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package runtime
+
+import (
+ "context"
+ "encoding/base64"
+ "fmt"
+ "net/http"
+ "strings"
+ "time"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
+ azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/temporal"
+)
+
+const headerAuxiliaryAuthorization = "x-ms-authorization-auxiliary"
+
+// acquiringResourceState holds data for an auxiliary token request
+type acquiringResourceState struct {
+ ctx context.Context
+ p *BearerTokenPolicy
+ tenant string
+}
+
+// acquireAuxToken acquires a token from an auxiliary tenant. Only one thread/goroutine at a time ever calls this function.
+func acquireAuxToken(state acquiringResourceState) (newResource azcore.AccessToken, newExpiration time.Time, err error) {
+ tk, err := state.p.cred.GetToken(state.ctx, azpolicy.TokenRequestOptions{
+ EnableCAE: true,
+ Scopes: state.p.scopes,
+ TenantID: state.tenant,
+ })
+ if err != nil {
+ return azcore.AccessToken{}, time.Time{}, err
+ }
+ return tk, tk.ExpiresOn, nil
+}
+
+// BearerTokenPolicy authorizes requests with bearer tokens acquired from a TokenCredential.
+type BearerTokenPolicy struct {
+ auxResources map[string]*temporal.Resource[azcore.AccessToken, acquiringResourceState]
+ btp *azruntime.BearerTokenPolicy
+ cred azcore.TokenCredential
+ scopes []string
+}
+
+// NewBearerTokenPolicy creates a policy object that authorizes requests with bearer tokens.
+// cred: an azcore.TokenCredential implementation such as a credential object from azidentity
+// opts: optional settings. Pass nil to accept default values; this is the same as passing a zero-value options.
+func NewBearerTokenPolicy(cred azcore.TokenCredential, opts *armpolicy.BearerTokenOptions) *BearerTokenPolicy {
+ if opts == nil {
+ opts = &armpolicy.BearerTokenOptions{}
+ }
+ p := &BearerTokenPolicy{cred: cred}
+ p.auxResources = make(map[string]*temporal.Resource[azcore.AccessToken, acquiringResourceState], len(opts.AuxiliaryTenants))
+ for _, t := range opts.AuxiliaryTenants {
+ p.auxResources[t] = temporal.NewResource(acquireAuxToken)
+ }
+ p.scopes = make([]string, len(opts.Scopes))
+ copy(p.scopes, opts.Scopes)
+ p.btp = azruntime.NewBearerTokenPolicy(cred, opts.Scopes, &azpolicy.BearerTokenOptions{
+ AuthorizationHandler: azpolicy.AuthorizationHandler{
+ OnChallenge: p.onChallenge,
+ OnRequest: p.onRequest,
+ },
+ })
+ return p
+}
+
+func (b *BearerTokenPolicy) onChallenge(req *azpolicy.Request, res *http.Response, authNZ func(azpolicy.TokenRequestOptions) error) error {
+ challenge := res.Header.Get(shared.HeaderWWWAuthenticate)
+ claims, err := parseChallenge(challenge)
+ if err != nil {
+ // the challenge contains claims we can't parse
+ return err
+ } else if claims != "" {
+ // request a new token having the specified claims, send the request again
+ return authNZ(azpolicy.TokenRequestOptions{Claims: claims, EnableCAE: true, Scopes: b.scopes})
+ }
+ // auth challenge didn't include claims, so this is a simple authorization failure
+ return azruntime.NewResponseError(res)
+}
+
+// onRequest authorizes requests with one or more bearer tokens
+func (b *BearerTokenPolicy) onRequest(req *azpolicy.Request, authNZ func(azpolicy.TokenRequestOptions) error) error {
+ // authorize the request with a token for the primary tenant
+ err := authNZ(azpolicy.TokenRequestOptions{EnableCAE: true, Scopes: b.scopes})
+ if err != nil || len(b.auxResources) == 0 {
+ return err
+ }
+ // add tokens for auxiliary tenants
+ as := acquiringResourceState{
+ ctx: req.Raw().Context(),
+ p: b,
+ }
+ auxTokens := make([]string, 0, len(b.auxResources))
+ for tenant, er := range b.auxResources {
+ as.tenant = tenant
+ auxTk, err := er.Get(as)
+ if err != nil {
+ return err
+ }
+ auxTokens = append(auxTokens, fmt.Sprintf("%s%s", shared.BearerTokenPrefix, auxTk.Token))
+ }
+ req.Raw().Header.Set(headerAuxiliaryAuthorization, strings.Join(auxTokens, ", "))
+ return nil
+}
+
+// Do authorizes a request with a bearer token
+func (b *BearerTokenPolicy) Do(req *azpolicy.Request) (*http.Response, error) {
+ return b.btp.Do(req)
+}
+
+// parseChallenge parses claims from an authentication challenge issued by ARM so a client can request a token
+// that will satisfy conditional access policies. It returns a non-nil error when the given value contains
+// claims it can't parse. If the value contains no claims, it returns an empty string and a nil error.
+func parseChallenge(wwwAuthenticate string) (string, error) {
+ claims := ""
+ var err error
+ for _, param := range strings.Split(wwwAuthenticate, ",") {
+ if _, after, found := strings.Cut(param, "claims="); found {
+ if claims != "" {
+ // The header contains multiple challenges, at least two of which specify claims. The specs allow this
+ // but it's unclear what a client should do in this case and there's as yet no concrete example of it.
+ err = fmt.Errorf("found multiple claims challenges in %q", wwwAuthenticate)
+ break
+ }
+ // trim stuff that would get an error from RawURLEncoding; claims may or may not be padded
+ claims = strings.Trim(after, `\"=`)
+ // we don't return this error because it's something unhelpful like "illegal base64 data at input byte 42"
+ if b, decErr := base64.RawURLEncoding.DecodeString(claims); decErr == nil {
+ claims = string(b)
+ } else {
+ err = fmt.Errorf("failed to parse claims from %q", wwwAuthenticate)
+ break
+ }
+ }
+ }
+ return claims, err
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go
new file mode 100644
index 000000000..83e15949a
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go
@@ -0,0 +1,347 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package runtime
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "net/http"
+ "net/url"
+ "strings"
+ "time"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
+ azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
+)
+
+const (
+ // LogRPRegistration entries contain information specific to the automatic registration of an RP.
+ // Entries of this classification are written IFF the policy needs to take any action.
+ LogRPRegistration log.Event = "RPRegistration"
+)
+
+// init sets any default values
+func setDefaults(r *armpolicy.RegistrationOptions) {
+ if r.MaxAttempts == 0 {
+ r.MaxAttempts = 3
+ } else if r.MaxAttempts < 0 {
+ r.MaxAttempts = 0
+ }
+ if r.PollingDelay == 0 {
+ r.PollingDelay = 15 * time.Second
+ } else if r.PollingDelay < 0 {
+ r.PollingDelay = 0
+ }
+ if r.PollingDuration == 0 {
+ r.PollingDuration = 5 * time.Minute
+ }
+}
+
+// NewRPRegistrationPolicy creates a policy object configured using the specified options.
+// The policy controls whether an unregistered resource provider should automatically be
+// registered. See https://aka.ms/rps-not-found for more information.
+func NewRPRegistrationPolicy(cred azcore.TokenCredential, o *armpolicy.RegistrationOptions) (azpolicy.Policy, error) {
+ if o == nil {
+ o = &armpolicy.RegistrationOptions{}
+ }
+ conf, err := getConfiguration(&o.ClientOptions)
+ if err != nil {
+ return nil, err
+ }
+ authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{Scopes: []string{conf.Audience + "/.default"}})
+ p := &rpRegistrationPolicy{
+ endpoint: conf.Endpoint,
+ pipeline: runtime.NewPipeline(shared.Module, shared.Version, runtime.PipelineOptions{PerRetry: []azpolicy.Policy{authPolicy}}, &o.ClientOptions),
+ options: *o,
+ }
+ // init the copy
+ setDefaults(&p.options)
+ return p, nil
+}
+
+type rpRegistrationPolicy struct {
+ endpoint string
+ pipeline runtime.Pipeline
+ options armpolicy.RegistrationOptions
+}
+
+func (r *rpRegistrationPolicy) Do(req *azpolicy.Request) (*http.Response, error) {
+ if r.options.MaxAttempts == 0 {
+ // policy is disabled
+ return req.Next()
+ }
+ const registeredState = "Registered"
+ var rp string
+ var resp *http.Response
+ for attempts := 0; attempts < r.options.MaxAttempts; attempts++ {
+ var err error
+ // make the original request
+ resp, err = req.Next()
+ // getting a 409 is the first indication that the RP might need to be registered, check error response
+ if err != nil || resp.StatusCode != http.StatusConflict {
+ return resp, err
+ }
+ var reqErr requestError
+ if err = runtime.UnmarshalAsJSON(resp, &reqErr); err != nil {
+ return resp, err
+ }
+ if reqErr.ServiceError == nil {
+ // missing service error info. just return the response
+ // to the caller so its error unmarshalling will kick in
+ return resp, err
+ }
+ if !isUnregisteredRPCode(reqErr.ServiceError.Code) {
+ // not a 409 due to unregistered RP. just return the response
+ // to the caller so its error unmarshalling will kick in
+ return resp, err
+ }
+ // RP needs to be registered. start by getting the subscription ID from the original request
+ subID, err := getSubscription(req.Raw().URL.Path)
+ if err != nil {
+ return resp, err
+ }
+ // now get the RP from the error
+ rp, err = getProvider(reqErr)
+ if err != nil {
+ return resp, err
+ }
+ logRegistrationExit := func(v interface{}) {
+ log.Writef(LogRPRegistration, "END registration for %s: %v", rp, v)
+ }
+ log.Writef(LogRPRegistration, "BEGIN registration for %s", rp)
+ // create client and make the registration request
+ // we use the scheme and host from the original request
+ rpOps := &providersOperations{
+ p: r.pipeline,
+ u: r.endpoint,
+ subID: subID,
+ }
+ if _, err = rpOps.Register(&shared.ContextWithDeniedValues{Context: req.Raw().Context()}, rp); err != nil {
+ logRegistrationExit(err)
+ return resp, err
+ }
+
+ // RP was registered, however we need to wait for the registration to complete
+ pollCtx, pollCancel := context.WithTimeout(&shared.ContextWithDeniedValues{Context: req.Raw().Context()}, r.options.PollingDuration)
+ var lastRegState string
+ for {
+ // get the current registration state
+ getResp, err := rpOps.Get(pollCtx, rp)
+ if err != nil {
+ pollCancel()
+ logRegistrationExit(err)
+ return resp, err
+ }
+ if getResp.Provider.RegistrationState != nil && !strings.EqualFold(*getResp.Provider.RegistrationState, lastRegState) {
+ // registration state has changed, or was updated for the first time
+ lastRegState = *getResp.Provider.RegistrationState
+ log.Writef(LogRPRegistration, "registration state is %s", lastRegState)
+ }
+ if strings.EqualFold(lastRegState, registeredState) {
+ // registration complete
+ pollCancel()
+ logRegistrationExit(lastRegState)
+ break
+ }
+ // wait before trying again
+ select {
+ case <-time.After(r.options.PollingDelay):
+ // continue polling
+ case <-pollCtx.Done():
+ pollCancel()
+ logRegistrationExit(pollCtx.Err())
+ return resp, pollCtx.Err()
+ }
+ }
+ // RP was successfully registered, retry the original request
+ err = req.RewindBody()
+ if err != nil {
+ return resp, err
+ }
+ }
+ // if we get here it means we exceeded the number of attempts
+ return resp, fmt.Errorf("exceeded attempts to register %s", rp)
+}
+
+var unregisteredRPCodes = []string{
+ "MissingSubscriptionRegistration",
+ "MissingRegistrationForResourceProvider",
+ "Subscription Not Registered",
+ "SubscriptionNotRegistered",
+}
+
+func isUnregisteredRPCode(errorCode string) bool {
+ for _, code := range unregisteredRPCodes {
+ if strings.EqualFold(errorCode, code) {
+ return true
+ }
+ }
+ return false
+}
+
+func getSubscription(path string) (string, error) {
+ parts := strings.Split(path, "/")
+ for i, v := range parts {
+ if v == "subscriptions" && (i+1) < len(parts) {
+ return parts[i+1], nil
+ }
+ }
+ return "", fmt.Errorf("failed to obtain subscription ID from %s", path)
+}
+
+func getProvider(re requestError) (string, error) {
+ if len(re.ServiceError.Details) > 0 {
+ return re.ServiceError.Details[0].Target, nil
+ }
+ return "", errors.New("unexpected empty Details")
+}
+
+// minimal error definitions to simplify detection
+type requestError struct {
+ ServiceError *serviceError `json:"error"`
+}
+
+type serviceError struct {
+ Code string `json:"code"`
+ Details []serviceErrorDetails `json:"details"`
+}
+
+type serviceErrorDetails struct {
+ Code string `json:"code"`
+ Target string `json:"target"`
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////
+// the following code was copied from module armresources, providers.go and models.go
+// only the minimum amount of code was copied to get this working and some edits were made.
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+type providersOperations struct {
+ p runtime.Pipeline
+ u string
+ subID string
+}
+
+// Get - Gets the specified resource provider.
+func (client *providersOperations) Get(ctx context.Context, resourceProviderNamespace string) (providerResponse, error) {
+ req, err := client.getCreateRequest(ctx, resourceProviderNamespace)
+ if err != nil {
+ return providerResponse{}, err
+ }
+ resp, err := client.p.Do(req)
+ if err != nil {
+ return providerResponse{}, err
+ }
+ result, err := client.getHandleResponse(resp)
+ if err != nil {
+ return providerResponse{}, err
+ }
+ return result, nil
+}
+
+// getCreateRequest creates the Get request.
+func (client *providersOperations) getCreateRequest(ctx context.Context, resourceProviderNamespace string) (*azpolicy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}"
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.u, urlPath))
+ if err != nil {
+ return nil, err
+ }
+ query := req.Raw().URL.Query()
+ query.Set("api-version", "2019-05-01")
+ req.Raw().URL.RawQuery = query.Encode()
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *providersOperations) getHandleResponse(resp *http.Response) (providerResponse, error) {
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return providerResponse{}, exported.NewResponseError(resp)
+ }
+ result := providerResponse{RawResponse: resp}
+ err := runtime.UnmarshalAsJSON(resp, &result.Provider)
+ if err != nil {
+ return providerResponse{}, err
+ }
+ return result, err
+}
+
+// Register - Registers a subscription with a resource provider.
+func (client *providersOperations) Register(ctx context.Context, resourceProviderNamespace string) (providerResponse, error) {
+ req, err := client.registerCreateRequest(ctx, resourceProviderNamespace)
+ if err != nil {
+ return providerResponse{}, err
+ }
+ resp, err := client.p.Do(req)
+ if err != nil {
+ return providerResponse{}, err
+ }
+ result, err := client.registerHandleResponse(resp)
+ if err != nil {
+ return providerResponse{}, err
+ }
+ return result, nil
+}
+
+// registerCreateRequest creates the Register request.
+func (client *providersOperations) registerCreateRequest(ctx context.Context, resourceProviderNamespace string) (*azpolicy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register"
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.u, urlPath))
+ if err != nil {
+ return nil, err
+ }
+ query := req.Raw().URL.Query()
+ query.Set("api-version", "2019-05-01")
+ req.Raw().URL.RawQuery = query.Encode()
+ return req, nil
+}
+
+// registerHandleResponse handles the Register response.
+func (client *providersOperations) registerHandleResponse(resp *http.Response) (providerResponse, error) {
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return providerResponse{}, exported.NewResponseError(resp)
+ }
+ result := providerResponse{RawResponse: resp}
+ err := runtime.UnmarshalAsJSON(resp, &result.Provider)
+ if err != nil {
+ return providerResponse{}, err
+ }
+ return result, err
+}
+
+// ProviderResponse is the response envelope for operations that return a Provider type.
+type providerResponse struct {
+ // Resource provider information.
+ Provider *provider
+
+ // RawResponse contains the underlying HTTP response.
+ RawResponse *http.Response
+}
+
+// Provider - Resource provider information.
+type provider struct {
+ // The provider ID.
+ ID *string `json:"id,omitempty"`
+
+ // The namespace of the resource provider.
+ Namespace *string `json:"namespace,omitempty"`
+
+ // The registration policy of the resource provider.
+ RegistrationPolicy *string `json:"registrationPolicy,omitempty"`
+
+ // The registration state of the resource provider.
+ RegistrationState *string `json:"registrationState,omitempty"`
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.go
new file mode 100644
index 000000000..6cea18424
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.go
@@ -0,0 +1,30 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package runtime
+
+import (
+ "net/http"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
+)
+
+// httpTraceNamespacePolicy is a policy that adds the az.namespace attribute to the current Span
+func httpTraceNamespacePolicy(req *policy.Request) (resp *http.Response, err error) {
+ rawTracer := req.Raw().Context().Value(shared.CtxWithTracingTracer{})
+ if tracer, ok := rawTracer.(tracing.Tracer); ok && tracer.Enabled() {
+ rt, err := resource.ParseResourceType(req.Raw().URL.Path)
+ if err == nil {
+ // add the namespace attribute to the current span
+ span := tracer.SpanFromContext(req.Raw().Context())
+ span.SetAttributes(tracing.Attribute{Key: shared.TracingNamespaceAttrName, Value: rt.Namespace})
+ }
+ }
+ return req.Next()
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go
new file mode 100644
index 000000000..1400d4379
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go
@@ -0,0 +1,24 @@
+//go:build go1.16
+// +build go1.16
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package runtime
+
+import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
+
+func init() {
+ cloud.AzureChina.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
+ Audience: "https://management.core.chinacloudapi.cn",
+ Endpoint: "https://management.chinacloudapi.cn",
+ }
+ cloud.AzureGovernment.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
+ Audience: "https://management.core.usgovcloudapi.net",
+ Endpoint: "https://management.usgovcloudapi.net",
+ }
+ cloud.AzurePublic.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
+ Audience: "https://management.core.windows.net/",
+ Endpoint: "https://management.azure.com",
+ }
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md
new file mode 100644
index 000000000..7ea119ab3
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md
@@ -0,0 +1,457 @@
+# Release History
+
+## 1.4.0 (2023-10-10)
+
+### Bugs Fixed
+* `ManagedIdentityCredential` will now retry when IMDS responds 410 or 503
+
+## 1.4.0-beta.5 (2023-09-12)
+
+### Features Added
+* Service principal credentials can request CAE tokens
+
+### Breaking Changes
+> These changes affect only code written against a beta version such as v1.4.0-beta.4
+* Whether `GetToken` requests a CAE token is now determined by `TokenRequestOptions.EnableCAE`. Azure
+ SDK clients which support CAE will set this option automatically. Credentials no longer request CAE
+ tokens by default or observe the environment variable "AZURE_IDENTITY_DISABLE_CP1".
+
+### Bugs Fixed
+* Credential chains such as `DefaultAzureCredential` now try their next credential, if any, when
+ managed identity authentication fails in a Docker Desktop container
+ ([#21417](https://github.com/Azure/azure-sdk-for-go/issues/21417))
+
+## 1.4.0-beta.4 (2023-08-16)
+
+### Other Changes
+* Upgraded dependencies
+
+## 1.3.1 (2023-08-16)
+
+### Other Changes
+* Upgraded dependencies
+
+## 1.4.0-beta.3 (2023-08-08)
+
+### Bugs Fixed
+* One invocation of `AzureCLICredential.GetToken()` and `OnBehalfOfCredential.GetToken()`
+ can no longer make two authentication attempts
+
+## 1.4.0-beta.2 (2023-07-14)
+
+### Other Changes
+* `DefaultAzureCredentialOptions.TenantID` applies to workload identity authentication
+* Upgraded dependencies
+
+## 1.4.0-beta.1 (2023-06-06)
+
+### Other Changes
+* Re-enabled CAE support as in v1.3.0-beta.3
+
+## 1.3.0 (2023-05-09)
+
+### Breaking Changes
+> These changes affect only code written against a beta version such as v1.3.0-beta.5
+* Renamed `NewOnBehalfOfCredentialFromCertificate` to `NewOnBehalfOfCredentialWithCertificate`
+* Renamed `NewOnBehalfOfCredentialFromSecret` to `NewOnBehalfOfCredentialWithSecret`
+
+### Other Changes
+* Upgraded to MSAL v1.0.0
+
+## 1.3.0-beta.5 (2023-04-11)
+
+### Breaking Changes
+> These changes affect only code written against a beta version such as v1.3.0-beta.4
+* Moved `NewWorkloadIdentityCredential()` parameters into `WorkloadIdentityCredentialOptions`.
+ The constructor now reads default configuration from environment variables set by the Azure
+ workload identity webhook by default.
+ ([#20478](https://github.com/Azure/azure-sdk-for-go/pull/20478))
+* Removed CAE support. It will return in v1.4.0-beta.1
+ ([#20479](https://github.com/Azure/azure-sdk-for-go/pull/20479))
+
+### Bugs Fixed
+* Fixed an issue in `DefaultAzureCredential` that could cause the managed identity endpoint check to fail in rare circumstances.
+
+## 1.3.0-beta.4 (2023-03-08)
+
+### Features Added
+* Added `WorkloadIdentityCredentialOptions.AdditionallyAllowedTenants` and `.DisableInstanceDiscovery`
+
+### Bugs Fixed
+* Credentials now synchronize within `GetToken()` so a single instance can be shared among goroutines
+ ([#20044](https://github.com/Azure/azure-sdk-for-go/issues/20044))
+
+### Other Changes
+* Upgraded dependencies
+
+## 1.2.2 (2023-03-07)
+
+### Other Changes
+* Upgraded dependencies
+
+## 1.3.0-beta.3 (2023-02-07)
+
+### Features Added
+* By default, credentials set client capability "CP1" to enable support for
+ [Continuous Access Evaluation (CAE)](https://docs.microsoft.com/azure/active-directory/develop/app-resilience-continuous-access-evaluation).
+ This indicates to Azure Active Directory that your application can handle CAE claims challenges.
+ You can disable this behavior by setting the environment variable "AZURE_IDENTITY_DISABLE_CP1" to "true".
+* `InteractiveBrowserCredentialOptions.LoginHint` enables pre-populating the login
+ prompt with a username ([#15599](https://github.com/Azure/azure-sdk-for-go/pull/15599))
+* Service principal and user credentials support ADFS authentication on Azure Stack.
+ Specify "adfs" as the credential's tenant.
+* Applications running in private or disconnected clouds can prevent credentials from
+ requesting Azure AD instance metadata by setting the `DisableInstanceDiscovery`
+ field on credential options.
+* Many credentials can now be configured to authenticate in multiple tenants. The
+ options types for these credentials have an `AdditionallyAllowedTenants` field
+ that specifies additional tenants in which the credential may authenticate.
+
+## 1.3.0-beta.2 (2023-01-10)
+
+### Features Added
+* Added `OnBehalfOfCredential` to support the on-behalf-of flow
+ ([#16642](https://github.com/Azure/azure-sdk-for-go/issues/16642))
+
+### Bugs Fixed
+* `AzureCLICredential` reports token expiration in local time (should be UTC)
+
+### Other Changes
+* `AzureCLICredential` imposes its default timeout only when the `Context`
+ passed to `GetToken()` has no deadline
+* Added `NewCredentialUnavailableError()`. This function constructs an error indicating
+ a credential can't authenticate and an encompassing `ChainedTokenCredential` should
+ try its next credential, if any.
+
+## 1.3.0-beta.1 (2022-12-13)
+
+### Features Added
+* `WorkloadIdentityCredential` and `DefaultAzureCredential` support
+ Workload Identity Federation on Kubernetes. `DefaultAzureCredential`
+ support requires environment variable configuration as set by the
+ Workload Identity webhook.
+ ([#15615](https://github.com/Azure/azure-sdk-for-go/issues/15615))
+
+## 1.2.0 (2022-11-08)
+
+### Other Changes
+* This version includes all fixes and features from 1.2.0-beta.*
+
+## 1.2.0-beta.3 (2022-10-11)
+
+### Features Added
+* `ManagedIdentityCredential` caches tokens in memory
+
+### Bugs Fixed
+* `ClientCertificateCredential` sends only the leaf cert for SNI authentication
+
+## 1.2.0-beta.2 (2022-08-10)
+
+### Features Added
+* Added `ClientAssertionCredential` to enable applications to authenticate
+ with custom client assertions
+
+### Other Changes
+* Updated AuthenticationFailedError with links to TROUBLESHOOTING.md for relevant errors
+* Upgraded `microsoft-authentication-library-for-go` requirement to v0.6.0
+
+## 1.2.0-beta.1 (2022-06-07)
+
+### Features Added
+* `EnvironmentCredential` reads certificate passwords from `AZURE_CLIENT_CERTIFICATE_PASSWORD`
+ ([#17099](https://github.com/Azure/azure-sdk-for-go/pull/17099))
+
+## 1.1.0 (2022-06-07)
+
+### Features Added
+* `ClientCertificateCredential` and `ClientSecretCredential` support ESTS-R. First-party
+ applications can set environment variable `AZURE_REGIONAL_AUTHORITY_NAME` with a
+ region name.
+ ([#15605](https://github.com/Azure/azure-sdk-for-go/issues/15605))
+
+## 1.0.1 (2022-06-07)
+
+### Other Changes
+* Upgrade `microsoft-authentication-library-for-go` requirement to v0.5.1
+ ([#18176](https://github.com/Azure/azure-sdk-for-go/issues/18176))
+
+## 1.0.0 (2022-05-12)
+
+### Features Added
+* `DefaultAzureCredential` reads environment variable `AZURE_CLIENT_ID` for the
+ client ID of a user-assigned managed identity
+ ([#17293](https://github.com/Azure/azure-sdk-for-go/pull/17293))
+
+### Breaking Changes
+* Removed `AuthorizationCodeCredential`. Use `InteractiveBrowserCredential` instead
+ to authenticate a user with the authorization code flow.
+* Instances of `AuthenticationFailedError` are now returned by pointer.
+* `GetToken()` returns `azcore.AccessToken` by value
+
+### Bugs Fixed
+* `AzureCLICredential` panics after receiving an unexpected error type
+ ([#17490](https://github.com/Azure/azure-sdk-for-go/issues/17490))
+
+### Other Changes
+* `GetToken()` returns an error when the caller specifies no scope
+* Updated to the latest versions of `golang.org/x/crypto`, `azcore` and `internal`
+
+## 0.14.0 (2022-04-05)
+
+### Breaking Changes
+* This module now requires Go 1.18
+* Removed `AuthorityHost`. Credentials are now configured for sovereign or private
+ clouds with the API in `azcore/cloud`, for example:
+ ```go
+ // before
+ opts := azidentity.ClientSecretCredentialOptions{AuthorityHost: azidentity.AzureGovernment}
+ cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, &opts)
+
+ // after
+ import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
+
+ opts := azidentity.ClientSecretCredentialOptions{}
+ opts.Cloud = cloud.AzureGovernment
+ cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, &opts)
+ ```
+
+## 0.13.2 (2022-03-08)
+
+### Bugs Fixed
+* Prevented a data race in `DefaultAzureCredential` and `ChainedTokenCredential`
+ ([#17144](https://github.com/Azure/azure-sdk-for-go/issues/17144))
+
+### Other Changes
+* Upgraded App Service managed identity version from 2017-09-01 to 2019-08-01
+ ([#17086](https://github.com/Azure/azure-sdk-for-go/pull/17086))
+
+## 0.13.1 (2022-02-08)
+
+### Features Added
+* `EnvironmentCredential` supports certificate SNI authentication when
+ `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN` is "true".
+ ([#16851](https://github.com/Azure/azure-sdk-for-go/pull/16851))
+
+### Bugs Fixed
+* `ManagedIdentityCredential.GetToken()` now returns an error when configured for
+ a user assigned identity in Azure Cloud Shell (which doesn't support such identities)
+ ([#16946](https://github.com/Azure/azure-sdk-for-go/pull/16946))
+
+### Other Changes
+* `NewDefaultAzureCredential()` logs non-fatal errors. These errors are also included in the
+ error returned by `DefaultAzureCredential.GetToken()` when it's unable to acquire a token
+ from any source. ([#15923](https://github.com/Azure/azure-sdk-for-go/issues/15923))
+
+## 0.13.0 (2022-01-11)
+
+### Breaking Changes
+* Replaced `AuthenticationFailedError.RawResponse()` with a field having the same name
+* Unexported `CredentialUnavailableError`
+* Instances of `ChainedTokenCredential` will now skip looping through the list of source credentials and re-use the first successful credential on subsequent calls to `GetToken`.
+ * If `ChainedTokenCredentialOptions.RetrySources` is true, `ChainedTokenCredential` will continue to try all of the originally provided credentials each time the `GetToken` method is called.
+ * `ChainedTokenCredential.successfulCredential` will contain a reference to the last successful credential.
+ * `DefaultAzureCredenial` will also re-use the first successful credential on subsequent calls to `GetToken`.
+ * `DefaultAzureCredential.chain.successfulCredential` will also contain a reference to the last successful credential.
+
+### Other Changes
+* `ManagedIdentityCredential` no longer probes IMDS before requesting a token
+ from it. Also, an error response from IMDS no longer disables a credential
+ instance. Following an error, a credential instance will continue to send
+ requests to IMDS as necessary.
+* Adopted MSAL for user and service principal authentication
+* Updated `azcore` requirement to 0.21.0
+
+## 0.12.0 (2021-11-02)
+### Breaking Changes
+* Raised minimum go version to 1.16
+* Removed `NewAuthenticationPolicy()` from credentials. Clients should instead use azcore's
+ `runtime.NewBearerTokenPolicy()` to construct a bearer token authorization policy.
+* The `AuthorityHost` field in credential options structs is now a custom type,
+ `AuthorityHost`, with underlying type `string`
+* `NewChainedTokenCredential` has a new signature to accommodate a placeholder
+ options struct:
+ ```go
+ // before
+ cred, err := NewChainedTokenCredential(credA, credB)
+
+ // after
+ cred, err := NewChainedTokenCredential([]azcore.TokenCredential{credA, credB}, nil)
+ ```
+* Removed `ExcludeAzureCLICredential`, `ExcludeEnvironmentCredential`, and `ExcludeMSICredential`
+ from `DefaultAzureCredentialOptions`
+* `NewClientCertificateCredential` requires a `[]*x509.Certificate` and `crypto.PrivateKey` instead of
+ a path to a certificate file. Added `ParseCertificates` to simplify getting these in common cases:
+ ```go
+ // before
+ cred, err := NewClientCertificateCredential("tenant", "client-id", "/cert.pem", nil)
+
+ // after
+ certData, err := os.ReadFile("/cert.pem")
+ certs, key, err := ParseCertificates(certData, password)
+ cred, err := NewClientCertificateCredential(tenantID, clientID, certs, key, nil)
+ ```
+* Removed `InteractiveBrowserCredentialOptions.ClientSecret` and `.Port`
+* Removed `AADAuthenticationFailedError`
+* Removed `id` parameter of `NewManagedIdentityCredential()`. User assigned identities are now
+ specified by `ManagedIdentityCredentialOptions.ID`:
+ ```go
+ // before
+ cred, err := NewManagedIdentityCredential("client-id", nil)
+ // or, for a resource ID
+ opts := &ManagedIdentityCredentialOptions{ID: ResourceID}
+ cred, err := NewManagedIdentityCredential("/subscriptions/...", opts)
+
+ // after
+ clientID := ClientID("7cf7db0d-...")
+ opts := &ManagedIdentityCredentialOptions{ID: clientID}
+ // or, for a resource ID
+ resID: ResourceID("/subscriptions/...")
+ opts := &ManagedIdentityCredentialOptions{ID: resID}
+ cred, err := NewManagedIdentityCredential(opts)
+ ```
+* `DeviceCodeCredentialOptions.UserPrompt` has a new type: `func(context.Context, DeviceCodeMessage) error`
+* Credential options structs now embed `azcore.ClientOptions`. In addition to changing literal initialization
+ syntax, this change renames `HTTPClient` fields to `Transport`.
+* Renamed `LogCredential` to `EventCredential`
+* `AzureCLICredential` no longer reads the environment variable `AZURE_CLI_PATH`
+* `NewManagedIdentityCredential` no longer reads environment variables `AZURE_CLIENT_ID` and
+ `AZURE_RESOURCE_ID`. Use `ManagedIdentityCredentialOptions.ID` instead.
+* Unexported `AuthenticationFailedError` and `CredentialUnavailableError` structs. In their place are two
+ interfaces having the same names.
+
+### Bugs Fixed
+* `AzureCLICredential.GetToken` no longer mutates its `opts.Scopes`
+
+### Features Added
+* Added connection configuration options to `DefaultAzureCredentialOptions`
+* `AuthenticationFailedError.RawResponse()` returns the HTTP response motivating the error,
+ if available
+
+### Other Changes
+* `NewDefaultAzureCredential()` returns `*DefaultAzureCredential` instead of `*ChainedTokenCredential`
+* Added `TenantID` field to `DefaultAzureCredentialOptions` and `AzureCLICredentialOptions`
+
+## 0.11.0 (2021-09-08)
+### Breaking Changes
+* Unexported `AzureCLICredentialOptions.TokenProvider` and its type,
+ `AzureCLITokenProvider`
+
+### Bug Fixes
+* `ManagedIdentityCredential.GetToken` returns `CredentialUnavailableError`
+ when IMDS has no assigned identity, signaling `DefaultAzureCredential` to
+ try other credentials
+
+
+## 0.10.0 (2021-08-30)
+### Breaking Changes
+* Update based on `azcore` refactor [#15383](https://github.com/Azure/azure-sdk-for-go/pull/15383)
+
+## 0.9.3 (2021-08-20)
+
+### Bugs Fixed
+* `ManagedIdentityCredential.GetToken` no longer mutates its `opts.Scopes`
+
+### Other Changes
+* Bumps version of `azcore` to `v0.18.1`
+
+
+## 0.9.2 (2021-07-23)
+### Features Added
+* Adding support for Service Fabric environment in `ManagedIdentityCredential`
+* Adding an option for using a resource ID instead of client ID in `ManagedIdentityCredential`
+
+
+## 0.9.1 (2021-05-24)
+### Features Added
+* Add LICENSE.txt and bump version information
+
+
+## 0.9.0 (2021-05-21)
+### Features Added
+* Add support for authenticating in Azure Stack environments
+* Enable user assigned identities for the IMDS scenario in `ManagedIdentityCredential`
+* Add scope to resource conversion in `GetToken()` on `ManagedIdentityCredential`
+
+
+## 0.8.0 (2021-01-20)
+### Features Added
+* Updating documentation
+
+
+## 0.7.1 (2021-01-04)
+### Features Added
+* Adding port option to `InteractiveBrowserCredential`
+
+
+## 0.7.0 (2020-12-11)
+### Features Added
+* Add `redirectURI` parameter back to authentication code flow
+
+
+## 0.6.1 (2020-12-09)
+### Features Added
+* Updating query parameter in `ManagedIdentityCredential` and updating datetime string for parsing managed identity access tokens.
+
+
+## 0.6.0 (2020-11-16)
+### Features Added
+* Remove `RedirectURL` parameter from auth code flow to align with the MSAL implementation which relies on the native client redirect URL.
+
+
+## 0.5.0 (2020-10-30)
+### Features Added
+* Flattening credential options
+
+
+## 0.4.3 (2020-10-21)
+### Features Added
+* Adding Azure Arc support in `ManagedIdentityCredential`
+
+
+## 0.4.2 (2020-10-16)
+### Features Added
+* Typo fixes
+
+
+## 0.4.1 (2020-10-16)
+### Features Added
+* Ensure authority hosts are only HTTPs
+
+
+## 0.4.0 (2020-10-16)
+### Features Added
+* Adding options structs for credentials
+
+
+## 0.3.0 (2020-10-09)
+### Features Added
+* Update `DeviceCodeCredential` callback
+
+
+## 0.2.2 (2020-10-09)
+### Features Added
+* Add `AuthorizationCodeCredential`
+
+
+## 0.2.1 (2020-10-06)
+### Features Added
+* Add `InteractiveBrowserCredential`
+
+
+## 0.2.0 (2020-09-11)
+### Features Added
+* Refactor `azidentity` on top of `azcore` refactor
+* Updated policies to conform to `policy.Policy` interface changes.
+* Updated non-retriable errors to conform to `azcore.NonRetriableError`.
+* Fixed calls to `Request.SetBody()` to include content type.
+* Switched endpoints to string types and removed extra parsing code.
+
+
+## 0.1.1 (2020-09-02)
+### Features Added
+* Add `AzureCLICredential` to `DefaultAzureCredential` chain
+
+
+## 0.1.0 (2020-07-23)
+### Features Added
+* Initial Release. Azure Identity library that provides Azure Active Directory token authentication support for the SDK.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txt
new file mode 100644
index 000000000..48ea6616b
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) Microsoft Corporation.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md
new file mode 100644
index 000000000..4ac53eb7b
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md
@@ -0,0 +1,307 @@
+# Migrating from autorest/adal to azidentity
+
+`azidentity` provides Azure Active Directory (Azure AD) authentication for the newest Azure SDK modules (`github.com/azure-sdk-for-go/sdk/...`). Older Azure SDK packages (`github.com/azure-sdk-for-go/services/...`) use types from `github.com/go-autorest/autorest/adal` instead.
+
+This guide shows common authentication code using `autorest/adal` and its equivalent using `azidentity`.
+
+## Table of contents
+
+- [Acquire a token](#acquire-a-token)
+- [Client certificate authentication](#client-certificate-authentication)
+- [Client secret authentication](#client-secret-authentication)
+- [Configuration](#configuration)
+- [Device code authentication](#device-code-authentication)
+- [Managed identity](#managed-identity)
+- [Use azidentity credentials with older packages](#use-azidentity-credentials-with-older-packages)
+
+## Configuration
+
+### `autorest/adal`
+
+Token providers require a token audience (resource identifier) and an instance of `adal.OAuthConfig`, which requires an Azure AD endpoint and tenant:
+
+```go
+import "github.com/Azure/go-autorest/autorest/adal"
+
+oauthCfg, err := adal.NewOAuthConfig("https://login.chinacloudapi.cn", tenantID)
+handle(err)
+
+spt, err := adal.NewServicePrincipalTokenWithSecret(
+ *oauthCfg, clientID, "https://management.chinacloudapi.cn/", &adal.ServicePrincipalTokenSecret{ClientSecret: secret},
+)
+```
+
+### `azidentity`
+
+A credential instance can acquire tokens for any audience. The audience for each token is determined by the client requesting it. Credentials require endpoint configuration only for sovereign or private clouds. The `azcore/cloud` package has predefined configuration for sovereign clouds such as Azure China:
+
+```go
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+)
+
+clientOpts := azcore.ClientOptions{Cloud: cloud.AzureChina}
+
+cred, err := azidentity.NewClientSecretCredential(
+ tenantID, clientID, secret, &azidentity.ClientSecretCredentialOptions{ClientOptions: clientOpts},
+)
+handle(err)
+```
+
+## Client secret authentication
+
+### `autorest/adal`
+
+```go
+import (
+ "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/adal"
+)
+
+oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID)
+handle(err)
+spt, err := adal.NewServicePrincipalTokenWithSecret(
+ *oauthCfg, clientID, "https://management.azure.com/", &adal.ServicePrincipalTokenSecret{ClientSecret: secret},
+)
+handle(err)
+
+client := subscriptions.NewClient()
+client.Authorizer = autorest.NewBearerAuthorizer(spt)
+```
+
+### `azidentity`
+
+```go
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions"
+)
+
+cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil)
+handle(err)
+
+client, err := armsubscriptions.NewClient(cred, nil)
+handle(err)
+```
+
+## Client certificate authentication
+
+### `autorest/adal`
+
+```go
+import (
+ "os"
+
+ "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/adal"
+)
+certData, err := os.ReadFile("./example.pfx")
+handle(err)
+
+certificate, rsaPrivateKey, err := decodePkcs12(certData, "")
+handle(err)
+
+oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID)
+handle(err)
+
+spt, err := adal.NewServicePrincipalTokenFromCertificate(
+ *oauthConfig, clientID, certificate, rsaPrivateKey, "https://management.azure.com/",
+)
+
+client := subscriptions.NewClient()
+client.Authorizer = autorest.NewBearerAuthorizer(spt)
+```
+
+### `azidentity`
+
+```go
+import (
+ "os"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions"
+)
+
+certData, err := os.ReadFile("./example.pfx")
+handle(err)
+
+certs, key, err := azidentity.ParseCertificates(certData, nil)
+handle(err)
+
+cred, err = azidentity.NewClientCertificateCredential(tenantID, clientID, certs, key, nil)
+handle(err)
+
+client, err := armsubscriptions.NewClient(cred, nil)
+handle(err)
+```
+
+## Managed identity
+
+### `autorest/adal`
+
+```go
+import (
+ "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/adal"
+)
+
+spt, err := adal.NewServicePrincipalTokenFromManagedIdentity("https://management.azure.com/", nil)
+handle(err)
+
+client := subscriptions.NewClient()
+client.Authorizer = autorest.NewBearerAuthorizer(spt)
+```
+
+### `azidentity`
+
+```go
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions"
+)
+
+cred, err := azidentity.NewManagedIdentityCredential(nil)
+handle(err)
+
+client, err := armsubscriptions.NewClient(cred, nil)
+handle(err)
+```
+
+### User-assigned identities
+
+`autorest/adal`:
+
+```go
+import "github.com/Azure/go-autorest/autorest/adal"
+
+opts := &adal.ManagedIdentityOptions{ClientID: "..."}
+spt, err := adal.NewServicePrincipalTokenFromManagedIdentity("https://management.azure.com/")
+handle(err)
+```
+
+`azidentity`:
+
+```go
+import "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+
+opts := azidentity.ManagedIdentityCredentialOptions{ID: azidentity.ClientID("...")}
+cred, err := azidentity.NewManagedIdentityCredential(&opts)
+handle(err)
+```
+
+## Device code authentication
+
+### `autorest/adal`
+
+```go
+import (
+ "fmt"
+ "net/http"
+
+ "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/adal"
+)
+
+oauthClient := &http.Client{}
+oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID)
+handle(err)
+resource := "https://management.azure.com/"
+deviceCode, err := adal.InitiateDeviceAuth(oauthClient, *oauthCfg, clientID, resource)
+handle(err)
+
+// display instructions, wait for the user to authenticate
+fmt.Println(*deviceCode.Message)
+token, err := adal.WaitForUserCompletion(oauthClient, deviceCode)
+handle(err)
+
+spt, err := adal.NewServicePrincipalTokenFromManualToken(*oauthCfg, clientID, resource, *token)
+handle(err)
+
+client := subscriptions.NewClient()
+client.Authorizer = autorest.NewBearerAuthorizer(spt)
+```
+
+### `azidentity`
+
+```go
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions"
+)
+
+cred, err := azidentity.NewDeviceCodeCredential(nil)
+handle(err)
+
+client, err := armsubscriptions.NewSubscriptionsClient(cred, nil)
+handle(err)
+```
+
+`azidentity.DeviceCodeCredential` will guide a user through authentication, printing instructions to the console by default. The user prompt is customizable. For more information, see the [package documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DeviceCodeCredential).
+
+## Acquire a token
+
+### `autorest/adal`
+
+```go
+import "github.com/Azure/go-autorest/autorest/adal"
+
+oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID)
+handle(err)
+
+spt, err := adal.NewServicePrincipalTokenWithSecret(
+ *oauthCfg, clientID, "https://vault.azure.net", &adal.ServicePrincipalTokenSecret{ClientSecret: secret},
+)
+
+err = spt.Refresh()
+if err == nil {
+ token := spt.Token
+}
+```
+
+### `azidentity`
+
+In ordinary usage, application code doesn't need to request tokens from credentials directly. Azure SDK clients handle token acquisition and refreshing internally. However, applications may call `GetToken()` to do so. All credential types have this method.
+
+```go
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+)
+
+cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil)
+handle(err)
+
+tk, err := cred.GetToken(
+ context.TODO(), policy.TokenRequestOptions{Scopes: []string{"https://vault.azure.net/.default"}},
+)
+if err == nil {
+ token := tk.Token
+}
+```
+
+Note that `azidentity` credentials use the Azure AD v2.0 endpoint, which requires OAuth 2 scopes instead of the resource identifiers `autorest/adal` expects. For more information, see [Azure AD documentation](https://docs.microsoft.com/azure/active-directory/develop/v2-permissions-and-consent).
+
+## Use azidentity credentials with older packages
+
+The [azidext module](https://pkg.go.dev/github.com/jongio/azidext/go/azidext) provides an adapter for `azidentity` credential types. The adapter enables using the credential types with older Azure SDK clients. For example:
+
+```go
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
+ "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
+ "github.com/jongio/azidext/go/azidext"
+)
+
+cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil)
+handle(err)
+
+client := subscriptions.NewClient()
+client.Authorizer = azidext.NewTokenCredentialAdapter(cred, []string{"https://management.azure.com//.default"})
+```
+
+
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md
new file mode 100644
index 000000000..da0baa9ad
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md
@@ -0,0 +1,243 @@
+# Azure Identity Client Module for Go
+
+The Azure Identity module provides Azure Active Directory (Azure AD) token authentication support across the Azure SDK. It includes a set of `TokenCredential` implementations, which can be used with Azure SDK clients supporting token authentication.
+
+[](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity)
+| [Azure Active Directory documentation](https://docs.microsoft.com/azure/active-directory/)
+| [Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/azidentity)
+
+# Getting started
+
+## Install the module
+
+This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
+
+Install the Azure Identity module:
+
+```sh
+go get -u github.com/Azure/azure-sdk-for-go/sdk/azidentity
+```
+
+## Prerequisites
+
+- an [Azure subscription](https://azure.microsoft.com/free/)
+- Go 1.18
+
+### Authenticating during local development
+
+When debugging and executing code locally, developers typically use their own accounts to authenticate calls to Azure services. The `azidentity` module supports authenticating through developer tools to simplify local development.
+
+#### Authenticating via the Azure CLI
+
+`DefaultAzureCredential` and `AzureCLICredential` can authenticate as the user
+signed in to the [Azure CLI](https://docs.microsoft.com/cli/azure). To sign in to the Azure CLI, run `az login`. On a system with a default web browser, the Azure CLI will launch the browser to authenticate a user.
+
+When no default browser is available, `az login` will use the device code
+authentication flow. This can also be selected manually by running `az login --use-device-code`.
+
+## Key concepts
+
+### Credentials
+
+A credential is a type which contains or can obtain the data needed for a
+service client to authenticate requests. Service clients across the Azure SDK
+accept a credential instance when they are constructed, and use that credential
+to authenticate requests.
+
+The `azidentity` module focuses on OAuth authentication with Azure Active
+Directory (AAD). It offers a variety of credential types capable of acquiring
+an Azure AD access token. See [Credential Types](#credential-types "Credential Types") for a list of this module's credential types.
+
+### DefaultAzureCredential
+
+`DefaultAzureCredential` is appropriate for most apps that will be deployed to Azure. It combines common production credentials with development credentials. It attempts to authenticate via the following mechanisms in this order, stopping when one succeeds:
+
+
+
+1. **Environment** - `DefaultAzureCredential` will read account information specified via [environment variables](#environment-variables) and use it to authenticate.
+1. **Workload Identity** - If the app is deployed on Kubernetes with environment variables set by the workload identity webhook, `DefaultAzureCredential` will authenticate the configured identity.
+1. **Managed Identity** - If the app is deployed to an Azure host with managed identity enabled, `DefaultAzureCredential` will authenticate with it.
+1. **Azure CLI** - If a user or service principal has authenticated via the Azure CLI `az login` command, `DefaultAzureCredential` will authenticate that identity.
+
+> Note: `DefaultAzureCredential` is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types.
+
+## Managed Identity
+
+`DefaultAzureCredential` and `ManagedIdentityCredential` support
+[managed identity authentication](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview)
+in any hosting environment which supports managed identities, such as (this list is not exhaustive):
+* [Azure App Service](https://docs.microsoft.com/azure/app-service/overview-managed-identity)
+* [Azure Arc](https://docs.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)
+* [Azure Cloud Shell](https://docs.microsoft.com/azure/cloud-shell/msi-authorization)
+* [Azure Kubernetes Service](https://docs.microsoft.com/azure/aks/use-managed-identity)
+* [Azure Service Fabric](https://docs.microsoft.com/azure/service-fabric/concepts-managed-identity)
+* [Azure Virtual Machines](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token)
+
+## Examples
+
+- [Authenticate with DefaultAzureCredential](#authenticate-with-defaultazurecredential "Authenticate with DefaultAzureCredential")
+- [Define a custom authentication flow with ChainedTokenCredential](#define-a-custom-authentication-flow-with-chainedtokencredential "Define a custom authentication flow with ChainedTokenCredential")
+- [Specify a user-assigned managed identity for DefaultAzureCredential](#specify-a-user-assigned-managed-identity-for-defaultazurecredential)
+
+### Authenticate with DefaultAzureCredential
+
+This example demonstrates authenticating a client from the `armresources` module with `DefaultAzureCredential`.
+
+```go
+cred, err := azidentity.NewDefaultAzureCredential(nil)
+if err != nil {
+ // handle error
+}
+
+client := armresources.NewResourceGroupsClient("subscription ID", cred, nil)
+```
+
+### Specify a user-assigned managed identity for DefaultAzureCredential
+
+To configure `DefaultAzureCredential` to authenticate a user-assigned managed identity, set the environment variable `AZURE_CLIENT_ID` to the identity's client ID.
+
+### Define a custom authentication flow with `ChainedTokenCredential`
+
+`DefaultAzureCredential` is generally the quickest way to get started developing apps for Azure. For more advanced scenarios, `ChainedTokenCredential` links multiple credential instances to be tried sequentially when authenticating. It will try each chained credential in turn until one provides a token or fails to authenticate due to an error.
+
+The following example demonstrates creating a credential, which will attempt to authenticate using managed identity. It will fall back to authenticating via the Azure CLI when a managed identity is unavailable.
+
+```go
+managed, err := azidentity.NewManagedIdentityCredential(nil)
+if err != nil {
+ // handle error
+}
+azCLI, err := azidentity.NewAzureCLICredential(nil)
+if err != nil {
+ // handle error
+}
+chain, err := azidentity.NewChainedTokenCredential([]azcore.TokenCredential{managed, azCLI}, nil)
+if err != nil {
+ // handle error
+}
+
+client := armresources.NewResourceGroupsClient("subscription ID", chain, nil)
+```
+
+## Credential Types
+
+### Authenticating Azure Hosted Applications
+
+|Credential|Usage
+|-|-
+|[DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential)|Simplified authentication experience for getting started developing Azure apps
+|[ChainedTokenCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ChainedTokenCredential)|Define custom authentication flows, composing multiple credentials
+|[EnvironmentCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#EnvironmentCredential)|Authenticate a service principal or user configured by environment variables
+|[ManagedIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ManagedIdentityCredential)|Authenticate the managed identity of an Azure resource
+|[WorkloadIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#WorkloadIdentityCredential)|Authenticate a workload identity on Kubernetes
+
+### Authenticating Service Principals
+
+|Credential|Usage
+|-|-
+|[ClientAssertionCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientAssertionCredential)|Authenticate a service principal with a signed client assertion
+|[ClientCertificateCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientCertificateCredential)|Authenticate a service principal with a certificate
+|[ClientSecretCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientSecretCredential)|Authenticate a service principal with a secret
+
+### Authenticating Users
+
+|Credential|Usage
+|-|-
+|[InteractiveBrowserCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#InteractiveBrowserCredential)|Interactively authenticate a user with the default web browser
+|[DeviceCodeCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DeviceCodeCredential)|Interactively authenticate a user on a device with limited UI
+|[UsernamePasswordCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#UsernamePasswordCredential)|Authenticate a user with a username and password
+
+### Authenticating via Development Tools
+
+|Credential|Usage
+|-|-
+|[AzureCLICredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzureCLICredential)|Authenticate as the user signed in to the Azure CLI
+
+## Environment Variables
+
+`DefaultAzureCredential` and `EnvironmentCredential` can be configured with environment variables. Each type of authentication requires values for specific variables:
+
+#### Service principal with secret
+
+|variable name|value
+|-|-
+|`AZURE_CLIENT_ID`|ID of an Azure Active Directory application
+|`AZURE_TENANT_ID`|ID of the application's Azure Active Directory tenant
+|`AZURE_CLIENT_SECRET`|one of the application's client secrets
+
+#### Service principal with certificate
+
+|variable name|value
+|-|-
+|`AZURE_CLIENT_ID`|ID of an Azure Active Directory application
+|`AZURE_TENANT_ID`|ID of the application's Azure Active Directory tenant
+|`AZURE_CLIENT_CERTIFICATE_PATH`|path to a certificate file including private key
+|`AZURE_CLIENT_CERTIFICATE_PASSWORD`|password of the certificate file, if any
+
+#### Username and password
+
+|variable name|value
+|-|-
+|`AZURE_CLIENT_ID`|ID of an Azure Active Directory application
+|`AZURE_USERNAME`|a username (usually an email address)
+|`AZURE_PASSWORD`|that user's password
+
+Configuration is attempted in the above order. For example, if values for a
+client secret and certificate are both present, the client secret will be used.
+
+## Troubleshooting
+
+### Error Handling
+
+Credentials return an `error` when they fail to authenticate or lack data they require to authenticate. For guidance on resolving errors from specific credential types, see the [troubleshooting guide](https://aka.ms/azsdk/go/identity/troubleshoot).
+
+For more details on handling specific Azure Active Directory errors please refer to the
+Azure Active Directory
+[error code documentation](https://docs.microsoft.com/azure/active-directory/develop/reference-aadsts-error-codes).
+
+### Logging
+
+This module uses the classification-based logging implementation in `azcore`. To enable console logging for all SDK modules, set `AZURE_SDK_GO_LOGGING` to `all`. Use the `azcore/log` package to control log event output or to enable logs for `azidentity` only. For example:
+```go
+import azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log"
+
+// print log output to stdout
+azlog.SetListener(func(event azlog.Event, s string) {
+ fmt.Println(s)
+})
+
+// include only azidentity credential logs
+azlog.SetEvents(azidentity.EventAuthentication)
+```
+
+Credentials log basic information only, such as `GetToken` success or failure and errors. These log entries don't contain authentication secrets but may contain sensitive information.
+
+## Next steps
+
+Client and management modules listed on the [Azure SDK releases page](https://azure.github.io/azure-sdk/releases/latest/go.html) support authenticating with `azidentity` credential types. You can learn more about using these libraries in their documentation, which is linked from the release page.
+
+## Provide Feedback
+
+If you encounter bugs or have suggestions, please
+[open an issue](https://github.com/Azure/azure-sdk-for-go/issues).
+
+## 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](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](https://opensource.microsoft.com/codeofconduct/).
+For more information, see the
+[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
+or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
+additional questions or comments.
+
+
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md
new file mode 100644
index 000000000..fef099813
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md
@@ -0,0 +1,207 @@
+# Troubleshoot Azure Identity authentication issues
+
+This troubleshooting guide covers failure investigation techniques, common errors for the credential types in the `azidentity` module, and mitigation steps to resolve these errors.
+
+## Table of contents
+
+- [Handle azidentity errors](#handle-azidentity-errors)
+ - [Permission issues](#permission-issues)
+- [Find relevant information in errors](#find-relevant-information-in-errors)
+- [Enable and configure logging](#enable-and-configure-logging)
+- [Troubleshoot AzureCliCredential authentication issues](#troubleshoot-azureclicredential-authentication-issues)
+- [Troubleshoot ClientCertificateCredential authentication issues](#troubleshoot-clientcertificatecredential-authentication-issues)
+- [Troubleshoot ClientSecretCredential authentication issues](#troubleshoot-clientsecretcredential-authentication-issues)
+- [Troubleshoot DefaultAzureCredential authentication issues](#troubleshoot-defaultazurecredential-authentication-issues)
+- [Troubleshoot EnvironmentCredential authentication issues](#troubleshoot-environmentcredential-authentication-issues)
+- [Troubleshoot ManagedIdentityCredential authentication issues](#troubleshoot-managedidentitycredential-authentication-issues)
+ - [Azure App Service and Azure Functions managed identity](#azure-app-service-and-azure-functions-managed-identity)
+ - [Azure Kubernetes Service managed identity](#azure-kubernetes-service-managed-identity)
+ - [Azure Virtual Machine managed identity](#azure-virtual-machine-managed-identity)
+- [Troubleshoot UsernamePasswordCredential authentication issues](#troubleshoot-usernamepasswordcredential-authentication-issues)
+- [Troubleshoot WorkloadIdentityCredential authentication issues](#troubleshoot-workloadidentitycredential-authentication-issues)
+- [Get additional help](#get-additional-help)
+
+## Handle azidentity errors
+
+Any service client method that makes a request to the service may return an error due to authentication failure. This is because the credential authenticates on the first call to the service and on any subsequent call that needs to refresh an access token. Authentication errors include a description of the failure and possibly an error message from Azure Active Directory (Azure AD). Depending on the application, these errors may or may not be recoverable.
+
+### Permission issues
+
+Service client errors with a status code of 401 or 403 often indicate that authentication succeeded but the caller doesn't have permission to access the specified API. Check the service documentation to determine which RBAC roles are needed for the request, and ensure the authenticated user or service principal has the appropriate role assignments.
+
+## Find relevant information in errors
+
+Authentication errors can include responses from Azure AD and often contain information helpful in diagnosis. Consider the following error message:
+
+```
+ClientSecretCredential authentication failed
+POST https://login.microsoftonline.com/3c631bb7-a9f7-4343-a5ba-a615913/oauth2/v2.0/token
+--------------------------------------------------------------------------------
+RESPONSE 401 Unauthorized
+--------------------------------------------------------------------------------
+{
+ "error": "invalid_client",
+ "error_description": "AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '86be4c01-505b-45e9-bfc0-9b825fd84'.\r\nTrace ID: 03da4b8e-5ffe-48ca-9754-aff4276f0100\r\nCorrelation ID: 7b12f9bb-2eef-42e3-ad75-eee69ec9088d\r\nTimestamp: 2022-03-02 18:25:26Z",
+ "error_codes": [
+ 7000215
+ ],
+ "timestamp": "2022-03-02 18:25:26Z",
+ "trace_id": "03da4b8e-5ffe-48ca-9754-aff4276f0100",
+ "correlation_id": "7b12f9bb-2eef-42e3-ad75-eee69ec9088d",
+ "error_uri": "https://login.microsoftonline.com/error?code=7000215"
+}
+--------------------------------------------------------------------------------
+```
+
+This error contains several pieces of information:
+
+- __Failing Credential Type__: The type of credential that failed to authenticate. This can be helpful when diagnosing issues with chained credential types such as `DefaultAzureCredential` or `ChainedTokenCredential`.
+
+- __Azure AD Error Code and Message__: The error code and message returned by Azure AD. This can give insight into the specific reason the request failed. For instance, in this case authentication failed because the provided client secret is incorrect. [Azure AD documentation](https://docs.microsoft.com/azure/active-directory/develop/reference-aadsts-error-codes#aadsts-error-codes) has more information on AADSTS error codes.
+
+- __Correlation ID and Timestamp__: The correlation ID and timestamp identify the request in server-side logs. This information can be useful to support engineers diagnosing unexpected Azure AD failures.
+
+### Enable and configure logging
+
+`azidentity` provides the same logging capabilities as the rest of the Azure SDK. The simplest way to see the logs to help debug authentication issues is to print credential logs to the console.
+```go
+import azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log"
+
+// print log output to stdout
+azlog.SetListener(func(event azlog.Event, s string) {
+ fmt.Println(s)
+})
+
+// include only azidentity credential logs
+azlog.SetEvents(azidentity.EventAuthentication)
+```
+
+
+## Troubleshoot DefaultAzureCredential authentication issues
+
+| Error |Description| Mitigation |
+|---|---|---|
+|"DefaultAzureCredential failed to acquire a token"|No credential in the `DefaultAzureCredential` chain provided a token|
- [Enable logging](#enable-and-configure-logging) to get further diagnostic information.
- Consult the troubleshooting guide for underlying credential types for more information.
- [EnvironmentCredential](#troubleshoot-environmentcredential-authentication-issues)
- [ManagedIdentityCredential](#troubleshoot-managedidentitycredential-authentication-issues)
- [AzureCLICredential](#troubleshoot-azureclicredential-authentication-issues)
|
+|Error from the client with a status code of 401 or 403|Authentication succeeded but the authorizing Azure service responded with a 401 (Unauthorized), or 403 (Forbidden) status code|- [Enable logging](#enable-and-configure-logging) to determine which credential in the chain returned the authenticating token.
- If an unexpected credential is returning a token, check application configuration such as environment variables.
- Ensure the correct role is assigned to the authenticated identity. For example, a service specific role rather than the subscription Owner role.
|
+|"managed identity timed out"|`DefaultAzureCredential` sets a short timeout on its first managed identity authentication attempt to prevent very long timeouts during local development when no managed identity is available. That timeout causes this error in production when an application requests a token before the hosting environment is ready to provide one.|Use [ManagedIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ManagedIdentityCredential) directly, at least in production. It doesn't set a timeout on its authentication attempts.|
+
+## Troubleshoot EnvironmentCredential authentication issues
+
+| Error Message |Description| Mitigation |
+|---|---|---|
+|Missing or incomplete environment variable configuration|A valid combination of environment variables wasn't set|Ensure the appropriate environment variables are set for the intended authentication method as described in the [module documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#EnvironmentCredential)|
+
+
+## Troubleshoot ClientSecretCredential authentication issues
+
+| Error Code | Issue | Mitigation |
+|---|---|---|
+|AADSTS7000215|An invalid client secret was provided.|Ensure the secret provided to the credential constructor is valid. If unsure, create a new client secret using the Azure portal. Details on creating a new client secret are in [Azure AD documentation](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret).|
+|AADSTS7000222|An expired client secret was provided.|Create a new client secret using the Azure portal. Details on creating a new client secret are in [Azure AD documentation](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret).|
+|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Azure AD instructions](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).|
+
+
+## Troubleshoot ClientCertificateCredential authentication issues
+
+| Error Code | Description | Mitigation |
+|---|---|---|
+|AADSTS700027|Client assertion contains an invalid signature.|Ensure the specified certificate has been uploaded to the application registration as described in [Azure AD documentation](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-1-upload-a-certificate).|
+|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Azure AD instructions](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).|
+
+
+## Troubleshoot UsernamePasswordCredential authentication issues
+
+| Error Code | Issue | Mitigation |
+|---|---|---|
+|AADSTS50126|The provided username or password is invalid.|Ensure the username and password provided to the credential constructor are valid.|
+
+
+## Troubleshoot ManagedIdentityCredential authentication issues
+
+`ManagedIdentityCredential` is designed to work on a variety of Azure hosts support managed identity. Configuration and troubleshooting vary from host to host. The below table lists the Azure hosts that can be assigned a managed identity and are supported by `ManagedIdentityCredential`.
+
+|Host Environment| | |
+|---|---|---|
+|Azure Virtual Machines and Scale Sets|[Configuration](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm)|[Troubleshooting](#azure-virtual-machine-managed-identity)|
+|Azure App Service and Azure Functions|[Configuration](https://docs.microsoft.com/azure/app-service/overview-managed-identity)|[Troubleshooting](#azure-app-service-and-azure-functions-managed-identity)|
+|Azure Kubernetes Service|[Configuration](https://azure.github.io/aad-pod-identity/docs/)|[Troubleshooting](#azure-kubernetes-service-managed-identity)|
+|Azure Arc|[Configuration](https://docs.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)||
+|Azure Service Fabric|[Configuration](https://docs.microsoft.com/azure/service-fabric/concepts-managed-identity)||
+
+### Azure Virtual Machine managed identity
+
+| Error Message |Description| Mitigation |
+|---|---|---|
+|The requested identity hasn’t been assigned to this resource.|The IMDS endpoint responded with a status code of 400, indicating the requested identity isn’t assigned to the VM.|If using a user assigned identity, ensure the specified ID is correct.If using a system assigned identity, make sure it has been enabled as described in [managed identity documentation](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm#enable-system-assigned-managed-identity-on-an-existing-vm).|
+|The request failed due to a gateway error.|The request to the IMDS endpoint failed due to a gateway error, 502 or 504 status code.|IMDS doesn't support requests via proxy or gateway. Disable proxies or gateways running on the VM for requests to the IMDS endpoint `http://169.254.169.254`|
+|No response received from the managed identity endpoint.|No response was received for the request to IMDS or the request timed out.|- Ensure the VM is configured for managed identity as described in [managed identity documentation](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm).
- Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
|
+|Multiple attempts failed to obtain a token from the managed identity endpoint.|The credential has exhausted its retries for a token request.|- Refer to the error message for more details on specific failures.
- Ensure the VM is configured for managed identity as described in [managed identity documentation](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm).
- Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.
|
+
+#### Verify IMDS is available on the VM
+
+If you have access to the VM, you can use `curl` to verify the managed identity endpoint is available.
+
+```sh
+curl 'http://169.254.169.254/metadata/identity/oauth2/token?resource=https://management.core.windows.net&api-version=2018-02-01' -H "Metadata: true"
+```
+
+> This command's output will contain an access token and SHOULD NOT BE SHARED, to avoid compromising account security.
+
+### Azure App Service and Azure Functions managed identity
+
+| Error Message |Description| Mitigation |
+|---|---|---|
+|Get "`http://169.254.169.254/...`" i/o timeout|The App Service host hasn't set environment variables for managed identity configuration.|- Ensure the App Service is configured for managed identity as described in [App Service documentation](https://docs.microsoft.com/azure/app-service/overview-managed-identity).
- Verify the App Service environment is properly configured and the managed identity endpoint is available. See [below](#verify-the-app-service-managed-identity-endpoint-is-available) for instructions.
|
+
+#### Verify the App Service managed identity endpoint is available
+
+If you can SSH into the App Service, you can verify managed identity is available in the environment. First ensure the environment variables `IDENTITY_ENDPOINT` and `IDENTITY_SECRET` are set. Then you can verify the managed identity endpoint is available using `curl`.
+
+```sh
+curl "$IDENTITY_ENDPOINT?resource=https://management.core.windows.net&api-version=2019-08-01" -H "X-IDENTITY-HEADER: $IDENTITY_HEADER"
+```
+
+> This command's output will contain an access token and SHOULD NOT BE SHARED, to avoid compromising account security.
+
+### Azure Kubernetes Service managed identity
+
+#### Pod Identity
+
+| Error Message |Description| Mitigation |
+|---|---|---|
+|"no azure identity found for request clientID"|The application attempted to authenticate before an identity was assigned to its pod|Verify the pod is labeled correctly. This also occurs when a correctly labeled pod authenticates before the identity is ready. To prevent initialization races, configure NMI to set the Retry-After header in its responses as described in [Pod Identity documentation](https://azure.github.io/aad-pod-identity/docs/configure/feature_flags/#set-retry-after-header-in-nmi-response).
+
+
+## Troubleshoot AzureCliCredential authentication issues
+
+| Error Message |Description| Mitigation |
+|---|---|---|
+|Azure CLI not found on path|The Azure CLI isn’t installed or isn't on the application's path.|- Ensure the Azure CLI is installed as described in [Azure CLI documentation](https://docs.microsoft.com/cli/azure/install-azure-cli).
- Validate the installation location is in the application's `PATH` environment variable.
|
+|Please run 'az login' to set up account|No account is currently logged into the Azure CLI, or the login has expired.|- Run `az login` to log into the Azure CLI. More information about Azure CLI authentication is available in the [Azure CLI documentation](https://docs.microsoft.com/cli/azure/authenticate-azure-cli).
- Verify that the Azure CLI can obtain tokens. See [below](#verify-the-azure-cli-can-obtain-tokens) for instructions.
|
+
+#### Verify the Azure CLI can obtain tokens
+
+You can manually verify that the Azure CLI can authenticate and obtain tokens. First, use the `account` command to verify the logged in account.
+
+```azurecli
+az account show
+```
+
+Once you've verified the Azure CLI is using the correct account, you can validate that it's able to obtain tokens for that account.
+
+```azurecli
+az account get-access-token --output json --resource https://management.core.windows.net
+```
+
+> This command's output will contain an access token and SHOULD NOT BE SHARED, to avoid compromising account security.
+
+
+## Troubleshoot `WorkloadIdentityCredential` authentication issues
+
+| Error Message |Description| Mitigation |
+|---|---|---|
+|no client ID/tenant ID/token file specified|Incomplete configuration|In most cases these values are provided via environment variables set by Azure Workload Identity.- If your application runs on Azure Kubernetes Servide (AKS) or a cluster that has deployed the Azure Workload Identity admission webhook, check pod labels and service account configuration. See the [AKS documentation](https://learn.microsoft.com/azure/aks/workload-identity-deploy-cluster#disable-workload-identity) and [Azure Workload Identity troubleshooting guide](https://azure.github.io/azure-workload-identity/docs/troubleshooting.html) for more details.
- If your application isn't running on AKS or your cluster hasn't deployed the Workload Identity admission webhook, set these values in `WorkloadIdentityCredentialOptions`
+
+## Get additional help
+
+Additional information on ways to reach out for support can be found in [SUPPORT.md](https://github.com/Azure/azure-sdk-for-go/blob/main/SUPPORT.md).
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json
new file mode 100644
index 000000000..47e77f88e
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json
@@ -0,0 +1,6 @@
+{
+ "AssetsRepo": "Azure/azure-sdk-assets",
+ "AssetsRepoPrefixPath": "go",
+ "TagPrefix": "go/azidentity",
+ "Tag": "go/azidentity_6225ab0470"
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go
new file mode 100644
index 000000000..10b742ce1
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go
@@ -0,0 +1,178 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "bytes"
+ "context"
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "net/url"
+ "os"
+ "regexp"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/public"
+)
+
+const (
+ azureAdditionallyAllowedTenants = "AZURE_ADDITIONALLY_ALLOWED_TENANTS"
+ azureAuthorityHost = "AZURE_AUTHORITY_HOST"
+ azureClientCertificatePassword = "AZURE_CLIENT_CERTIFICATE_PASSWORD"
+ azureClientCertificatePath = "AZURE_CLIENT_CERTIFICATE_PATH"
+ azureClientID = "AZURE_CLIENT_ID"
+ azureClientSecret = "AZURE_CLIENT_SECRET"
+ azureFederatedTokenFile = "AZURE_FEDERATED_TOKEN_FILE"
+ azurePassword = "AZURE_PASSWORD"
+ azureRegionalAuthorityName = "AZURE_REGIONAL_AUTHORITY_NAME"
+ azureTenantID = "AZURE_TENANT_ID"
+ azureUsername = "AZURE_USERNAME"
+
+ organizationsTenantID = "organizations"
+ developerSignOnClientID = "04b07795-8ddb-461a-bbee-02f9e1bf7b46"
+ defaultSuffix = "/.default"
+)
+
+var (
+ // capability CP1 indicates the client application is capable of handling CAE claims challenges
+ cp1 = []string{"CP1"}
+ errInvalidTenantID = errors.New("invalid tenantID. You can locate your tenantID by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names")
+)
+
+// setAuthorityHost initializes the authority host for credentials. Precedence is:
+// 1. cloud.Configuration.ActiveDirectoryAuthorityHost value set by user
+// 2. value of AZURE_AUTHORITY_HOST
+// 3. default: Azure Public Cloud
+func setAuthorityHost(cc cloud.Configuration) (string, error) {
+ host := cc.ActiveDirectoryAuthorityHost
+ if host == "" {
+ if len(cc.Services) > 0 {
+ return "", errors.New("missing ActiveDirectoryAuthorityHost for specified cloud")
+ }
+ host = cloud.AzurePublic.ActiveDirectoryAuthorityHost
+ if envAuthorityHost := os.Getenv(azureAuthorityHost); envAuthorityHost != "" {
+ host = envAuthorityHost
+ }
+ }
+ u, err := url.Parse(host)
+ if err != nil {
+ return "", err
+ }
+ if u.Scheme != "https" {
+ return "", errors.New("cannot use an authority host without https")
+ }
+ return host, nil
+}
+
+// resolveAdditionalTenants returns a copy of tenants, simplified when tenants contains a wildcard
+func resolveAdditionalTenants(tenants []string) []string {
+ if len(tenants) == 0 {
+ return nil
+ }
+ for _, t := range tenants {
+ // a wildcard makes all other values redundant
+ if t == "*" {
+ return []string{"*"}
+ }
+ }
+ cp := make([]string, len(tenants))
+ copy(cp, tenants)
+ return cp
+}
+
+// resolveTenant returns the correct tenant for a token request
+func resolveTenant(defaultTenant, specified, credName string, additionalTenants []string) (string, error) {
+ if specified == "" || specified == defaultTenant {
+ return defaultTenant, nil
+ }
+ if defaultTenant == "adfs" {
+ return "", errors.New("ADFS doesn't support tenants")
+ }
+ if !validTenantID(specified) {
+ return "", errInvalidTenantID
+ }
+ for _, t := range additionalTenants {
+ if t == "*" || t == specified {
+ return specified, nil
+ }
+ }
+ return "", fmt.Errorf(`%s isn't configured to acquire tokens for tenant %q. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to allow acquiring tokens for any tenant`, credName, specified)
+}
+
+// validTenantID return true is it receives a valid tenantID, returns false otherwise
+func validTenantID(tenantID string) bool {
+ match, err := regexp.MatchString("^[0-9a-zA-Z-.]+$", tenantID)
+ if err != nil {
+ return false
+ }
+ return match
+}
+
+func newPipelineAdapter(opts *azcore.ClientOptions) pipelineAdapter {
+ pl := runtime.NewPipeline(component, version, runtime.PipelineOptions{}, opts)
+ return pipelineAdapter{pl: pl}
+}
+
+type pipelineAdapter struct {
+ pl runtime.Pipeline
+}
+
+func (p pipelineAdapter) CloseIdleConnections() {
+ // do nothing
+}
+
+func (p pipelineAdapter) Do(r *http.Request) (*http.Response, error) {
+ req, err := runtime.NewRequest(r.Context(), r.Method, r.URL.String())
+ if err != nil {
+ return nil, err
+ }
+ if r.Body != nil && r.Body != http.NoBody {
+ // create a rewindable body from the existing body as required
+ var body io.ReadSeekCloser
+ if rsc, ok := r.Body.(io.ReadSeekCloser); ok {
+ body = rsc
+ } else {
+ b, err := io.ReadAll(r.Body)
+ if err != nil {
+ return nil, err
+ }
+ body = streaming.NopCloser(bytes.NewReader(b))
+ }
+ err = req.SetBody(body, r.Header.Get("Content-Type"))
+ if err != nil {
+ return nil, err
+ }
+ }
+ resp, err := p.pl.Do(req)
+ if err != nil {
+ return nil, err
+ }
+ return resp, err
+}
+
+// enables fakes for test scenarios
+type msalConfidentialClient interface {
+ AcquireTokenSilent(ctx context.Context, scopes []string, options ...confidential.AcquireSilentOption) (confidential.AuthResult, error)
+ AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...confidential.AcquireByAuthCodeOption) (confidential.AuthResult, error)
+ AcquireTokenByCredential(ctx context.Context, scopes []string, options ...confidential.AcquireByCredentialOption) (confidential.AuthResult, error)
+ AcquireTokenOnBehalfOf(ctx context.Context, userAssertion string, scopes []string, options ...confidential.AcquireOnBehalfOfOption) (confidential.AuthResult, error)
+}
+
+// enables fakes for test scenarios
+type msalPublicClient interface {
+ AcquireTokenSilent(ctx context.Context, scopes []string, options ...public.AcquireSilentOption) (public.AuthResult, error)
+ AcquireTokenByUsernamePassword(ctx context.Context, scopes []string, username string, password string, options ...public.AcquireByUsernamePasswordOption) (public.AuthResult, error)
+ AcquireTokenByDeviceCode(ctx context.Context, scopes []string, options ...public.AcquireByDeviceCodeOption) (public.DeviceCode, error)
+ AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...public.AcquireByAuthCodeOption) (public.AuthResult, error)
+ AcquireTokenInteractive(ctx context.Context, scopes []string, options ...public.AcquireInteractiveOption) (public.AuthResult, error)
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go
new file mode 100644
index 000000000..55a0d6543
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go
@@ -0,0 +1,183 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "os"
+ "os/exec"
+ "regexp"
+ "runtime"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
+)
+
+const (
+ credNameAzureCLI = "AzureCLICredential"
+ timeoutCLIRequest = 10 * time.Second
+)
+
+// used by tests to fake invoking the CLI
+type azureCLITokenProvider func(ctx context.Context, resource string, tenantID string) ([]byte, error)
+
+// AzureCLICredentialOptions contains optional parameters for AzureCLICredential.
+type AzureCLICredentialOptions struct {
+ // AdditionallyAllowedTenants specifies tenants for which the credential may acquire tokens, in addition
+ // to TenantID. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the
+ // logged in account can access.
+ AdditionallyAllowedTenants []string
+ // TenantID identifies the tenant the credential should authenticate in.
+ // Defaults to the CLI's default tenant, which is typically the home tenant of the logged in user.
+ TenantID string
+
+ tokenProvider azureCLITokenProvider
+}
+
+// init returns an instance of AzureCLICredentialOptions initialized with default values.
+func (o *AzureCLICredentialOptions) init() {
+ if o.tokenProvider == nil {
+ o.tokenProvider = defaultTokenProvider
+ }
+}
+
+// AzureCLICredential authenticates as the identity logged in to the Azure CLI.
+type AzureCLICredential struct {
+ mu *sync.Mutex
+ opts AzureCLICredentialOptions
+}
+
+// NewAzureCLICredential constructs an AzureCLICredential. Pass nil to accept default options.
+func NewAzureCLICredential(options *AzureCLICredentialOptions) (*AzureCLICredential, error) {
+ cp := AzureCLICredentialOptions{}
+ if options != nil {
+ cp = *options
+ }
+ cp.init()
+ cp.AdditionallyAllowedTenants = resolveAdditionalTenants(cp.AdditionallyAllowedTenants)
+ return &AzureCLICredential{mu: &sync.Mutex{}, opts: cp}, nil
+}
+
+// GetToken requests a token from the Azure CLI. This credential doesn't cache tokens, so every call invokes the CLI.
+// This method is called automatically by Azure SDK clients.
+func (c *AzureCLICredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ if len(opts.Scopes) != 1 {
+ return azcore.AccessToken{}, errors.New(credNameAzureCLI + ": GetToken() requires exactly one scope")
+ }
+ tenant, err := resolveTenant(c.opts.TenantID, opts.TenantID, credNameAzureCLI, c.opts.AdditionallyAllowedTenants)
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+ // pass the CLI an AAD v1 resource because we don't know which CLI version is installed and older ones don't support v2 scopes
+ opts.Scopes = []string{strings.TrimSuffix(opts.Scopes[0], defaultSuffix)}
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ b, err := c.opts.tokenProvider(ctx, opts.Scopes[0], tenant)
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+ at, err := c.createAccessToken(b)
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+ msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", credNameAzureCLI, strings.Join(opts.Scopes, ", "))
+ log.Write(EventAuthentication, msg)
+ return at, nil
+}
+
+var defaultTokenProvider azureCLITokenProvider = func(ctx context.Context, resource string, tenantID string) ([]byte, error) {
+ match, err := regexp.MatchString("^[0-9a-zA-Z-.:/]+$", resource)
+ if err != nil {
+ return nil, err
+ }
+ if !match {
+ return nil, fmt.Errorf(`%s: unexpected scope "%s". Only alphanumeric characters and ".", ";", "-", and "/" are allowed`, credNameAzureCLI, resource)
+ }
+
+ // set a default timeout for this authentication iff the application hasn't done so already
+ var cancel context.CancelFunc
+ if _, hasDeadline := ctx.Deadline(); !hasDeadline {
+ ctx, cancel = context.WithTimeout(ctx, timeoutCLIRequest)
+ defer cancel()
+ }
+
+ commandLine := "az account get-access-token -o json --resource " + resource
+ if tenantID != "" {
+ commandLine += " --tenant " + tenantID
+ }
+ var cliCmd *exec.Cmd
+ if runtime.GOOS == "windows" {
+ dir := os.Getenv("SYSTEMROOT")
+ if dir == "" {
+ return nil, newCredentialUnavailableError(credNameAzureCLI, "environment variable 'SYSTEMROOT' has no value")
+ }
+ cliCmd = exec.CommandContext(ctx, "cmd.exe", "/c", commandLine)
+ cliCmd.Dir = dir
+ } else {
+ cliCmd = exec.CommandContext(ctx, "/bin/sh", "-c", commandLine)
+ cliCmd.Dir = "/bin"
+ }
+ cliCmd.Env = os.Environ()
+ var stderr bytes.Buffer
+ cliCmd.Stderr = &stderr
+
+ output, err := cliCmd.Output()
+ if err != nil {
+ msg := stderr.String()
+ var exErr *exec.ExitError
+ if errors.As(err, &exErr) && exErr.ExitCode() == 127 || strings.HasPrefix(msg, "'az' is not recognized") {
+ msg = "Azure CLI not found on path"
+ }
+ if msg == "" {
+ msg = err.Error()
+ }
+ return nil, newCredentialUnavailableError(credNameAzureCLI, msg)
+ }
+
+ return output, nil
+}
+
+func (c *AzureCLICredential) createAccessToken(tk []byte) (azcore.AccessToken, error) {
+ t := struct {
+ AccessToken string `json:"accessToken"`
+ Authority string `json:"_authority"`
+ ClientID string `json:"_clientId"`
+ ExpiresOn string `json:"expiresOn"`
+ IdentityProvider string `json:"identityProvider"`
+ IsMRRT bool `json:"isMRRT"`
+ RefreshToken string `json:"refreshToken"`
+ Resource string `json:"resource"`
+ TokenType string `json:"tokenType"`
+ UserID string `json:"userId"`
+ }{}
+ err := json.Unmarshal(tk, &t)
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+
+ // the Azure CLI's "expiresOn" is local time
+ exp, err := time.ParseInLocation("2006-01-02 15:04:05.999999", t.ExpiresOn, time.Local)
+ if err != nil {
+ return azcore.AccessToken{}, fmt.Errorf("Error parsing token expiration time %q: %v", t.ExpiresOn, err)
+ }
+
+ converted := azcore.AccessToken{
+ Token: t.AccessToken,
+ ExpiresOn: exp.UTC(),
+ }
+ return converted, nil
+}
+
+var _ azcore.TokenCredential = (*AzureCLICredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go
new file mode 100644
index 000000000..dc855edf7
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go
@@ -0,0 +1,138 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "strings"
+ "sync"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
+)
+
+// ChainedTokenCredentialOptions contains optional parameters for ChainedTokenCredential.
+type ChainedTokenCredentialOptions struct {
+ // RetrySources configures how the credential uses its sources. When true, the credential always attempts to
+ // authenticate through each source in turn, stopping when one succeeds. When false, the credential authenticates
+ // only through this first successful source--it never again tries the sources which failed.
+ RetrySources bool
+}
+
+// ChainedTokenCredential links together multiple credentials and tries them sequentially when authenticating. By default,
+// it tries all the credentials until one authenticates, after which it always uses that credential.
+type ChainedTokenCredential struct {
+ cond *sync.Cond
+ iterating bool
+ name string
+ retrySources bool
+ sources []azcore.TokenCredential
+ successfulCredential azcore.TokenCredential
+}
+
+// NewChainedTokenCredential creates a ChainedTokenCredential. Pass nil for options to accept defaults.
+func NewChainedTokenCredential(sources []azcore.TokenCredential, options *ChainedTokenCredentialOptions) (*ChainedTokenCredential, error) {
+ if len(sources) == 0 {
+ return nil, errors.New("sources must contain at least one TokenCredential")
+ }
+ for _, source := range sources {
+ if source == nil { // cannot have a nil credential in the chain or else the application will panic when GetToken() is called on nil
+ return nil, errors.New("sources cannot contain nil")
+ }
+ }
+ cp := make([]azcore.TokenCredential, len(sources))
+ copy(cp, sources)
+ if options == nil {
+ options = &ChainedTokenCredentialOptions{}
+ }
+ return &ChainedTokenCredential{
+ cond: sync.NewCond(&sync.Mutex{}),
+ name: "ChainedTokenCredential",
+ retrySources: options.RetrySources,
+ sources: cp,
+ }, nil
+}
+
+// GetToken calls GetToken on the chained credentials in turn, stopping when one returns a token.
+// This method is called automatically by Azure SDK clients.
+func (c *ChainedTokenCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ if !c.retrySources {
+ // ensure only one goroutine at a time iterates the sources and perhaps sets c.successfulCredential
+ c.cond.L.Lock()
+ for {
+ if c.successfulCredential != nil {
+ c.cond.L.Unlock()
+ return c.successfulCredential.GetToken(ctx, opts)
+ }
+ if !c.iterating {
+ c.iterating = true
+ // allow other goroutines to wait while this one iterates
+ c.cond.L.Unlock()
+ break
+ }
+ c.cond.Wait()
+ }
+ }
+
+ var (
+ err error
+ errs []error
+ successfulCredential azcore.TokenCredential
+ token azcore.AccessToken
+ unavailableErr *credentialUnavailableError
+ )
+ for _, cred := range c.sources {
+ token, err = cred.GetToken(ctx, opts)
+ if err == nil {
+ log.Writef(EventAuthentication, "%s authenticated with %s", c.name, extractCredentialName(cred))
+ successfulCredential = cred
+ break
+ }
+ errs = append(errs, err)
+ // continue to the next source iff this one returned credentialUnavailableError
+ if !errors.As(err, &unavailableErr) {
+ break
+ }
+ }
+ if c.iterating {
+ c.cond.L.Lock()
+ // this is nil when all credentials returned an error
+ c.successfulCredential = successfulCredential
+ c.iterating = false
+ c.cond.L.Unlock()
+ c.cond.Broadcast()
+ }
+ // err is the error returned by the last GetToken call. It will be nil when that call succeeds
+ if err != nil {
+ // return credentialUnavailableError iff all sources did so; return AuthenticationFailedError otherwise
+ msg := createChainedErrorMessage(errs)
+ if errors.As(err, &unavailableErr) {
+ err = newCredentialUnavailableError(c.name, msg)
+ } else {
+ res := getResponseFromError(err)
+ err = newAuthenticationFailedError(c.name, msg, res, err)
+ }
+ }
+ return token, err
+}
+
+func createChainedErrorMessage(errs []error) string {
+ msg := "failed to acquire a token.\nAttempted credentials:"
+ for _, err := range errs {
+ msg += fmt.Sprintf("\n\t%s", err.Error())
+ }
+ return msg
+}
+
+func extractCredentialName(credential azcore.TokenCredential) string {
+ return strings.TrimPrefix(fmt.Sprintf("%T", credential), "*azidentity.")
+}
+
+var _ azcore.TokenCredential = (*ChainedTokenCredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml
new file mode 100644
index 000000000..9002ea0b0
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml
@@ -0,0 +1,34 @@
+# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
+trigger:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/azidentity/
+
+pr:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/azidentity/
+
+stages:
+- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
+ parameters:
+ RunLiveTests: true
+ ServiceDirectory: 'azidentity'
+ CloudConfig:
+ Public:
+ SubscriptionConfigurations:
+ - $(sub-config-azure-cloud-test-resources)
+ # Contains alternate tenant, AAD app and cert info for testing
+ - $(sub-config-identity-test-resources)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go
new file mode 100644
index 000000000..303d5fc09
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go
@@ -0,0 +1,75 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "errors"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
+)
+
+const credNameAssertion = "ClientAssertionCredential"
+
+// ClientAssertionCredential authenticates an application with assertions provided by a callback function.
+// This credential is for advanced scenarios. [ClientCertificateCredential] has a more convenient API for
+// the most common assertion scenario, authenticating a service principal with a certificate. See
+// [Azure AD documentation] for details of the assertion format.
+//
+// [Azure AD documentation]: https://docs.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials#assertion-format
+type ClientAssertionCredential struct {
+ client *confidentialClient
+}
+
+// ClientAssertionCredentialOptions contains optional parameters for ClientAssertionCredential.
+type ClientAssertionCredentialOptions struct {
+ azcore.ClientOptions
+
+ // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens.
+ // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the
+ // application is registered.
+ AdditionallyAllowedTenants []string
+ // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
+ // private clouds such as Azure Stack. It determines whether the credential requests Azure AD instance metadata
+ // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
+ // the application responsible for ensuring the configured authority is valid and trustworthy.
+ DisableInstanceDiscovery bool
+}
+
+// NewClientAssertionCredential constructs a ClientAssertionCredential. The getAssertion function must be thread safe. Pass nil for options to accept defaults.
+func NewClientAssertionCredential(tenantID, clientID string, getAssertion func(context.Context) (string, error), options *ClientAssertionCredentialOptions) (*ClientAssertionCredential, error) {
+ if getAssertion == nil {
+ return nil, errors.New("getAssertion must be a function that returns assertions")
+ }
+ if options == nil {
+ options = &ClientAssertionCredentialOptions{}
+ }
+ cred := confidential.NewCredFromAssertionCallback(
+ func(ctx context.Context, _ confidential.AssertionRequestOptions) (string, error) {
+ return getAssertion(ctx)
+ },
+ )
+ msalOpts := confidentialClientOptions{
+ AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ }
+ c, err := newConfidentialClient(tenantID, clientID, credNameAssertion, cred, msalOpts)
+ if err != nil {
+ return nil, err
+ }
+ return &ClientAssertionCredential{client: c}, nil
+}
+
+// GetToken requests an access token from Azure Active Directory. This method is called automatically by Azure SDK clients.
+func (c *ClientAssertionCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ return c.client.GetToken(ctx, opts)
+}
+
+var _ azcore.TokenCredential = (*ClientAssertionCredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go
new file mode 100644
index 000000000..d3300e305
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go
@@ -0,0 +1,160 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "crypto"
+ "crypto/x509"
+ "encoding/pem"
+ "errors"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
+ "golang.org/x/crypto/pkcs12"
+)
+
+const credNameCert = "ClientCertificateCredential"
+
+// ClientCertificateCredentialOptions contains optional parameters for ClientCertificateCredential.
+type ClientCertificateCredentialOptions struct {
+ azcore.ClientOptions
+
+ // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens.
+ // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the
+ // application is registered.
+ AdditionallyAllowedTenants []string
+ // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
+ // private clouds such as Azure Stack. It determines whether the credential requests Azure AD instance metadata
+ // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
+ // the application responsible for ensuring the configured authority is valid and trustworthy.
+ DisableInstanceDiscovery bool
+ // SendCertificateChain controls whether the credential sends the public certificate chain in the x5c
+ // header of each token request's JWT. This is required for Subject Name/Issuer (SNI) authentication.
+ // Defaults to False.
+ SendCertificateChain bool
+}
+
+// ClientCertificateCredential authenticates a service principal with a certificate.
+type ClientCertificateCredential struct {
+ client *confidentialClient
+}
+
+// NewClientCertificateCredential constructs a ClientCertificateCredential. Pass nil for options to accept defaults.
+func NewClientCertificateCredential(tenantID string, clientID string, certs []*x509.Certificate, key crypto.PrivateKey, options *ClientCertificateCredentialOptions) (*ClientCertificateCredential, error) {
+ if len(certs) == 0 {
+ return nil, errors.New("at least one certificate is required")
+ }
+ if options == nil {
+ options = &ClientCertificateCredentialOptions{}
+ }
+ cred, err := confidential.NewCredFromCert(certs, key)
+ if err != nil {
+ return nil, err
+ }
+ msalOpts := confidentialClientOptions{
+ AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ SendX5C: options.SendCertificateChain,
+ }
+ c, err := newConfidentialClient(tenantID, clientID, credNameCert, cred, msalOpts)
+ if err != nil {
+ return nil, err
+ }
+ return &ClientCertificateCredential{client: c}, nil
+}
+
+// GetToken requests an access token from Azure Active Directory. This method is called automatically by Azure SDK clients.
+func (c *ClientCertificateCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ return c.client.GetToken(ctx, opts)
+}
+
+// ParseCertificates loads certificates and a private key, in PEM or PKCS12 format, for use with NewClientCertificateCredential.
+// Pass nil for password if the private key isn't encrypted. This function can't decrypt keys in PEM format.
+func ParseCertificates(certData []byte, password []byte) ([]*x509.Certificate, crypto.PrivateKey, error) {
+ var blocks []*pem.Block
+ var err error
+ if len(password) == 0 {
+ blocks, err = loadPEMCert(certData)
+ }
+ if len(blocks) == 0 || err != nil {
+ blocks, err = loadPKCS12Cert(certData, string(password))
+ }
+ if err != nil {
+ return nil, nil, err
+ }
+ var certs []*x509.Certificate
+ var pk crypto.PrivateKey
+ for _, block := range blocks {
+ switch block.Type {
+ case "CERTIFICATE":
+ c, err := x509.ParseCertificate(block.Bytes)
+ if err != nil {
+ return nil, nil, err
+ }
+ certs = append(certs, c)
+ case "PRIVATE KEY":
+ if pk != nil {
+ return nil, nil, errors.New("certData contains multiple private keys")
+ }
+ pk, err = x509.ParsePKCS8PrivateKey(block.Bytes)
+ if err != nil {
+ pk, err = x509.ParsePKCS1PrivateKey(block.Bytes)
+ }
+ if err != nil {
+ return nil, nil, err
+ }
+ case "RSA PRIVATE KEY":
+ if pk != nil {
+ return nil, nil, errors.New("certData contains multiple private keys")
+ }
+ pk, err = x509.ParsePKCS1PrivateKey(block.Bytes)
+ if err != nil {
+ return nil, nil, err
+ }
+ }
+ }
+ if len(certs) == 0 {
+ return nil, nil, errors.New("found no certificate")
+ }
+ if pk == nil {
+ return nil, nil, errors.New("found no private key")
+ }
+ return certs, pk, nil
+}
+
+func loadPEMCert(certData []byte) ([]*pem.Block, error) {
+ blocks := []*pem.Block{}
+ for {
+ var block *pem.Block
+ block, certData = pem.Decode(certData)
+ if block == nil {
+ break
+ }
+ blocks = append(blocks, block)
+ }
+ if len(blocks) == 0 {
+ return nil, errors.New("didn't find any PEM blocks")
+ }
+ return blocks, nil
+}
+
+func loadPKCS12Cert(certData []byte, password string) ([]*pem.Block, error) {
+ blocks, err := pkcs12.ToPEM(certData, password)
+ if err != nil {
+ return nil, err
+ }
+ if len(blocks) == 0 {
+ // not mentioning PKCS12 in this message because we end up here when certData is garbage
+ return nil, errors.New("didn't find any certificate content")
+ }
+ return blocks, err
+}
+
+var _ azcore.TokenCredential = (*ClientCertificateCredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go
new file mode 100644
index 000000000..d2ff7582b
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go
@@ -0,0 +1,65 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
+)
+
+const credNameSecret = "ClientSecretCredential"
+
+// ClientSecretCredentialOptions contains optional parameters for ClientSecretCredential.
+type ClientSecretCredentialOptions struct {
+ azcore.ClientOptions
+
+ // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens.
+ // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the
+ // application is registered.
+ AdditionallyAllowedTenants []string
+ // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
+ // private clouds such as Azure Stack. It determines whether the credential requests Azure AD instance metadata
+ // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
+ // the application responsible for ensuring the configured authority is valid and trustworthy.
+ DisableInstanceDiscovery bool
+}
+
+// ClientSecretCredential authenticates an application with a client secret.
+type ClientSecretCredential struct {
+ client *confidentialClient
+}
+
+// NewClientSecretCredential constructs a ClientSecretCredential. Pass nil for options to accept defaults.
+func NewClientSecretCredential(tenantID string, clientID string, clientSecret string, options *ClientSecretCredentialOptions) (*ClientSecretCredential, error) {
+ if options == nil {
+ options = &ClientSecretCredentialOptions{}
+ }
+ cred, err := confidential.NewCredFromSecret(clientSecret)
+ if err != nil {
+ return nil, err
+ }
+ msalOpts := confidentialClientOptions{
+ AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ }
+ c, err := newConfidentialClient(tenantID, clientID, credNameSecret, cred, msalOpts)
+ if err != nil {
+ return nil, err
+ }
+ return &ClientSecretCredential{c}, nil
+}
+
+// GetToken requests an access token from Azure Active Directory. This method is called automatically by Azure SDK clients.
+func (c *ClientSecretCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ return c.client.GetToken(ctx, opts)
+}
+
+var _ azcore.TokenCredential = (*ClientSecretCredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go
new file mode 100644
index 000000000..4853a9a00
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go
@@ -0,0 +1,156 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "os"
+ "strings"
+ "sync"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
+)
+
+type confidentialClientOptions struct {
+ azcore.ClientOptions
+
+ AdditionallyAllowedTenants []string
+ // Assertion for on-behalf-of authentication
+ Assertion string
+ DisableInstanceDiscovery, SendX5C bool
+}
+
+// confidentialClient wraps the MSAL confidential client
+type confidentialClient struct {
+ cae, noCAE msalConfidentialClient
+ caeMu, noCAEMu, clientMu *sync.Mutex
+ clientID, tenantID string
+ cred confidential.Credential
+ host string
+ name string
+ opts confidentialClientOptions
+ region string
+}
+
+func newConfidentialClient(tenantID, clientID, name string, cred confidential.Credential, opts confidentialClientOptions) (*confidentialClient, error) {
+ if !validTenantID(tenantID) {
+ return nil, errInvalidTenantID
+ }
+ host, err := setAuthorityHost(opts.Cloud)
+ if err != nil {
+ return nil, err
+ }
+ opts.AdditionallyAllowedTenants = resolveAdditionalTenants(opts.AdditionallyAllowedTenants)
+ return &confidentialClient{
+ caeMu: &sync.Mutex{},
+ clientID: clientID,
+ clientMu: &sync.Mutex{},
+ cred: cred,
+ host: host,
+ name: name,
+ noCAEMu: &sync.Mutex{},
+ opts: opts,
+ region: os.Getenv(azureRegionalAuthorityName),
+ tenantID: tenantID,
+ }, nil
+}
+
+// GetToken requests an access token from MSAL, checking the cache first.
+func (c *confidentialClient) GetToken(ctx context.Context, tro policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ if len(tro.Scopes) < 1 {
+ return azcore.AccessToken{}, fmt.Errorf("%s.GetToken() requires at least one scope", c.name)
+ }
+ // we don't resolve the tenant for managed identities because they acquire tokens only from their home tenants
+ if c.name != credNameManagedIdentity {
+ tenant, err := c.resolveTenant(tro.TenantID)
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+ tro.TenantID = tenant
+ }
+ client, mu, err := c.client(ctx, tro)
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+ mu.Lock()
+ defer mu.Unlock()
+ var ar confidential.AuthResult
+ if c.opts.Assertion != "" {
+ ar, err = client.AcquireTokenOnBehalfOf(ctx, c.opts.Assertion, tro.Scopes, confidential.WithClaims(tro.Claims), confidential.WithTenantID(tro.TenantID))
+ } else {
+ ar, err = client.AcquireTokenSilent(ctx, tro.Scopes, confidential.WithClaims(tro.Claims), confidential.WithTenantID(tro.TenantID))
+ if err != nil {
+ ar, err = client.AcquireTokenByCredential(ctx, tro.Scopes, confidential.WithClaims(tro.Claims), confidential.WithTenantID(tro.TenantID))
+ }
+ }
+ if err != nil {
+ // We could get a credentialUnavailableError from managed identity authentication because in that case the error comes from our code.
+ // We return it directly because it affects the behavior of credential chains. Otherwise, we return AuthenticationFailedError.
+ var unavailableErr *credentialUnavailableError
+ if !errors.As(err, &unavailableErr) {
+ res := getResponseFromError(err)
+ err = newAuthenticationFailedError(c.name, err.Error(), res, err)
+ }
+ } else {
+ msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", c.name, strings.Join(ar.GrantedScopes, ", "))
+ log.Write(EventAuthentication, msg)
+ }
+ return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC()}, err
+}
+
+func (c *confidentialClient) client(ctx context.Context, tro policy.TokenRequestOptions) (msalConfidentialClient, *sync.Mutex, error) {
+ c.clientMu.Lock()
+ defer c.clientMu.Unlock()
+ if tro.EnableCAE {
+ if c.cae == nil {
+ client, err := c.newMSALClient(true)
+ if err != nil {
+ return nil, nil, err
+ }
+ c.cae = client
+ }
+ return c.cae, c.caeMu, nil
+ }
+ if c.noCAE == nil {
+ client, err := c.newMSALClient(false)
+ if err != nil {
+ return nil, nil, err
+ }
+ c.noCAE = client
+ }
+ return c.noCAE, c.noCAEMu, nil
+}
+
+func (c *confidentialClient) newMSALClient(enableCAE bool) (msalConfidentialClient, error) {
+ authority := runtime.JoinPaths(c.host, c.tenantID)
+ o := []confidential.Option{
+ confidential.WithAzureRegion(c.region),
+ confidential.WithHTTPClient(newPipelineAdapter(&c.opts.ClientOptions)),
+ }
+ if enableCAE {
+ o = append(o, confidential.WithClientCapabilities(cp1))
+ }
+ if c.opts.SendX5C {
+ o = append(o, confidential.WithX5C())
+ }
+ if c.opts.DisableInstanceDiscovery || strings.ToLower(c.tenantID) == "adfs" {
+ o = append(o, confidential.WithInstanceDiscovery(false))
+ }
+ return confidential.New(authority, c.clientID, c.cred, o...)
+}
+
+// resolveTenant returns the correct tenant for a token request given the client's
+// configuration, or an error when that configuration doesn't allow the specified tenant
+func (c *confidentialClient) resolveTenant(specified string) (string, error) {
+ return resolveTenant(c.tenantID, specified, c.name, c.opts.AdditionallyAllowedTenants)
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go
new file mode 100644
index 000000000..7647c60b1
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go
@@ -0,0 +1,196 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "errors"
+ "os"
+ "strings"
+ "time"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
+)
+
+// DefaultAzureCredentialOptions contains optional parameters for DefaultAzureCredential.
+// These options may not apply to all credentials in the chain.
+type DefaultAzureCredentialOptions struct {
+ // ClientOptions has additional options for credentials that use an Azure SDK HTTP pipeline. These options don't apply
+ // to credential types that authenticate via external tools such as the Azure CLI.
+ azcore.ClientOptions
+
+ // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens. Add
+ // the wildcard value "*" to allow the credential to acquire tokens for any tenant. This value can also be
+ // set as a semicolon delimited list of tenants in the environment variable AZURE_ADDITIONALLY_ALLOWED_TENANTS.
+ AdditionallyAllowedTenants []string
+ // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
+ // private clouds such as Azure Stack. It determines whether the credential requests Azure AD instance metadata
+ // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
+ // the application responsible for ensuring the configured authority is valid and trustworthy.
+ DisableInstanceDiscovery bool
+ // TenantID sets the default tenant for authentication via the Azure CLI and workload identity.
+ TenantID string
+}
+
+// DefaultAzureCredential is a default credential chain for applications that will deploy to Azure.
+// It combines credentials suitable for deployment with credentials suitable for local development.
+// It attempts to authenticate with each of these credential types, in the following order, stopping
+// when one provides a token:
+//
+// - [EnvironmentCredential]
+// - [WorkloadIdentityCredential], if environment variable configuration is set by the Azure workload
+// identity webhook. Use [WorkloadIdentityCredential] directly when not using the webhook or needing
+// more control over its configuration.
+// - [ManagedIdentityCredential]
+// - [AzureCLICredential]
+//
+// Consult the documentation for these credential types for more information on how they authenticate.
+// Once a credential has successfully authenticated, DefaultAzureCredential will use that credential for
+// every subsequent authentication.
+type DefaultAzureCredential struct {
+ chain *ChainedTokenCredential
+}
+
+// NewDefaultAzureCredential creates a DefaultAzureCredential. Pass nil for options to accept defaults.
+func NewDefaultAzureCredential(options *DefaultAzureCredentialOptions) (*DefaultAzureCredential, error) {
+ var creds []azcore.TokenCredential
+ var errorMessages []string
+
+ if options == nil {
+ options = &DefaultAzureCredentialOptions{}
+ }
+ additionalTenants := options.AdditionallyAllowedTenants
+ if len(additionalTenants) == 0 {
+ if tenants := os.Getenv(azureAdditionallyAllowedTenants); tenants != "" {
+ additionalTenants = strings.Split(tenants, ";")
+ }
+ }
+
+ envCred, err := NewEnvironmentCredential(&EnvironmentCredentialOptions{
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ additionallyAllowedTenants: additionalTenants,
+ })
+ if err == nil {
+ creds = append(creds, envCred)
+ } else {
+ errorMessages = append(errorMessages, "EnvironmentCredential: "+err.Error())
+ creds = append(creds, &defaultCredentialErrorReporter{credType: "EnvironmentCredential", err: err})
+ }
+
+ wic, err := NewWorkloadIdentityCredential(&WorkloadIdentityCredentialOptions{
+ AdditionallyAllowedTenants: additionalTenants,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ TenantID: options.TenantID,
+ })
+ if err == nil {
+ creds = append(creds, wic)
+ } else {
+ errorMessages = append(errorMessages, credNameWorkloadIdentity+": "+err.Error())
+ creds = append(creds, &defaultCredentialErrorReporter{credType: credNameWorkloadIdentity, err: err})
+ }
+
+ o := &ManagedIdentityCredentialOptions{ClientOptions: options.ClientOptions}
+ if ID, ok := os.LookupEnv(azureClientID); ok {
+ o.ID = ClientID(ID)
+ }
+ miCred, err := NewManagedIdentityCredential(o)
+ if err == nil {
+ creds = append(creds, &timeoutWrapper{mic: miCred, timeout: time.Second})
+ } else {
+ errorMessages = append(errorMessages, credNameManagedIdentity+": "+err.Error())
+ creds = append(creds, &defaultCredentialErrorReporter{credType: credNameManagedIdentity, err: err})
+ }
+
+ cliCred, err := NewAzureCLICredential(&AzureCLICredentialOptions{AdditionallyAllowedTenants: additionalTenants, TenantID: options.TenantID})
+ if err == nil {
+ creds = append(creds, cliCred)
+ } else {
+ errorMessages = append(errorMessages, credNameAzureCLI+": "+err.Error())
+ creds = append(creds, &defaultCredentialErrorReporter{credType: credNameAzureCLI, err: err})
+ }
+
+ if len(errorMessages) > 0 {
+ log.Writef(EventAuthentication, "NewDefaultAzureCredential failed to initialize some credentials:\n\t%s", strings.Join(errorMessages, "\n\t"))
+ }
+
+ chain, err := NewChainedTokenCredential(creds, nil)
+ if err != nil {
+ return nil, err
+ }
+ chain.name = "DefaultAzureCredential"
+ return &DefaultAzureCredential{chain: chain}, nil
+}
+
+// GetToken requests an access token from Azure Active Directory. This method is called automatically by Azure SDK clients.
+func (c *DefaultAzureCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ return c.chain.GetToken(ctx, opts)
+}
+
+var _ azcore.TokenCredential = (*DefaultAzureCredential)(nil)
+
+// defaultCredentialErrorReporter is a substitute for credentials that couldn't be constructed.
+// Its GetToken method always returns a credentialUnavailableError having the same message as
+// the error that prevented constructing the credential. This ensures the message is present
+// in the error returned by ChainedTokenCredential.GetToken()
+type defaultCredentialErrorReporter struct {
+ credType string
+ err error
+}
+
+func (d *defaultCredentialErrorReporter) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ if _, ok := d.err.(*credentialUnavailableError); ok {
+ return azcore.AccessToken{}, d.err
+ }
+ return azcore.AccessToken{}, newCredentialUnavailableError(d.credType, d.err.Error())
+}
+
+var _ azcore.TokenCredential = (*defaultCredentialErrorReporter)(nil)
+
+// timeoutWrapper prevents a potentially very long timeout when managed identity isn't available
+type timeoutWrapper struct {
+ mic *ManagedIdentityCredential
+ // timeout applies to all auth attempts until one doesn't time out
+ timeout time.Duration
+}
+
+// GetToken wraps DefaultAzureCredential's initial managed identity auth attempt with a short timeout
+// because managed identity may not be available and connecting to IMDS can take several minutes to time out.
+func (w *timeoutWrapper) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ var tk azcore.AccessToken
+ var err error
+ // no need to synchronize around this value because it's written only within ChainedTokenCredential's critical section
+ if w.timeout > 0 {
+ c, cancel := context.WithTimeout(ctx, w.timeout)
+ defer cancel()
+ tk, err = w.mic.GetToken(c, opts)
+ if isAuthFailedDueToContext(err) {
+ err = newCredentialUnavailableError(credNameManagedIdentity, "managed identity timed out. See https://aka.ms/azsdk/go/identity/troubleshoot#dac for more information")
+ } else {
+ // some managed identity implementation is available, so don't apply the timeout to future calls
+ w.timeout = 0
+ }
+ } else {
+ tk, err = w.mic.GetToken(ctx, opts)
+ }
+ return tk, err
+}
+
+// unwraps nested AuthenticationFailedErrors to get the root error
+func isAuthFailedDueToContext(err error) bool {
+ for {
+ var authFailedErr *AuthenticationFailedError
+ if !errors.As(err, &authFailedErr) {
+ break
+ }
+ err = authFailedErr.err
+ }
+ return errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded)
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go
new file mode 100644
index 000000000..d245c269a
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go
@@ -0,0 +1,106 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+)
+
+const credNameDeviceCode = "DeviceCodeCredential"
+
+// DeviceCodeCredentialOptions contains optional parameters for DeviceCodeCredential.
+type DeviceCodeCredentialOptions struct {
+ azcore.ClientOptions
+
+ // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire
+ // tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant.
+ AdditionallyAllowedTenants []string
+ // ClientID is the ID of the application users will authenticate to.
+ // Defaults to the ID of an Azure development application.
+ ClientID string
+ // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
+ // private clouds such as Azure Stack. It determines whether the credential requests Azure AD instance metadata
+ // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
+ // the application responsible for ensuring the configured authority is valid and trustworthy.
+ DisableInstanceDiscovery bool
+ // TenantID is the Azure Active Directory tenant the credential authenticates in. Defaults to the
+ // "organizations" tenant, which can authenticate work and school accounts. Required for single-tenant
+ // applications.
+ TenantID string
+
+ // UserPrompt controls how the credential presents authentication instructions. The credential calls
+ // this function with authentication details when it receives a device code. By default, the credential
+ // prints these details to stdout.
+ UserPrompt func(context.Context, DeviceCodeMessage) error
+}
+
+func (o *DeviceCodeCredentialOptions) init() {
+ if o.TenantID == "" {
+ o.TenantID = organizationsTenantID
+ }
+ if o.ClientID == "" {
+ o.ClientID = developerSignOnClientID
+ }
+ if o.UserPrompt == nil {
+ o.UserPrompt = func(ctx context.Context, dc DeviceCodeMessage) error {
+ fmt.Println(dc.Message)
+ return nil
+ }
+ }
+}
+
+// DeviceCodeMessage contains the information a user needs to complete authentication.
+type DeviceCodeMessage struct {
+ // UserCode is the user code returned by the service.
+ UserCode string `json:"user_code"`
+ // VerificationURL is the URL at which the user must authenticate.
+ VerificationURL string `json:"verification_uri"`
+ // Message is user instruction from Azure Active Directory.
+ Message string `json:"message"`
+}
+
+// DeviceCodeCredential acquires tokens for a user via the device code flow, which has the
+// user browse to an Azure Active Directory URL, enter a code, and authenticate. It's useful
+// for authenticating a user in an environment without a web browser, such as an SSH session.
+// If a web browser is available, InteractiveBrowserCredential is more convenient because it
+// automatically opens a browser to the login page.
+type DeviceCodeCredential struct {
+ client *publicClient
+}
+
+// NewDeviceCodeCredential creates a DeviceCodeCredential. Pass nil to accept default options.
+func NewDeviceCodeCredential(options *DeviceCodeCredentialOptions) (*DeviceCodeCredential, error) {
+ cp := DeviceCodeCredentialOptions{}
+ if options != nil {
+ cp = *options
+ }
+ cp.init()
+ msalOpts := publicClientOptions{
+ AdditionallyAllowedTenants: cp.AdditionallyAllowedTenants,
+ ClientOptions: cp.ClientOptions,
+ DeviceCodePrompt: cp.UserPrompt,
+ DisableInstanceDiscovery: cp.DisableInstanceDiscovery,
+ }
+ c, err := newPublicClient(cp.TenantID, cp.ClientID, credNameDeviceCode, msalOpts)
+ if err != nil {
+ return nil, err
+ }
+ c.name = credNameDeviceCode
+ return &DeviceCodeCredential{client: c}, nil
+}
+
+// GetToken requests an access token from Azure Active Directory. It will begin the device code flow and poll until the user completes authentication.
+// This method is called automatically by Azure SDK clients.
+func (c *DeviceCodeCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ return c.client.GetToken(ctx, opts)
+}
+
+var _ azcore.TokenCredential = (*DeviceCodeCredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go
new file mode 100644
index 000000000..7ecd928e0
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go
@@ -0,0 +1,164 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "os"
+ "strings"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
+)
+
+const envVarSendCertChain = "AZURE_CLIENT_SEND_CERTIFICATE_CHAIN"
+
+// EnvironmentCredentialOptions contains optional parameters for EnvironmentCredential
+type EnvironmentCredentialOptions struct {
+ azcore.ClientOptions
+
+ // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
+ // private clouds such as Azure Stack. It determines whether the credential requests Azure AD instance metadata
+ // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
+ // the application responsible for ensuring the configured authority is valid and trustworthy.
+ DisableInstanceDiscovery bool
+ // additionallyAllowedTenants is used only by NewDefaultAzureCredential() to enable that constructor's explicit
+ // option to override the value of AZURE_ADDITIONALLY_ALLOWED_TENANTS. Applications using EnvironmentCredential
+ // directly should set that variable instead. This field should remain unexported to preserve this credential's
+ // unambiguous "all configuration from environment variables" design.
+ additionallyAllowedTenants []string
+}
+
+// EnvironmentCredential authenticates a service principal with a secret or certificate, or a user with a password, depending
+// on environment variable configuration. It reads configuration from these variables, in the following order:
+//
+// # Service principal with client secret
+//
+// AZURE_TENANT_ID: ID of the service principal's tenant. Also called its "directory" ID.
+//
+// AZURE_CLIENT_ID: the service principal's client ID
+//
+// AZURE_CLIENT_SECRET: one of the service principal's client secrets
+//
+// # Service principal with certificate
+//
+// AZURE_TENANT_ID: ID of the service principal's tenant. Also called its "directory" ID.
+//
+// AZURE_CLIENT_ID: the service principal's client ID
+//
+// AZURE_CLIENT_CERTIFICATE_PATH: path to a PEM or PKCS12 certificate file including the private key.
+//
+// AZURE_CLIENT_CERTIFICATE_PASSWORD: (optional) password for the certificate file.
+//
+// # User with username and password
+//
+// AZURE_TENANT_ID: (optional) tenant to authenticate in. Defaults to "organizations".
+//
+// AZURE_CLIENT_ID: client ID of the application the user will authenticate to
+//
+// AZURE_USERNAME: a username (usually an email address)
+//
+// AZURE_PASSWORD: the user's password
+//
+// # Configuration for multitenant applications
+//
+// To enable multitenant authentication, set AZURE_ADDITIONALLY_ALLOWED_TENANTS with a semicolon delimited list of tenants
+// the credential may request tokens from in addition to the tenant specified by AZURE_TENANT_ID. Set
+// AZURE_ADDITIONALLY_ALLOWED_TENANTS to "*" to enable the credential to request a token from any tenant.
+type EnvironmentCredential struct {
+ cred azcore.TokenCredential
+}
+
+// NewEnvironmentCredential creates an EnvironmentCredential. Pass nil to accept default options.
+func NewEnvironmentCredential(options *EnvironmentCredentialOptions) (*EnvironmentCredential, error) {
+ if options == nil {
+ options = &EnvironmentCredentialOptions{}
+ }
+ tenantID := os.Getenv(azureTenantID)
+ if tenantID == "" {
+ return nil, errors.New("missing environment variable AZURE_TENANT_ID")
+ }
+ clientID := os.Getenv(azureClientID)
+ if clientID == "" {
+ return nil, errors.New("missing environment variable " + azureClientID)
+ }
+ // tenants set by NewDefaultAzureCredential() override the value of AZURE_ADDITIONALLY_ALLOWED_TENANTS
+ additionalTenants := options.additionallyAllowedTenants
+ if len(additionalTenants) == 0 {
+ if tenants := os.Getenv(azureAdditionallyAllowedTenants); tenants != "" {
+ additionalTenants = strings.Split(tenants, ";")
+ }
+ }
+ if clientSecret := os.Getenv(azureClientSecret); clientSecret != "" {
+ log.Write(EventAuthentication, "EnvironmentCredential will authenticate with ClientSecretCredential")
+ o := &ClientSecretCredentialOptions{
+ AdditionallyAllowedTenants: additionalTenants,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ }
+ cred, err := NewClientSecretCredential(tenantID, clientID, clientSecret, o)
+ if err != nil {
+ return nil, err
+ }
+ return &EnvironmentCredential{cred: cred}, nil
+ }
+ if certPath := os.Getenv(azureClientCertificatePath); certPath != "" {
+ log.Write(EventAuthentication, "EnvironmentCredential will authenticate with ClientCertificateCredential")
+ certData, err := os.ReadFile(certPath)
+ if err != nil {
+ return nil, fmt.Errorf(`failed to read certificate file "%s": %v`, certPath, err)
+ }
+ var password []byte
+ if v := os.Getenv(azureClientCertificatePassword); v != "" {
+ password = []byte(v)
+ }
+ certs, key, err := ParseCertificates(certData, password)
+ if err != nil {
+ return nil, fmt.Errorf(`failed to load certificate from "%s": %v`, certPath, err)
+ }
+ o := &ClientCertificateCredentialOptions{
+ AdditionallyAllowedTenants: additionalTenants,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ }
+ if v, ok := os.LookupEnv(envVarSendCertChain); ok {
+ o.SendCertificateChain = v == "1" || strings.ToLower(v) == "true"
+ }
+ cred, err := NewClientCertificateCredential(tenantID, clientID, certs, key, o)
+ if err != nil {
+ return nil, err
+ }
+ return &EnvironmentCredential{cred: cred}, nil
+ }
+ if username := os.Getenv(azureUsername); username != "" {
+ if password := os.Getenv(azurePassword); password != "" {
+ log.Write(EventAuthentication, "EnvironmentCredential will authenticate with UsernamePasswordCredential")
+ o := &UsernamePasswordCredentialOptions{
+ AdditionallyAllowedTenants: additionalTenants,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ }
+ cred, err := NewUsernamePasswordCredential(tenantID, clientID, username, password, o)
+ if err != nil {
+ return nil, err
+ }
+ return &EnvironmentCredential{cred: cred}, nil
+ }
+ return nil, errors.New("no value for AZURE_PASSWORD")
+ }
+ return nil, errors.New("incomplete environment variable configuration. Only AZURE_TENANT_ID and AZURE_CLIENT_ID are set")
+}
+
+// GetToken requests an access token from Azure Active Directory. This method is called automatically by Azure SDK clients.
+func (c *EnvironmentCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ return c.cred.GetToken(ctx, opts)
+}
+
+var _ azcore.TokenCredential = (*EnvironmentCredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go
new file mode 100644
index 000000000..e1a21e003
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go
@@ -0,0 +1,128 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "bytes"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo"
+ msal "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
+)
+
+// getResponseFromError retrieves the response carried by
+// an AuthenticationFailedError or MSAL CallErr, if any
+func getResponseFromError(err error) *http.Response {
+ var a *AuthenticationFailedError
+ var c msal.CallErr
+ var res *http.Response
+ if errors.As(err, &c) {
+ res = c.Resp
+ } else if errors.As(err, &a) {
+ res = a.RawResponse
+ }
+ return res
+}
+
+// AuthenticationFailedError indicates an authentication request has failed.
+type AuthenticationFailedError struct {
+ // RawResponse is the HTTP response motivating the error, if available.
+ RawResponse *http.Response
+
+ credType string
+ message string
+ err error
+}
+
+func newAuthenticationFailedError(credType string, message string, resp *http.Response, err error) error {
+ return &AuthenticationFailedError{credType: credType, message: message, RawResponse: resp, err: err}
+}
+
+// Error implements the error interface. Note that the message contents are not contractual and can change over time.
+func (e *AuthenticationFailedError) Error() string {
+ if e.RawResponse == nil {
+ return e.credType + ": " + e.message
+ }
+ msg := &bytes.Buffer{}
+ fmt.Fprintf(msg, e.credType+" authentication failed\n")
+ fmt.Fprintf(msg, "%s %s://%s%s\n", e.RawResponse.Request.Method, e.RawResponse.Request.URL.Scheme, e.RawResponse.Request.URL.Host, e.RawResponse.Request.URL.Path)
+ fmt.Fprintln(msg, "--------------------------------------------------------------------------------")
+ fmt.Fprintf(msg, "RESPONSE %s\n", e.RawResponse.Status)
+ fmt.Fprintln(msg, "--------------------------------------------------------------------------------")
+ body, err := runtime.Payload(e.RawResponse)
+ switch {
+ case err != nil:
+ fmt.Fprintf(msg, "Error reading response body: %v", err)
+ case len(body) > 0:
+ if err := json.Indent(msg, body, "", " "); err != nil {
+ // failed to pretty-print so just dump it verbatim
+ fmt.Fprint(msg, string(body))
+ }
+ default:
+ fmt.Fprint(msg, "Response contained no body")
+ }
+ fmt.Fprintln(msg, "\n--------------------------------------------------------------------------------")
+ var anchor string
+ switch e.credType {
+ case credNameAzureCLI:
+ anchor = "azure-cli"
+ case credNameCert:
+ anchor = "client-cert"
+ case credNameSecret:
+ anchor = "client-secret"
+ case credNameManagedIdentity:
+ anchor = "managed-id"
+ case credNameUserPassword:
+ anchor = "username-password"
+ case credNameWorkloadIdentity:
+ anchor = "workload"
+ }
+ if anchor != "" {
+ fmt.Fprintf(msg, "To troubleshoot, visit https://aka.ms/azsdk/go/identity/troubleshoot#%s", anchor)
+ }
+ return msg.String()
+}
+
+// NonRetriable indicates the request which provoked this error shouldn't be retried.
+func (*AuthenticationFailedError) NonRetriable() {
+ // marker method
+}
+
+var _ errorinfo.NonRetriable = (*AuthenticationFailedError)(nil)
+
+// credentialUnavailableError indicates a credential can't attempt authentication because it lacks required
+// data or state
+type credentialUnavailableError struct {
+ message string
+}
+
+// newCredentialUnavailableError is an internal helper that ensures consistent error message formatting
+func newCredentialUnavailableError(credType, message string) error {
+ msg := fmt.Sprintf("%s: %s", credType, message)
+ return &credentialUnavailableError{msg}
+}
+
+// NewCredentialUnavailableError constructs an error indicating a credential can't attempt authentication
+// because it lacks required data or state. When [ChainedTokenCredential] receives this error it will try
+// its next credential, if any.
+func NewCredentialUnavailableError(message string) error {
+ return &credentialUnavailableError{message}
+}
+
+// Error implements the error interface. Note that the message contents are not contractual and can change over time.
+func (e *credentialUnavailableError) Error() string {
+ return e.message
+}
+
+// NonRetriable is a marker method indicating this error should not be retried. It has no implementation.
+func (e *credentialUnavailableError) NonRetriable() {}
+
+var _ errorinfo.NonRetriable = (*credentialUnavailableError)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go
new file mode 100644
index 000000000..08f3efbf3
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go
@@ -0,0 +1,86 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+)
+
+const credNameBrowser = "InteractiveBrowserCredential"
+
+// InteractiveBrowserCredentialOptions contains optional parameters for InteractiveBrowserCredential.
+type InteractiveBrowserCredentialOptions struct {
+ azcore.ClientOptions
+
+ // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire
+ // tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant.
+ AdditionallyAllowedTenants []string
+ // ClientID is the ID of the application users will authenticate to.
+ // Defaults to the ID of an Azure development application.
+ ClientID string
+
+ // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
+ // private clouds such as Azure Stack. It determines whether the credential requests Azure AD instance metadata
+ // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
+ // the application responsible for ensuring the configured authority is valid and trustworthy.
+ DisableInstanceDiscovery bool
+
+ // LoginHint pre-populates the account prompt with a username. Users may choose to authenticate a different account.
+ LoginHint string
+ // RedirectURL is the URL Azure Active Directory will redirect to with the access token. This is required
+ // only when setting ClientID, and must match a redirect URI in the application's registration.
+ // Applications which have registered "http://localhost" as a redirect URI need not set this option.
+ RedirectURL string
+
+ // TenantID is the Azure Active Directory tenant the credential authenticates in. Defaults to the
+ // "organizations" tenant, which can authenticate work and school accounts.
+ TenantID string
+}
+
+func (o *InteractiveBrowserCredentialOptions) init() {
+ if o.TenantID == "" {
+ o.TenantID = organizationsTenantID
+ }
+ if o.ClientID == "" {
+ o.ClientID = developerSignOnClientID
+ }
+}
+
+// InteractiveBrowserCredential opens a browser to interactively authenticate a user.
+type InteractiveBrowserCredential struct {
+ client *publicClient
+}
+
+// NewInteractiveBrowserCredential constructs a new InteractiveBrowserCredential. Pass nil to accept default options.
+func NewInteractiveBrowserCredential(options *InteractiveBrowserCredentialOptions) (*InteractiveBrowserCredential, error) {
+ cp := InteractiveBrowserCredentialOptions{}
+ if options != nil {
+ cp = *options
+ }
+ cp.init()
+ msalOpts := publicClientOptions{
+ ClientOptions: cp.ClientOptions,
+ DisableInstanceDiscovery: cp.DisableInstanceDiscovery,
+ LoginHint: cp.LoginHint,
+ RedirectURL: cp.RedirectURL,
+ }
+ c, err := newPublicClient(cp.TenantID, cp.ClientID, credNameBrowser, msalOpts)
+ if err != nil {
+ return nil, err
+ }
+ return &InteractiveBrowserCredential{client: c}, nil
+}
+
+// GetToken requests an access token from Azure Active Directory. This method is called automatically by Azure SDK clients.
+func (c *InteractiveBrowserCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ return c.client.GetToken(ctx, opts)
+}
+
+var _ azcore.TokenCredential = (*InteractiveBrowserCredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go
new file mode 100644
index 000000000..1aa1e0fc7
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go
@@ -0,0 +1,14 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
+
+// EventAuthentication entries contain information about authentication.
+// This includes information like the names of environment variables
+// used when obtaining credentials and the type of credential used.
+const EventAuthentication log.Event = "Authentication"
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go
new file mode 100644
index 000000000..fdc3c1f67
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go
@@ -0,0 +1,404 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "net/url"
+ "os"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
+)
+
+const (
+ arcIMDSEndpoint = "IMDS_ENDPOINT"
+ identityEndpoint = "IDENTITY_ENDPOINT"
+ identityHeader = "IDENTITY_HEADER"
+ identityServerThumbprint = "IDENTITY_SERVER_THUMBPRINT"
+ headerMetadata = "Metadata"
+ imdsEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token"
+ msiEndpoint = "MSI_ENDPOINT"
+ imdsAPIVersion = "2018-02-01"
+ azureArcAPIVersion = "2019-08-15"
+ serviceFabricAPIVersion = "2019-07-01-preview"
+
+ qpClientID = "client_id"
+ qpResID = "mi_res_id"
+)
+
+type msiType int
+
+const (
+ msiTypeAppService msiType = iota
+ msiTypeAzureArc
+ msiTypeCloudShell
+ msiTypeIMDS
+ msiTypeServiceFabric
+)
+
+// managedIdentityClient provides the base for authenticating in managed identity environments
+// This type includes an runtime.Pipeline and TokenCredentialOptions.
+type managedIdentityClient struct {
+ pipeline runtime.Pipeline
+ msiType msiType
+ endpoint string
+ id ManagedIDKind
+}
+
+type wrappedNumber json.Number
+
+func (n *wrappedNumber) UnmarshalJSON(b []byte) error {
+ c := string(b)
+ if c == "\"\"" {
+ return nil
+ }
+ return json.Unmarshal(b, (*json.Number)(n))
+}
+
+// setIMDSRetryOptionDefaults sets zero-valued fields to default values appropriate for IMDS
+func setIMDSRetryOptionDefaults(o *policy.RetryOptions) {
+ if o.MaxRetries == 0 {
+ o.MaxRetries = 5
+ }
+ if o.MaxRetryDelay == 0 {
+ o.MaxRetryDelay = 1 * time.Minute
+ }
+ if o.RetryDelay == 0 {
+ o.RetryDelay = 2 * time.Second
+ }
+ if o.StatusCodes == nil {
+ o.StatusCodes = []int{
+ // IMDS docs recommend retrying 404, 410, 429 and 5xx
+ // https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token#error-handling
+ http.StatusNotFound, // 404
+ http.StatusGone, // 410
+ http.StatusTooManyRequests, // 429
+ http.StatusInternalServerError, // 500
+ http.StatusNotImplemented, // 501
+ http.StatusBadGateway, // 502
+ http.StatusServiceUnavailable, // 503
+ http.StatusGatewayTimeout, // 504
+ http.StatusHTTPVersionNotSupported, // 505
+ http.StatusVariantAlsoNegotiates, // 506
+ http.StatusInsufficientStorage, // 507
+ http.StatusLoopDetected, // 508
+ http.StatusNotExtended, // 510
+ http.StatusNetworkAuthenticationRequired, // 511
+ }
+ }
+ if o.TryTimeout == 0 {
+ o.TryTimeout = 1 * time.Minute
+ }
+}
+
+// newManagedIdentityClient creates a new instance of the ManagedIdentityClient with the ManagedIdentityCredentialOptions
+// that are passed into it along with a default pipeline.
+// options: ManagedIdentityCredentialOptions configure policies for the pipeline and the authority host that
+// will be used to retrieve tokens and authenticate
+func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) (*managedIdentityClient, error) {
+ if options == nil {
+ options = &ManagedIdentityCredentialOptions{}
+ }
+ cp := options.ClientOptions
+ c := managedIdentityClient{id: options.ID, endpoint: imdsEndpoint, msiType: msiTypeIMDS}
+ env := "IMDS"
+ if endpoint, ok := os.LookupEnv(identityEndpoint); ok {
+ if _, ok := os.LookupEnv(identityHeader); ok {
+ if _, ok := os.LookupEnv(identityServerThumbprint); ok {
+ env = "Service Fabric"
+ c.endpoint = endpoint
+ c.msiType = msiTypeServiceFabric
+ } else {
+ env = "App Service"
+ c.endpoint = endpoint
+ c.msiType = msiTypeAppService
+ }
+ } else if _, ok := os.LookupEnv(arcIMDSEndpoint); ok {
+ env = "Azure Arc"
+ c.endpoint = endpoint
+ c.msiType = msiTypeAzureArc
+ }
+ } else if endpoint, ok := os.LookupEnv(msiEndpoint); ok {
+ env = "Cloud Shell"
+ c.endpoint = endpoint
+ c.msiType = msiTypeCloudShell
+ } else {
+ setIMDSRetryOptionDefaults(&cp.Retry)
+ }
+ c.pipeline = runtime.NewPipeline(component, version, runtime.PipelineOptions{}, &cp)
+
+ if log.Should(EventAuthentication) {
+ log.Writef(EventAuthentication, "Managed Identity Credential will use %s managed identity", env)
+ }
+
+ return &c, nil
+}
+
+// provideToken acquires a token for MSAL's confidential.Client, which caches the token
+func (c *managedIdentityClient) provideToken(ctx context.Context, params confidential.TokenProviderParameters) (confidential.TokenProviderResult, error) {
+ result := confidential.TokenProviderResult{}
+ tk, err := c.authenticate(ctx, c.id, params.Scopes)
+ if err == nil {
+ result.AccessToken = tk.Token
+ result.ExpiresInSeconds = int(time.Until(tk.ExpiresOn).Seconds())
+ }
+ return result, err
+}
+
+// authenticate acquires an access token
+func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKind, scopes []string) (azcore.AccessToken, error) {
+ msg, err := c.createAuthRequest(ctx, id, scopes)
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+
+ resp, err := c.pipeline.Do(msg)
+ if err != nil {
+ return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, err.Error(), nil, err)
+ }
+
+ if runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) {
+ return c.createAccessToken(resp)
+ }
+
+ if c.msiType == msiTypeIMDS {
+ switch resp.StatusCode {
+ case http.StatusBadRequest:
+ if id != nil {
+ return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "the requested identity isn't assigned to this resource", resp, nil)
+ }
+ msg := "failed to authenticate a system assigned identity"
+ if body, err := runtime.Payload(resp); err == nil && len(body) > 0 {
+ msg += fmt.Sprintf(". The endpoint responded with %s", body)
+ }
+ return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, msg)
+ case http.StatusForbidden:
+ // Docker Desktop runs a proxy that responds 403 to IMDS token requests. If we get that response,
+ // we return credentialUnavailableError so credential chains continue to their next credential
+ body, err := runtime.Payload(resp)
+ if err == nil && strings.Contains(string(body), "A socket operation was attempted to an unreachable network") {
+ return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, fmt.Sprintf("unexpected response %q", string(body)))
+ }
+ }
+ }
+
+ return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "authentication failed", resp, nil)
+}
+
+func (c *managedIdentityClient) createAccessToken(res *http.Response) (azcore.AccessToken, error) {
+ value := struct {
+ // these are the only fields that we use
+ Token string `json:"access_token,omitempty"`
+ RefreshToken string `json:"refresh_token,omitempty"`
+ ExpiresIn wrappedNumber `json:"expires_in,omitempty"` // this field should always return the number of seconds for which a token is valid
+ ExpiresOn interface{} `json:"expires_on,omitempty"` // the value returned in this field varies between a number and a date string
+ }{}
+ if err := runtime.UnmarshalAsJSON(res, &value); err != nil {
+ return azcore.AccessToken{}, fmt.Errorf("internal AccessToken: %v", err)
+ }
+ if value.ExpiresIn != "" {
+ expiresIn, err := json.Number(value.ExpiresIn).Int64()
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+ return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Now().Add(time.Second * time.Duration(expiresIn)).UTC()}, nil
+ }
+ switch v := value.ExpiresOn.(type) {
+ case float64:
+ return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Unix(int64(v), 0).UTC()}, nil
+ case string:
+ if expiresOn, err := strconv.Atoi(v); err == nil {
+ return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Unix(int64(expiresOn), 0).UTC()}, nil
+ }
+ return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "unexpected expires_on value: "+v, res, nil)
+ default:
+ msg := fmt.Sprintf("unsupported type received in expires_on: %T, %v", v, v)
+ return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, msg, res, nil)
+ }
+}
+
+func (c *managedIdentityClient) createAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
+ switch c.msiType {
+ case msiTypeIMDS:
+ return c.createIMDSAuthRequest(ctx, id, scopes)
+ case msiTypeAppService:
+ return c.createAppServiceAuthRequest(ctx, id, scopes)
+ case msiTypeAzureArc:
+ // need to perform preliminary request to retreive the secret key challenge provided by the HIMDS service
+ key, err := c.getAzureArcSecretKey(ctx, scopes)
+ if err != nil {
+ msg := fmt.Sprintf("failed to retreive secret key from the identity endpoint: %v", err)
+ return nil, newAuthenticationFailedError(credNameManagedIdentity, msg, nil, err)
+ }
+ return c.createAzureArcAuthRequest(ctx, id, scopes, key)
+ case msiTypeServiceFabric:
+ return c.createServiceFabricAuthRequest(ctx, id, scopes)
+ case msiTypeCloudShell:
+ return c.createCloudShellAuthRequest(ctx, id, scopes)
+ default:
+ return nil, newCredentialUnavailableError(credNameManagedIdentity, "managed identity isn't supported in this environment")
+ }
+}
+
+func (c *managedIdentityClient) createIMDSAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
+ request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ request.Raw().Header.Set(headerMetadata, "true")
+ q := request.Raw().URL.Query()
+ q.Add("api-version", imdsAPIVersion)
+ q.Add("resource", strings.Join(scopes, " "))
+ if id != nil {
+ if id.idKind() == miResourceID {
+ q.Add(qpResID, id.String())
+ } else {
+ q.Add(qpClientID, id.String())
+ }
+ }
+ request.Raw().URL.RawQuery = q.Encode()
+ return request, nil
+}
+
+func (c *managedIdentityClient) createAppServiceAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
+ request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ request.Raw().Header.Set("X-IDENTITY-HEADER", os.Getenv(identityHeader))
+ q := request.Raw().URL.Query()
+ q.Add("api-version", "2019-08-01")
+ q.Add("resource", scopes[0])
+ if id != nil {
+ if id.idKind() == miResourceID {
+ q.Add(qpResID, id.String())
+ } else {
+ q.Add(qpClientID, id.String())
+ }
+ }
+ request.Raw().URL.RawQuery = q.Encode()
+ return request, nil
+}
+
+func (c *managedIdentityClient) createServiceFabricAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
+ request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ q := request.Raw().URL.Query()
+ request.Raw().Header.Set("Accept", "application/json")
+ request.Raw().Header.Set("Secret", os.Getenv(identityHeader))
+ q.Add("api-version", serviceFabricAPIVersion)
+ q.Add("resource", strings.Join(scopes, " "))
+ if id != nil {
+ log.Write(EventAuthentication, "WARNING: Service Fabric doesn't support selecting a user-assigned identity at runtime")
+ if id.idKind() == miResourceID {
+ q.Add(qpResID, id.String())
+ } else {
+ q.Add(qpClientID, id.String())
+ }
+ }
+ request.Raw().URL.RawQuery = q.Encode()
+ return request, nil
+}
+
+func (c *managedIdentityClient) getAzureArcSecretKey(ctx context.Context, resources []string) (string, error) {
+ // create the request to retreive the secret key challenge provided by the HIMDS service
+ request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint)
+ if err != nil {
+ return "", err
+ }
+ request.Raw().Header.Set(headerMetadata, "true")
+ q := request.Raw().URL.Query()
+ q.Add("api-version", azureArcAPIVersion)
+ q.Add("resource", strings.Join(resources, " "))
+ request.Raw().URL.RawQuery = q.Encode()
+ // send the initial request to get the short-lived secret key
+ response, err := c.pipeline.Do(request)
+ if err != nil {
+ return "", err
+ }
+ // the endpoint is expected to return a 401 with the WWW-Authenticate header set to the location
+ // of the secret key file. Any other status code indicates an error in the request.
+ if response.StatusCode != 401 {
+ msg := fmt.Sprintf("expected a 401 response, received %d", response.StatusCode)
+ return "", newAuthenticationFailedError(credNameManagedIdentity, msg, response, nil)
+ }
+ header := response.Header.Get("WWW-Authenticate")
+ if len(header) == 0 {
+ return "", errors.New("did not receive a value from WWW-Authenticate header")
+ }
+ // the WWW-Authenticate header is expected in the following format: Basic realm=/some/file/path.key
+ pos := strings.LastIndex(header, "=")
+ if pos == -1 {
+ return "", fmt.Errorf("did not receive a correct value from WWW-Authenticate header: %s", header)
+ }
+ key, err := os.ReadFile(header[pos+1:])
+ if err != nil {
+ return "", fmt.Errorf("could not read file (%s) contents: %v", header[pos+1:], err)
+ }
+ return string(key), nil
+}
+
+func (c *managedIdentityClient) createAzureArcAuthRequest(ctx context.Context, id ManagedIDKind, resources []string, key string) (*policy.Request, error) {
+ request, err := runtime.NewRequest(ctx, http.MethodGet, c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ request.Raw().Header.Set(headerMetadata, "true")
+ request.Raw().Header.Set("Authorization", fmt.Sprintf("Basic %s", key))
+ q := request.Raw().URL.Query()
+ q.Add("api-version", azureArcAPIVersion)
+ q.Add("resource", strings.Join(resources, " "))
+ if id != nil {
+ log.Write(EventAuthentication, "WARNING: Azure Arc doesn't support user-assigned managed identities")
+ if id.idKind() == miResourceID {
+ q.Add(qpResID, id.String())
+ } else {
+ q.Add(qpClientID, id.String())
+ }
+ }
+ request.Raw().URL.RawQuery = q.Encode()
+ return request, nil
+}
+
+func (c *managedIdentityClient) createCloudShellAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) {
+ request, err := runtime.NewRequest(ctx, http.MethodPost, c.endpoint)
+ if err != nil {
+ return nil, err
+ }
+ request.Raw().Header.Set(headerMetadata, "true")
+ data := url.Values{}
+ data.Set("resource", strings.Join(scopes, " "))
+ dataEncoded := data.Encode()
+ body := streaming.NopCloser(strings.NewReader(dataEncoded))
+ if err := request.SetBody(body, "application/x-www-form-urlencoded"); err != nil {
+ return nil, err
+ }
+ if id != nil {
+ log.Write(EventAuthentication, "WARNING: Cloud Shell doesn't support user-assigned managed identities")
+ q := request.Raw().URL.Query()
+ if id.idKind() == miResourceID {
+ q.Add(qpResID, id.String())
+ } else {
+ q.Add(qpClientID, id.String())
+ }
+ }
+ return request, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go
new file mode 100644
index 000000000..35c5e6725
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go
@@ -0,0 +1,113 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "fmt"
+ "strings"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
+)
+
+const credNameManagedIdentity = "ManagedIdentityCredential"
+
+type managedIdentityIDKind int
+
+const (
+ miClientID managedIdentityIDKind = 0
+ miResourceID managedIdentityIDKind = 1
+)
+
+// ManagedIDKind identifies the ID of a managed identity as either a client or resource ID
+type ManagedIDKind interface {
+ fmt.Stringer
+ idKind() managedIdentityIDKind
+}
+
+// ClientID is the client ID of a user-assigned managed identity.
+type ClientID string
+
+func (ClientID) idKind() managedIdentityIDKind {
+ return miClientID
+}
+
+// String returns the string value of the ID.
+func (c ClientID) String() string {
+ return string(c)
+}
+
+// ResourceID is the resource ID of a user-assigned managed identity.
+type ResourceID string
+
+func (ResourceID) idKind() managedIdentityIDKind {
+ return miResourceID
+}
+
+// String returns the string value of the ID.
+func (r ResourceID) String() string {
+ return string(r)
+}
+
+// ManagedIdentityCredentialOptions contains optional parameters for ManagedIdentityCredential.
+type ManagedIdentityCredentialOptions struct {
+ azcore.ClientOptions
+
+ // ID is the ID of a managed identity the credential should authenticate. Set this field to use a specific identity
+ // instead of the hosting environment's default. The value may be the identity's client ID or resource ID, but note that
+ // some platforms don't accept resource IDs.
+ ID ManagedIDKind
+}
+
+// ManagedIdentityCredential authenticates an Azure managed identity in any hosting environment supporting managed identities.
+// This credential authenticates a system-assigned identity by default. Use ManagedIdentityCredentialOptions.ID to specify a
+// user-assigned identity. See Azure Active Directory documentation for more information about managed identities:
+// https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview
+type ManagedIdentityCredential struct {
+ client *confidentialClient
+ mic *managedIdentityClient
+}
+
+// NewManagedIdentityCredential creates a ManagedIdentityCredential. Pass nil to accept default options.
+func NewManagedIdentityCredential(options *ManagedIdentityCredentialOptions) (*ManagedIdentityCredential, error) {
+ if options == nil {
+ options = &ManagedIdentityCredentialOptions{}
+ }
+ mic, err := newManagedIdentityClient(options)
+ if err != nil {
+ return nil, err
+ }
+ cred := confidential.NewCredFromTokenProvider(mic.provideToken)
+
+ // It's okay to give MSAL an invalid client ID because MSAL will use it only as part of a cache key.
+ // ManagedIdentityClient handles all the details of authentication and won't receive this value from MSAL.
+ clientID := "SYSTEM-ASSIGNED-MANAGED-IDENTITY"
+ if options.ID != nil {
+ clientID = options.ID.String()
+ }
+ // similarly, it's okay to give MSAL an incorrect tenant because MSAL won't use the value
+ c, err := newConfidentialClient("common", clientID, credNameManagedIdentity, cred, confidentialClientOptions{})
+ if err != nil {
+ return nil, err
+ }
+ return &ManagedIdentityCredential{client: c, mic: mic}, nil
+}
+
+// GetToken requests an access token from the hosting environment. This method is called automatically by Azure SDK clients.
+func (c *ManagedIdentityCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ if len(opts.Scopes) != 1 {
+ err := fmt.Errorf("%s.GetToken() requires exactly one scope", credNameManagedIdentity)
+ return azcore.AccessToken{}, err
+ }
+ // managed identity endpoints require an AADv1 resource (i.e. token audience), not a v2 scope, so we remove "/.default" here
+ opts.Scopes = []string{strings.TrimSuffix(opts.Scopes[0], defaultSuffix)}
+ return c.client.GetToken(ctx, opts)
+}
+
+var _ azcore.TokenCredential = (*ManagedIdentityCredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go
new file mode 100644
index 000000000..2b360b681
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go
@@ -0,0 +1,92 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "crypto"
+ "crypto/x509"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
+)
+
+const credNameOBO = "OnBehalfOfCredential"
+
+// OnBehalfOfCredential authenticates a service principal via the on-behalf-of flow. This is typically used by
+// middle-tier services that authorize requests to other services with a delegated user identity. Because this
+// is not an interactive authentication flow, an application using it must have admin consent for any delegated
+// permissions before requesting tokens for them. See [Azure Active Directory documentation] for more details.
+//
+// [Azure Active Directory documentation]: https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow
+type OnBehalfOfCredential struct {
+ client *confidentialClient
+}
+
+// OnBehalfOfCredentialOptions contains optional parameters for OnBehalfOfCredential
+type OnBehalfOfCredentialOptions struct {
+ azcore.ClientOptions
+
+ // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens.
+ // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the
+ // application is registered.
+ AdditionallyAllowedTenants []string
+ // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
+ // private clouds such as Azure Stack. It determines whether the credential requests Azure AD instance metadata
+ // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
+ // the application responsible for ensuring the configured authority is valid and trustworthy.
+ DisableInstanceDiscovery bool
+ // SendCertificateChain applies only when the credential is configured to authenticate with a certificate.
+ // This setting controls whether the credential sends the public certificate chain in the x5c header of each
+ // token request's JWT. This is required for, and only used in, Subject Name/Issuer (SNI) authentication.
+ SendCertificateChain bool
+}
+
+// NewOnBehalfOfCredentialWithCertificate constructs an OnBehalfOfCredential that authenticates with a certificate.
+// See [ParseCertificates] for help loading a certificate.
+func NewOnBehalfOfCredentialWithCertificate(tenantID, clientID, userAssertion string, certs []*x509.Certificate, key crypto.PrivateKey, options *OnBehalfOfCredentialOptions) (*OnBehalfOfCredential, error) {
+ cred, err := confidential.NewCredFromCert(certs, key)
+ if err != nil {
+ return nil, err
+ }
+ return newOnBehalfOfCredential(tenantID, clientID, userAssertion, cred, options)
+}
+
+// NewOnBehalfOfCredentialWithSecret constructs an OnBehalfOfCredential that authenticates with a client secret.
+func NewOnBehalfOfCredentialWithSecret(tenantID, clientID, userAssertion, clientSecret string, options *OnBehalfOfCredentialOptions) (*OnBehalfOfCredential, error) {
+ cred, err := confidential.NewCredFromSecret(clientSecret)
+ if err != nil {
+ return nil, err
+ }
+ return newOnBehalfOfCredential(tenantID, clientID, userAssertion, cred, options)
+}
+
+func newOnBehalfOfCredential(tenantID, clientID, userAssertion string, cred confidential.Credential, options *OnBehalfOfCredentialOptions) (*OnBehalfOfCredential, error) {
+ if options == nil {
+ options = &OnBehalfOfCredentialOptions{}
+ }
+ opts := confidentialClientOptions{
+ AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ Assertion: userAssertion,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ SendX5C: options.SendCertificateChain,
+ }
+ c, err := newConfidentialClient(tenantID, clientID, credNameOBO, cred, opts)
+ if err != nil {
+ return nil, err
+ }
+ return &OnBehalfOfCredential{c}, nil
+}
+
+// GetToken requests an access token from Azure Active Directory. This method is called automatically by Azure SDK clients.
+func (o *OnBehalfOfCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ return o.client.GetToken(ctx, opts)
+}
+
+var _ azcore.TokenCredential = (*OnBehalfOfCredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go
new file mode 100644
index 000000000..6512d3e25
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go
@@ -0,0 +1,178 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "fmt"
+ "strings"
+ "sync"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/public"
+)
+
+type publicClientOptions struct {
+ azcore.ClientOptions
+
+ AdditionallyAllowedTenants []string
+ DeviceCodePrompt func(context.Context, DeviceCodeMessage) error
+ DisableInstanceDiscovery bool
+ LoginHint, RedirectURL string
+ Username, Password string
+}
+
+// publicClient wraps the MSAL public client
+type publicClient struct {
+ account public.Account
+ cae, noCAE msalPublicClient
+ caeMu, noCAEMu, clientMu *sync.Mutex
+ clientID, tenantID string
+ host string
+ name string
+ opts publicClientOptions
+}
+
+func newPublicClient(tenantID, clientID, name string, o publicClientOptions) (*publicClient, error) {
+ if !validTenantID(tenantID) {
+ return nil, errInvalidTenantID
+ }
+ host, err := setAuthorityHost(o.Cloud)
+ if err != nil {
+ return nil, err
+ }
+ o.AdditionallyAllowedTenants = resolveAdditionalTenants(o.AdditionallyAllowedTenants)
+ return &publicClient{
+ caeMu: &sync.Mutex{},
+ clientID: clientID,
+ clientMu: &sync.Mutex{},
+ host: host,
+ name: name,
+ noCAEMu: &sync.Mutex{},
+ opts: o,
+ tenantID: tenantID,
+ }, nil
+}
+
+// GetToken requests an access token from MSAL, checking the cache first.
+func (p *publicClient) GetToken(ctx context.Context, tro policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ if len(tro.Scopes) < 1 {
+ return azcore.AccessToken{}, fmt.Errorf("%s.GetToken() requires at least one scope", p.name)
+ }
+ tenant, err := p.resolveTenant(tro.TenantID)
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+ client, mu, err := p.client(tro)
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+ mu.Lock()
+ defer mu.Unlock()
+ ar, err := client.AcquireTokenSilent(ctx, tro.Scopes, public.WithSilentAccount(p.account), public.WithClaims(tro.Claims), public.WithTenantID(tenant))
+ if err == nil {
+ return p.token(ar, err)
+ }
+ at, err := p.reqToken(ctx, client, tro)
+ if err == nil {
+ msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", p.name, strings.Join(ar.GrantedScopes, ", "))
+ log.Write(EventAuthentication, msg)
+ }
+ return at, err
+}
+
+// reqToken requests a token from the MSAL public client. It's separate from GetToken() to enable Authenticate() to bypass the cache.
+func (p *publicClient) reqToken(ctx context.Context, c msalPublicClient, tro policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ tenant, err := p.resolveTenant(tro.TenantID)
+ if err != nil {
+ return azcore.AccessToken{}, err
+ }
+ var ar public.AuthResult
+ switch p.name {
+ case credNameBrowser:
+ ar, err = c.AcquireTokenInteractive(ctx, tro.Scopes,
+ public.WithClaims(tro.Claims),
+ public.WithLoginHint(p.opts.LoginHint),
+ public.WithRedirectURI(p.opts.RedirectURL),
+ public.WithTenantID(tenant),
+ )
+ case credNameDeviceCode:
+ dc, e := c.AcquireTokenByDeviceCode(ctx, tro.Scopes, public.WithClaims(tro.Claims), public.WithTenantID(tenant))
+ if e != nil {
+ return azcore.AccessToken{}, e
+ }
+ err = p.opts.DeviceCodePrompt(ctx, DeviceCodeMessage{
+ Message: dc.Result.Message,
+ UserCode: dc.Result.UserCode,
+ VerificationURL: dc.Result.VerificationURL,
+ })
+ if err == nil {
+ ar, err = dc.AuthenticationResult(ctx)
+ }
+ case credNameUserPassword:
+ ar, err = c.AcquireTokenByUsernamePassword(ctx, tro.Scopes, p.opts.Username, p.opts.Password, public.WithClaims(tro.Claims), public.WithTenantID(tenant))
+ default:
+ return azcore.AccessToken{}, fmt.Errorf("unknown credential %q", p.name)
+ }
+ return p.token(ar, err)
+}
+
+func (p *publicClient) client(tro policy.TokenRequestOptions) (msalPublicClient, *sync.Mutex, error) {
+ p.clientMu.Lock()
+ defer p.clientMu.Unlock()
+ if tro.EnableCAE {
+ if p.cae == nil {
+ client, err := p.newMSALClient(true)
+ if err != nil {
+ return nil, nil, err
+ }
+ p.cae = client
+ }
+ return p.cae, p.caeMu, nil
+ }
+ if p.noCAE == nil {
+ client, err := p.newMSALClient(false)
+ if err != nil {
+ return nil, nil, err
+ }
+ p.noCAE = client
+ }
+ return p.noCAE, p.noCAEMu, nil
+}
+
+func (p *publicClient) newMSALClient(enableCAE bool) (msalPublicClient, error) {
+ o := []public.Option{
+ public.WithAuthority(runtime.JoinPaths(p.host, p.tenantID)),
+ public.WithHTTPClient(newPipelineAdapter(&p.opts.ClientOptions)),
+ }
+ if enableCAE {
+ o = append(o, public.WithClientCapabilities(cp1))
+ }
+ if p.opts.DisableInstanceDiscovery || strings.ToLower(p.tenantID) == "adfs" {
+ o = append(o, public.WithInstanceDiscovery(false))
+ }
+ return public.New(p.clientID, o...)
+}
+
+func (p *publicClient) token(ar public.AuthResult, err error) (azcore.AccessToken, error) {
+ if err == nil {
+ p.account = ar.Account
+ } else {
+ res := getResponseFromError(err)
+ err = newAuthenticationFailedError(p.name, err.Error(), res, err)
+ }
+ return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC()}, err
+}
+
+// resolveTenant returns the correct tenant for a token request given the client's
+// configuration, or an error when that configuration doesn't allow the specified tenant
+func (p *publicClient) resolveTenant(specified string) (string, error) {
+ return resolveTenant(p.tenantID, specified, p.name, p.opts.AdditionallyAllowedTenants)
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1 b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1
new file mode 100644
index 000000000..fe0183add
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1
@@ -0,0 +1,36 @@
+[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = 'Medium')]
+param (
+ # Captures any arguments from eng/New-TestResources.ps1 not declared here (no parameter errors).
+ [Parameter(ValueFromRemainingArguments = $true)]
+ $RemainingArguments
+)
+
+if (!$CI) {
+ # TODO: Remove this once auto-cloud config downloads are supported locally
+ Write-Host "Skipping cert setup in local testing mode"
+ return
+}
+
+if ($EnvironmentVariables -eq $null -or $EnvironmentVariables.Count -eq 0) {
+ throw "EnvironmentVariables must be set in the calling script New-TestResources.ps1"
+}
+
+$tmp = $env:TEMP ? $env:TEMP : [System.IO.Path]::GetTempPath()
+$pfxPath = Join-Path $tmp "test.pfx"
+$pemPath = Join-Path $tmp "test.pem"
+$sniPath = Join-Path $tmp "testsni.pfx"
+
+Write-Host "Creating identity test files: $pfxPath $pemPath $sniPath"
+
+[System.Convert]::FromBase64String($EnvironmentVariables['PFX_CONTENTS']) | Set-Content -Path $pfxPath -AsByteStream
+Set-Content -Path $pemPath -Value $EnvironmentVariables['PEM_CONTENTS']
+[System.Convert]::FromBase64String($EnvironmentVariables['SNI_CONTENTS']) | Set-Content -Path $sniPath -AsByteStream
+
+# Set for pipeline
+Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_PFX;]$pfxPath"
+Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_PEM;]$pemPath"
+Write-Host "##vso[task.setvariable variable=IDENTITY_SP_CERT_SNI;]$sniPath"
+# Set for local
+$env:IDENTITY_SP_CERT_PFX = $pfxPath
+$env:IDENTITY_SP_CERT_PEM = $pemPath
+$env:IDENTITY_SP_CERT_SNI = $sniPath
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep
new file mode 100644
index 000000000..b3490d3b5
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep
@@ -0,0 +1 @@
+param baseName string
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go
new file mode 100644
index 000000000..f787ec0ce
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go
@@ -0,0 +1,66 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+)
+
+const credNameUserPassword = "UsernamePasswordCredential"
+
+// UsernamePasswordCredentialOptions contains optional parameters for UsernamePasswordCredential.
+type UsernamePasswordCredentialOptions struct {
+ azcore.ClientOptions
+
+ // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens.
+ // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the
+ // application is registered.
+ AdditionallyAllowedTenants []string
+ // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
+ // private clouds such as Azure Stack. It determines whether the credential requests Azure AD instance metadata
+ // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
+ // the application responsible for ensuring the configured authority is valid and trustworthy.
+ DisableInstanceDiscovery bool
+}
+
+// UsernamePasswordCredential authenticates a user with a password. Microsoft doesn't recommend this kind of authentication,
+// because it's less secure than other authentication flows. This credential is not interactive, so it isn't compatible
+// with any form of multi-factor authentication, and the application must already have user or admin consent.
+// This credential can only authenticate work and school accounts; it can't authenticate Microsoft accounts.
+type UsernamePasswordCredential struct {
+ client *publicClient
+}
+
+// NewUsernamePasswordCredential creates a UsernamePasswordCredential. clientID is the ID of the application the user
+// will authenticate to. Pass nil for options to accept defaults.
+func NewUsernamePasswordCredential(tenantID string, clientID string, username string, password string, options *UsernamePasswordCredentialOptions) (*UsernamePasswordCredential, error) {
+ if options == nil {
+ options = &UsernamePasswordCredentialOptions{}
+ }
+ opts := publicClientOptions{
+ AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ Password: password,
+ Username: username,
+ }
+ c, err := newPublicClient(tenantID, clientID, credNameUserPassword, opts)
+ if err != nil {
+ return nil, err
+ }
+ return &UsernamePasswordCredential{client: c}, err
+}
+
+// GetToken requests an access token from Azure Active Directory. This method is called automatically by Azure SDK clients.
+func (c *UsernamePasswordCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ return c.client.GetToken(ctx, opts)
+}
+
+var _ azcore.TokenCredential = (*UsernamePasswordCredential)(nil)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go
new file mode 100644
index 000000000..65e74e31e
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go
@@ -0,0 +1,15 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+const (
+ // UserAgent is the string to be used in the user agent string when making requests.
+ component = "azidentity"
+
+ // Version is the semantic version (see http://semver.org) of this module.
+ version = "v1.4.0"
+)
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go
new file mode 100644
index 000000000..7e016324d
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go
@@ -0,0 +1,126 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package azidentity
+
+import (
+ "context"
+ "errors"
+ "os"
+ "sync"
+ "time"
+
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+)
+
+const credNameWorkloadIdentity = "WorkloadIdentityCredential"
+
+// WorkloadIdentityCredential supports Azure workload identity on Kubernetes.
+// See [Azure Kubernetes Service documentation] for more information.
+//
+// [Azure Kubernetes Service documentation]: https://learn.microsoft.com/azure/aks/workload-identity-overview
+type WorkloadIdentityCredential struct {
+ assertion, file string
+ cred *ClientAssertionCredential
+ expires time.Time
+ mtx *sync.RWMutex
+}
+
+// WorkloadIdentityCredentialOptions contains optional parameters for WorkloadIdentityCredential.
+type WorkloadIdentityCredentialOptions struct {
+ azcore.ClientOptions
+
+ // AdditionallyAllowedTenants specifies additional tenants for which the credential may acquire tokens.
+ // Add the wildcard value "*" to allow the credential to acquire tokens for any tenant in which the
+ // application is registered.
+ AdditionallyAllowedTenants []string
+ // ClientID of the service principal. Defaults to the value of the environment variable AZURE_CLIENT_ID.
+ ClientID string
+ // DisableInstanceDiscovery should be set true only by applications authenticating in disconnected clouds, or
+ // private clouds such as Azure Stack. It determines whether the credential requests Azure AD instance metadata
+ // from https://login.microsoft.com before authenticating. Setting this to true will skip this request, making
+ // the application responsible for ensuring the configured authority is valid and trustworthy.
+ DisableInstanceDiscovery bool
+ // TenantID of the service principal. Defaults to the value of the environment variable AZURE_TENANT_ID.
+ TenantID string
+ // TokenFilePath is the path of a file containing a Kubernetes service account token. Defaults to the value of the
+ // environment variable AZURE_FEDERATED_TOKEN_FILE.
+ TokenFilePath string
+}
+
+// NewWorkloadIdentityCredential constructs a WorkloadIdentityCredential. Service principal configuration is read
+// from environment variables as set by the Azure workload identity webhook. Set options to override those values.
+func NewWorkloadIdentityCredential(options *WorkloadIdentityCredentialOptions) (*WorkloadIdentityCredential, error) {
+ if options == nil {
+ options = &WorkloadIdentityCredentialOptions{}
+ }
+ ok := false
+ clientID := options.ClientID
+ if clientID == "" {
+ if clientID, ok = os.LookupEnv(azureClientID); !ok {
+ return nil, errors.New("no client ID specified. Check pod configuration or set ClientID in the options")
+ }
+ }
+ file := options.TokenFilePath
+ if file == "" {
+ if file, ok = os.LookupEnv(azureFederatedTokenFile); !ok {
+ return nil, errors.New("no token file specified. Check pod configuration or set TokenFilePath in the options")
+ }
+ }
+ tenantID := options.TenantID
+ if tenantID == "" {
+ if tenantID, ok = os.LookupEnv(azureTenantID); !ok {
+ return nil, errors.New("no tenant ID specified. Check pod configuration or set TenantID in the options")
+ }
+ }
+ w := WorkloadIdentityCredential{file: file, mtx: &sync.RWMutex{}}
+ caco := ClientAssertionCredentialOptions{
+ AdditionallyAllowedTenants: options.AdditionallyAllowedTenants,
+ ClientOptions: options.ClientOptions,
+ DisableInstanceDiscovery: options.DisableInstanceDiscovery,
+ }
+ cred, err := NewClientAssertionCredential(tenantID, clientID, w.getAssertion, &caco)
+ if err != nil {
+ return nil, err
+ }
+ // we want "WorkloadIdentityCredential" in log messages, not "ClientAssertionCredential"
+ cred.client.name = credNameWorkloadIdentity
+ w.cred = cred
+ return &w, nil
+}
+
+// GetToken requests an access token from Azure Active Directory. Azure SDK clients call this method automatically.
+func (w *WorkloadIdentityCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
+ return w.cred.GetToken(ctx, opts)
+}
+
+// getAssertion returns the specified file's content, which is expected to be a Kubernetes service account token.
+// Kubernetes is responsible for updating the file as service account tokens expire.
+func (w *WorkloadIdentityCredential) getAssertion(context.Context) (string, error) {
+ w.mtx.RLock()
+ if w.expires.Before(time.Now()) {
+ // ensure only one goroutine at a time updates the assertion
+ w.mtx.RUnlock()
+ w.mtx.Lock()
+ defer w.mtx.Unlock()
+ // double check because another goroutine may have acquired the write lock first and done the update
+ if now := time.Now(); w.expires.Before(now) {
+ content, err := os.ReadFile(w.file)
+ if err != nil {
+ return "", err
+ }
+ w.assertion = string(content)
+ // Kubernetes rotates service account tokens when they reach 80% of their total TTL. The shortest TTL
+ // is 1 hour. That implies the token we just read is valid for at least 12 minutes (20% of 1 hour),
+ // but we add some margin for safety.
+ w.expires = now.Add(10 * time.Minute)
+ }
+ } else {
+ defer w.mtx.RUnlock()
+ }
+ return w.assertion, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.md
new file mode 100644
index 000000000..77577d574
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.md
@@ -0,0 +1,327 @@
+# Release History
+
+## 5.3.0 (2023-11-24)
+### Features Added
+
+- Support for test fakes and OpenTelemetry trace spans.
+
+
+## 5.3.0-beta.2 (2023-10-30)
+
+### Other Changes
+
+- Updated with latest code generator to fix a few issues in fakes.
+
+## 5.3.0-beta.1 (2023-10-09)
+### Features Added
+
+- Support for test fakes and OpenTelemetry trace spans.
+
+## 5.2.0 (2023-09-22)
+### Features Added
+
+- New value `DiskCreateOptionCopyFromSanSnapshot` added to enum type `DiskCreateOption`
+- New enum type `DomainNameLabelScopeTypes` with values `DomainNameLabelScopeTypesNoReuse`, `DomainNameLabelScopeTypesResourceGroupReuse`, `DomainNameLabelScopeTypesSubscriptionReuse`, `DomainNameLabelScopeTypesTenantReuse`
+- New enum type `NetworkInterfaceAuxiliaryMode` with values `NetworkInterfaceAuxiliaryModeAcceleratedConnections`, `NetworkInterfaceAuxiliaryModeFloating`, `NetworkInterfaceAuxiliaryModeNone`
+- New enum type `NetworkInterfaceAuxiliarySKU` with values `NetworkInterfaceAuxiliarySKUA1`, `NetworkInterfaceAuxiliarySKUA2`, `NetworkInterfaceAuxiliarySKUA4`, `NetworkInterfaceAuxiliarySKUA8`, `NetworkInterfaceAuxiliarySKUNone`
+- New field `ElasticSanResourceID` in struct `CreationData`
+- New field `LastOwnershipUpdateTime` in struct `DiskProperties`
+- New field `AuxiliaryMode`, `AuxiliarySKU` in struct `VirtualMachineNetworkInterfaceConfigurationProperties`
+- New field `DomainNameLabelScope` in struct `VirtualMachinePublicIPAddressDNSSettingsConfiguration`
+- New field `AuxiliaryMode`, `AuxiliarySKU` in struct `VirtualMachineScaleSetNetworkConfigurationProperties`
+- New field `DomainNameLabelScope` in struct `VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings`
+- New field `AuxiliaryMode`, `AuxiliarySKU` in struct `VirtualMachineScaleSetUpdateNetworkConfigurationProperties`
+- New field `TimeCreated` in struct `VirtualMachineScaleSetVMProperties`
+
+
+## 5.1.0 (2023-07-28)
+### Features Added
+
+- New enum type `FileFormat` with values `FileFormatVHD`, `FileFormatVHDX`
+- New field `FileFormat` in struct `GrantAccessData`
+
+
+## 5.0.0 (2023-05-26)
+### Breaking Changes
+
+- Type of `CommunityGalleryImageProperties.Identifier` has been changed from `*GalleryImageIdentifier` to `*CommunityGalleryImageIdentifier`
+- Type of `GalleryTargetExtendedLocation.StorageAccountType` has been changed from `*StorageAccountType` to `*EdgeZoneStorageAccountType`
+- Type of `RestorePointSourceVMDataDisk.DiskRestorePoint` has been changed from `*APIEntityReference` to `*DiskRestorePointAttributes`
+- Type of `RestorePointSourceVMOSDisk.DiskRestorePoint` has been changed from `*APIEntityReference` to `*DiskRestorePointAttributes`
+- `StorageAccountTypeStandardSSDLRS` from enum `StorageAccountType` has been removed
+- Field `ID` of struct `VirtualMachineScaleSetIPConfiguration` has been removed
+- Field `ID` of struct `VirtualMachineScaleSetNetworkConfiguration` has been removed
+- Field `ID` of struct `VirtualMachineScaleSetUpdateIPConfiguration` has been removed
+- Field `ID` of struct `VirtualMachineScaleSetUpdateNetworkConfiguration` has been removed
+
+### Features Added
+
+- New enum type `EdgeZoneStorageAccountType` with values `EdgeZoneStorageAccountTypePremiumLRS`, `EdgeZoneStorageAccountTypeStandardLRS`, `EdgeZoneStorageAccountTypeStandardSSDLRS`, `EdgeZoneStorageAccountTypeStandardZRS`
+- New enum type `ExpandTypeForListVMs` with values `ExpandTypeForListVMsInstanceView`
+- New enum type `ExpandTypesForListVMs` with values `ExpandTypesForListVMsInstanceView`
+- New enum type `RestorePointEncryptionType` with values `RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey`, `RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys`, `RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey`
+- New function `*DedicatedHostsClient.NewListAvailableSizesPager(string, string, string, *DedicatedHostsClientListAvailableSizesOptions) *runtime.Pager[DedicatedHostsClientListAvailableSizesResponse]`
+- New function `*VirtualMachineScaleSetsClient.BeginReapply(context.Context, string, string, *VirtualMachineScaleSetsClientBeginReapplyOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReapplyResponse], error)`
+- New struct `CommunityGalleryImageIdentifier`
+- New struct `DedicatedHostSizeListResult`
+- New struct `DiskRestorePointAttributes`
+- New struct `RestorePointEncryption`
+- New struct `RunCommandManagedIdentity`
+- New struct `SecurityPostureReference`
+- New field `SKU` in struct `DedicatedHostUpdate`
+- New field `BypassPlatformSafetyChecksOnUserSchedule` in struct `LinuxVMGuestPatchAutomaticByPlatformSettings`
+- New field `HyperVGeneration` in struct `RestorePointSourceMetadata`
+- New field `WriteAcceleratorEnabled` in struct `RestorePointSourceVMDataDisk`
+- New field `WriteAcceleratorEnabled` in struct `RestorePointSourceVMOSDisk`
+- New field `ProvisionAfterExtensions` in struct `VirtualMachineExtensionProperties`
+- New field `ErrorBlobManagedIdentity`, `OutputBlobManagedIdentity`, `TreatFailureAsDeploymentFailure` in struct `VirtualMachineRunCommandProperties`
+- New field `ScriptURIManagedIdentity` in struct `VirtualMachineRunCommandScriptSource`
+- New field `PriorityMixPolicy`, `SpotRestorePolicy` in struct `VirtualMachineScaleSetUpdateProperties`
+- New field `Location` in struct `VirtualMachineScaleSetVMExtension`
+- New field `SecurityPostureReference` in struct `VirtualMachineScaleSetVMProfile`
+- New field `Hibernate` in struct `VirtualMachineScaleSetsClientBeginDeallocateOptions`
+- New field `Expand` in struct `VirtualMachinesClientListAllOptions`
+- New field `Expand` in struct `VirtualMachinesClientListOptions`
+- New field `BypassPlatformSafetyChecksOnUserSchedule` in struct `WindowsVMGuestPatchAutomaticByPlatformSettings`
+
+
+## 4.2.1 (2023-04-14)
+### Bug Fixes
+
+- Fix serialization bug of empty value of `any` type.
+
+
+## 4.2.0 (2023-03-27)
+### Features Added
+
+- New struct `ClientFactory` which is a client factory used to create any client in this module
+- New value `StorageAccountTypeStandardSSDLRS` added to enum type `StorageAccountType`
+- New field `ComputerName` in struct `VirtualMachineScaleSetVMInstanceView`
+- New field `HyperVGeneration` in struct `VirtualMachineScaleSetVMInstanceView`
+- New field `OSName` in struct `VirtualMachineScaleSetVMInstanceView`
+- New field `OSVersion` in struct `VirtualMachineScaleSetVMInstanceView`
+
+
+## 4.1.0 (2023-01-27)
+### Features Added
+
+- New type alias `AlternativeType` with values `AlternativeTypeNone`, `AlternativeTypeOffer`, `AlternativeTypePlan`
+- New type alias `ImageState` with values `ImageStateActive`, `ImageStateDeprecated`, `ImageStateScheduledForDeprecation`
+- New struct `AlternativeOption`
+- New struct `ImageDeprecationStatus`
+- New struct `OSImageNotificationProfile`
+- New struct `OSProfileProvisioningData`
+- New struct `ServiceArtifactReference`
+- New field `Zones` in struct `CloudService`
+- New field `UserData` in struct `RestorePointSourceMetadata`
+- New field `MaxSurge` in struct `RollingUpgradePolicy`
+- New field `RollbackFailedInstancesOnPolicyBreach` in struct `RollingUpgradePolicy`
+- New field `OSImageNotificationProfile` in struct `ScheduledEventsProfile`
+- New field `ImageDeprecationStatus` in struct `VirtualMachineImageProperties`
+- New field `ExactVersion` in struct `VirtualMachineReimageParameters`
+- New field `OSProfile` in struct `VirtualMachineReimageParameters`
+- New field `RequireGuestProvisionSignal` in struct `VirtualMachineScaleSetOSProfile`
+- New field `ConstrainedMaximumCapacity` in struct `VirtualMachineScaleSetProperties`
+- New field `ExactVersion` in struct `VirtualMachineScaleSetReimageParameters`
+- New field `OSProfile` in struct `VirtualMachineScaleSetReimageParameters`
+- New field `ServiceArtifactReference` in struct `VirtualMachineScaleSetVMProfile`
+- New field `ExactVersion` in struct `VirtualMachineScaleSetVMReimageParameters`
+- New field `OSProfile` in struct `VirtualMachineScaleSetVMReimageParameters`
+
+
+## 4.0.0 (2022-10-04)
+### Breaking Changes
+
+- Type of `GalleryImageVersionStorageProfile.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryArtifactVersionFullSource`
+- Type of `SharingProfile.CommunityGalleryInfo` has been changed from `interface{}` to `*CommunityGalleryInfo`
+- Type of `VirtualMachineExtensionUpdateProperties.ProtectedSettingsFromKeyVault` has been changed from `interface{}` to `*KeyVaultSecretReference`
+- Type of `GalleryOSDiskImage.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryDiskImageSource`
+- Type of `GalleryDiskImage.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryDiskImageSource`
+- Type of `GalleryDataDiskImage.Source` has been changed from `*GalleryArtifactVersionSource` to `*GalleryDiskImageSource`
+- Type of `VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault` has been changed from `interface{}` to `*KeyVaultSecretReference`
+- Type of `VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault` has been changed from `interface{}` to `*KeyVaultSecretReference`
+- Field `URI` of struct `GalleryArtifactVersionSource` has been removed
+
+### Features Added
+
+- New const `DiskControllerTypesSCSI`
+- New const `PolicyViolationCategoryImageFlaggedUnsafe`
+- New const `GalleryApplicationCustomActionParameterTypeConfigurationDataBlob`
+- New const `PolicyViolationCategoryIPTheft`
+- New const `PolicyViolationCategoryCopyrightValidation`
+- New const `PolicyViolationCategoryOther`
+- New const `GalleryApplicationCustomActionParameterTypeString`
+- New const `DiskControllerTypesNVMe`
+- New const `GalleryApplicationCustomActionParameterTypeLogOutputBlob`
+- New type alias `DiskControllerTypes`
+- New type alias `PolicyViolationCategory`
+- New type alias `GalleryApplicationCustomActionParameterType`
+- New function `PossiblePolicyViolationCategoryValues() []PolicyViolationCategory`
+- New function `PossibleGalleryApplicationCustomActionParameterTypeValues() []GalleryApplicationCustomActionParameterType`
+- New function `PossibleDiskControllerTypesValues() []DiskControllerTypes`
+- New struct `GalleryApplicationCustomAction`
+- New struct `GalleryApplicationCustomActionParameter`
+- New struct `GalleryApplicationVersionSafetyProfile`
+- New struct `GalleryArtifactSafetyProfileBase`
+- New struct `GalleryArtifactVersionFullSource`
+- New struct `GalleryDiskImageSource`
+- New struct `GalleryImageVersionSafetyProfile`
+- New struct `LatestGalleryImageVersion`
+- New struct `PolicyViolation`
+- New struct `PriorityMixPolicy`
+- New field `DiskControllerType` in struct `VirtualMachineScaleSetUpdateStorageProfile`
+- New field `HardwareProfile` in struct `VirtualMachineScaleSetUpdateVMProfile`
+- New field `CustomActions` in struct `GalleryApplicationProperties`
+- New field `DisableTCPStateTracking` in struct `VirtualMachineScaleSetNetworkConfigurationProperties`
+- New field `DiskControllerType` in struct `StorageProfile`
+- New field `OptimizedForFrequentAttach` in struct `DiskProperties`
+- New field `BurstingEnabledTime` in struct `DiskProperties`
+- New field `DiskControllerTypes` in struct `SupportedCapabilities`
+- New field `DisableTCPStateTracking` in struct `VirtualMachineNetworkInterfaceConfigurationProperties`
+- New field `EnableVMAgentPlatformUpdates` in struct `WindowsConfiguration`
+- New field `PerformancePlus` in struct `CreationData`
+- New field `IncrementalSnapshotFamilyID` in struct `SnapshotProperties`
+- New field `OptimizedForFrequentAttach` in struct `DiskUpdateProperties`
+- New field `DisableTCPStateTracking` in struct `VirtualMachineScaleSetUpdateNetworkConfigurationProperties`
+- New field `ExcludeFromLatest` in struct `TargetRegion`
+- New field `PrivacyStatementURI` in struct `SharedGalleryImageProperties`
+- New field `Eula` in struct `SharedGalleryImageProperties`
+- New field `SafetyProfile` in struct `GalleryApplicationVersionProperties`
+- New field `SafetyProfile` in struct `GalleryImageVersionProperties`
+- New field `EnableVMAgentPlatformUpdates` in struct `LinuxConfiguration`
+- New field `CurrentCapacity` in struct `CapacityReservationUtilization`
+- New field `PriorityMixPolicy` in struct `VirtualMachineScaleSetProperties`
+- New field `CustomActions` in struct `GalleryApplicationVersionPublishingProfile`
+- New field `PlatformFaultDomainCount` in struct `CapacityReservationProperties`
+- New field `DiskControllerType` in struct `VirtualMachineScaleSetStorageProfile`
+
+
+## 3.0.1 (2022-07-29)
+### Other Changes
+- Fix wrong module import for live test
+
+## 3.0.0 (2022-06-24)
+### Breaking Changes
+
+- Function `*CloudServicesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, CloudService, *CloudServicesClientBeginCreateOrUpdateOptions)`
+- Function `*CloudServicesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, *CloudServicesClientBeginUpdateOptions)` to `(context.Context, string, string, CloudServiceUpdate, *CloudServicesClientBeginUpdateOptions)`
+- Function `*CloudServicesUpdateDomainClient.BeginWalkUpdateDomain` parameter(s) have been changed from `(context.Context, string, string, int32, *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions)` to `(context.Context, string, string, int32, UpdateDomain, *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions)`
+- Type of `CloudServiceExtensionProperties.Settings` has been changed from `*string` to `interface{}`
+- Type of `CloudServiceExtensionProperties.ProtectedSettings` has been changed from `*string` to `interface{}`
+- Field `Parameters` of struct `CloudServicesClientBeginUpdateOptions` has been removed
+- Field `Parameters` of struct `CloudServicesClientBeginCreateOrUpdateOptions` has been removed
+- Field `Parameters` of struct `CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions` has been removed
+
+### Features Added
+
+- New const `CloudServiceSlotTypeProduction`
+- New const `CloudServiceSlotTypeStaging`
+- New function `*VirtualMachineImagesClient.ListByEdgeZone(context.Context, string, string, *VirtualMachineImagesClientListByEdgeZoneOptions) (VirtualMachineImagesClientListByEdgeZoneResponse, error)`
+- New function `PossibleCloudServiceSlotTypeValues() []CloudServiceSlotType`
+- New struct `SystemData`
+- New struct `VMImagesInEdgeZoneListResult`
+- New struct `VirtualMachineImagesClientListByEdgeZoneOptions`
+- New struct `VirtualMachineImagesClientListByEdgeZoneResponse`
+- New field `SystemData` in struct `CloudService`
+- New field `SlotType` in struct `CloudServiceNetworkProfile`
+
+
+## 2.0.0 (2022-06-02)
+### Breaking Changes
+
+- Type of `GalleryProperties.ProvisioningState` has been changed from `*GalleryPropertiesProvisioningState` to `*GalleryProvisioningState`
+- Type of `GalleryImageVersionProperties.ProvisioningState` has been changed from `*GalleryImageVersionPropertiesProvisioningState` to `*GalleryProvisioningState`
+- Type of `GalleryImageProperties.ProvisioningState` has been changed from `*GalleryImagePropertiesProvisioningState` to `*GalleryProvisioningState`
+- Type of `GalleryApplicationVersionProperties.ProvisioningState` has been changed from `*GalleryApplicationVersionPropertiesProvisioningState` to `*GalleryProvisioningState`
+- Type of `VirtualMachineScaleSetIdentity.UserAssignedIdentities` has been changed from `map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue` to `map[string]*UserAssignedIdentitiesValue`
+- Const `GalleryImagePropertiesProvisioningStateFailed` has been removed
+- Const `GalleryImagePropertiesProvisioningStateMigrating` has been removed
+- Const `GalleryImageVersionPropertiesProvisioningStateCreating` has been removed
+- Const `GalleryImageVersionPropertiesProvisioningStateMigrating` has been removed
+- Const `GalleryApplicationVersionPropertiesProvisioningStateFailed` has been removed
+- Const `GalleryPropertiesProvisioningStateMigrating` has been removed
+- Const `GalleryApplicationVersionPropertiesProvisioningStateDeleting` has been removed
+- Const `GalleryPropertiesProvisioningStateDeleting` has been removed
+- Const `GalleryApplicationVersionPropertiesProvisioningStateCreating` has been removed
+- Const `GalleryImageVersionPropertiesProvisioningStateSucceeded` has been removed
+- Const `GalleryImagePropertiesProvisioningStateCreating` has been removed
+- Const `GalleryImagePropertiesProvisioningStateUpdating` has been removed
+- Const `GalleryImageVersionPropertiesProvisioningStateDeleting` has been removed
+- Const `GalleryPropertiesProvisioningStateFailed` has been removed
+- Const `SharingProfileGroupTypesCommunity` has been removed
+- Const `GalleryApplicationVersionPropertiesProvisioningStateSucceeded` has been removed
+- Const `GalleryApplicationVersionPropertiesProvisioningStateMigrating` has been removed
+- Const `GalleryPropertiesProvisioningStateUpdating` has been removed
+- Const `GalleryImageVersionPropertiesProvisioningStateFailed` has been removed
+- Const `GalleryImagePropertiesProvisioningStateDeleting` has been removed
+- Const `GalleryImageVersionPropertiesProvisioningStateUpdating` has been removed
+- Const `GalleryPropertiesProvisioningStateCreating` has been removed
+- Const `GalleryApplicationVersionPropertiesProvisioningStateUpdating` has been removed
+- Const `GalleryImagePropertiesProvisioningStateSucceeded` has been removed
+- Const `GalleryPropertiesProvisioningStateSucceeded` has been removed
+- Function `PossibleGalleryPropertiesProvisioningStateValues` has been removed
+- Function `PossibleGalleryImageVersionPropertiesProvisioningStateValues` has been removed
+- Function `PossibleGalleryImagePropertiesProvisioningStateValues` has been removed
+- Function `PossibleGalleryApplicationVersionPropertiesProvisioningStateValues` has been removed
+- Struct `VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue` has been removed
+
+### Features Added
+
+- New const `GallerySharingPermissionTypesCommunity`
+- New const `GalleryProvisioningStateUpdating`
+- New const `SharedGalleryHostCachingReadOnly`
+- New const `SharedGalleryHostCachingNone`
+- New const `GalleryProvisioningStateSucceeded`
+- New const `GalleryProvisioningStateFailed`
+- New const `SharedGalleryHostCachingReadWrite`
+- New const `GalleryProvisioningStateCreating`
+- New const `DiskEncryptionSetIdentityTypeUserAssigned`
+- New const `GalleryProvisioningStateMigrating`
+- New const `DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned`
+- New const `CopyCompletionErrorReasonCopySourceNotFound`
+- New const `GalleryProvisioningStateDeleting`
+- New const `DiskStorageAccountTypesPremiumV2LRS`
+- New function `PossibleCopyCompletionErrorReasonValues() []CopyCompletionErrorReason`
+- New function `PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching`
+- New function `PossibleGalleryProvisioningStateValues() []GalleryProvisioningState`
+- New function `EncryptionSetIdentity.MarshalJSON() ([]byte, error)`
+- New function `*CommunityGalleryImagesClient.NewListPager(string, string, *CommunityGalleryImagesClientListOptions) *runtime.Pager[CommunityGalleryImagesClientListResponse]`
+- New function `*CommunityGalleryImageVersionsClient.NewListPager(string, string, string, *CommunityGalleryImageVersionsClientListOptions) *runtime.Pager[CommunityGalleryImageVersionsClientListResponse]`
+- New struct `CommunityGalleryImageList`
+- New struct `CommunityGalleryImageVersionList`
+- New struct `CommunityGalleryImageVersionsClientListOptions`
+- New struct `CommunityGalleryImageVersionsClientListResponse`
+- New struct `CommunityGalleryImagesClientListOptions`
+- New struct `CommunityGalleryImagesClientListResponse`
+- New struct `CopyCompletionError`
+- New struct `SharedGalleryDataDiskImage`
+- New struct `SharedGalleryDiskImage`
+- New struct `SharedGalleryImageVersionStorageProfile`
+- New struct `SharedGalleryOSDiskImage`
+- New struct `UserArtifactSettings`
+- New field `SharedGalleryImageID` in struct `ImageDiskReference`
+- New field `CommunityGalleryImageID` in struct `ImageDiskReference`
+- New field `AdvancedSettings` in struct `GalleryApplicationVersionPublishingProfile`
+- New field `Settings` in struct `GalleryApplicationVersionPublishingProfile`
+- New field `CopyCompletionError` in struct `SnapshotProperties`
+- New field `ExcludeFromLatest` in struct `SharedGalleryImageVersionProperties`
+- New field `StorageProfile` in struct `SharedGalleryImageVersionProperties`
+- New field `ExcludeFromLatest` in struct `CommunityGalleryImageVersionProperties`
+- New field `StorageProfile` in struct `CommunityGalleryImageVersionProperties`
+- New field `Architecture` in struct `SharedGalleryImageProperties`
+- New field `UserAssignedIdentities` in struct `EncryptionSetIdentity`
+- New field `Eula` in struct `CommunityGalleryImageProperties`
+- New field `PrivacyStatementURI` in struct `CommunityGalleryImageProperties`
+- New field `Architecture` in struct `CommunityGalleryImageProperties`
+- New field `FederatedClientID` in struct `DiskEncryptionSetUpdateProperties`
+- New field `FederatedClientID` in struct `EncryptionSetProperties`
+- New field `SecurityProfile` in struct `DiskRestorePointProperties`
+
+
+## 1.0.0 (2022-05-16)
+
+The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes.
+
+To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration).
+
+To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt).
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txt
new file mode 100644
index 000000000..dc0c2ffb3
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.md
new file mode 100644
index 000000000..87ce9c30e
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.md
@@ -0,0 +1,113 @@
+# Azure Compute Module for Go
+
+[](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4)
+
+The `armcompute` module provides operations for working with Azure Compute.
+
+[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/compute/armcompute)
+
+# Getting started
+
+## Prerequisites
+
+- an [Azure subscription](https://azure.microsoft.com/free/)
+- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). 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](https://go.dev/doc/manage-install).)
+
+## Install the package
+
+This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
+
+Install the Azure Compute module:
+
+```sh
+go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v4
+```
+
+## Authorization
+
+When creating a client, you will need to provide a credential for authenticating with Azure Compute. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.
+
+```go
+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](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity).
+
+## Client Factory
+
+Azure Compute module consists of one or more clients. We provide a client factory which could be used to create any client in this module.
+
+```go
+clientFactory, err := armcompute.NewClientFactory(, 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](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore).
+
+```go
+options := arm.ClientOptions {
+ ClientOptions: azcore.ClientOptions {
+ Cloud: cloud.AzureChina,
+ },
+}
+clientFactory, err := armcompute.NewClientFactory(, 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.
+
+```go
+client := clientFactory.NewLogAnalyticsClient()
+```
+
+## 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.
+
+## More sample code
+
+- [Availability Set](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/availabilityset)
+- [Creating a Fake](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/compute/armcompute/fake_example_test.go)
+- [Virtual Machine](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/create_vm)
+- [Dedicated Host](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/dedicated_host)
+- [Disk](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/disk)
+- [Gallery](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/gallery)
+- [Proximity Placement Group](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/proximity)
+- [Snapshot](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/snapshot)
+- [Virtual Machine Scale Set](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/compute/vmscaleset)
+
+## Major Version Upgrade
+
+Go uses [semantic import versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning) to ensure a good backward compatibility for modules. For Azure Go management SDK, we usually upgrade module version according to cooresponding service's API version. Regarding it could be a complicated experience for major version upgrade, we will try our best to keep the SDK API stable and release new version in backward compatible way. However, if any unavoidable breaking changes and a new major version releases for SDK modules, you could use these commands under your module folder to upgrade:
+
+```sh
+go install github.com/icholy/gomajor@latest
+gomajor get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute@latest
+```
+
+## Provide Feedback
+
+If you encounter bugs or have suggestions, please
+[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Compute` 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](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](https://opensource.microsoft.com/codeofconduct/).
+For more information, see the
+[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
+or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
+additional questions or comments.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.json
new file mode 100644
index 000000000..109819f62
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.json
@@ -0,0 +1,6 @@
+{
+ "AssetsRepo": "Azure/azure-sdk-assets",
+ "AssetsRepoPrefixPath": "go",
+ "TagPrefix": "go/resourcemanager/compute/armcompute",
+ "Tag": "go/resourcemanager/compute/armcompute_367222fc88"
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.md
new file mode 100644
index 000000000..f40cc3252
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.md
@@ -0,0 +1,13 @@
+### AutoRest Configuration
+
+> see https://aka.ms/autorest
+
+``` yaml
+azure-arm: true
+require:
+- https://github.com/Azure/azure-rest-api-specs/blob/c78b5d8bd3aff2d82a5f034d9164b1a9ac030e09/specification/compute/resource-manager/readme.md
+- https://github.com/Azure/azure-rest-api-specs/blob/c78b5d8bd3aff2d82a5f034d9164b1a9ac030e09/specification/compute/resource-manager/readme.go.md
+license-header: MICROSOFT_MIT_NO_VERSION
+module-version: 5.3.0
+tag: package-2023-07-01
+```
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.go
new file mode 100644
index 000000000..ce901d88a
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.go
@@ -0,0 +1,485 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// AvailabilitySetsClient contains the methods for the AvailabilitySets group.
+// Don't use this type directly, use NewAvailabilitySetsClient() instead.
+type AvailabilitySetsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewAvailabilitySetsClient creates a new instance of AvailabilitySetsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewAvailabilitySetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailabilitySetsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &AvailabilitySetsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Create or update an availability set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - availabilitySetName - The name of the availability set.
+// - parameters - Parameters supplied to the Create Availability Set operation.
+// - options - AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate
+// method.
+func (client *AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet, options *AvailabilitySetsClientCreateOrUpdateOptions) (AvailabilitySetsClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "AvailabilitySetsClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, availabilitySetName, parameters, options)
+ if err != nil {
+ return AvailabilitySetsClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AvailabilitySetsClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AvailabilitySetsClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet, options *AvailabilitySetsClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if availabilitySetName == "" {
+ return nil, errors.New("parameter availabilitySetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *AvailabilitySetsClient) createOrUpdateHandleResponse(resp *http.Response) (AvailabilitySetsClientCreateOrUpdateResponse, error) {
+ result := AvailabilitySetsClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil {
+ return AvailabilitySetsClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Delete an availability set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - availabilitySetName - The name of the availability set.
+// - options - AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method.
+func (client *AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientDeleteOptions) (AvailabilitySetsClientDeleteResponse, error) {
+ var err error
+ const operationName = "AvailabilitySetsClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, availabilitySetName, options)
+ if err != nil {
+ return AvailabilitySetsClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AvailabilitySetsClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return AvailabilitySetsClientDeleteResponse{}, err
+ }
+ return AvailabilitySetsClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if availabilitySetName == "" {
+ return nil, errors.New("parameter availabilitySetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Retrieves information about an availability set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - availabilitySetName - The name of the availability set.
+// - options - AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method.
+func (client *AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientGetOptions) (AvailabilitySetsClientGetResponse, error) {
+ var err error
+ const operationName = "AvailabilitySetsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, availabilitySetName, options)
+ if err != nil {
+ return AvailabilitySetsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AvailabilitySetsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AvailabilitySetsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *AvailabilitySetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if availabilitySetName == "" {
+ return nil, errors.New("parameter availabilitySetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *AvailabilitySetsClient) getHandleResponse(resp *http.Response) (AvailabilitySetsClientGetResponse, error) {
+ result := AvailabilitySetsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil {
+ return AvailabilitySetsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists all availability sets in a resource group.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - options - AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.NewListPager
+// method.
+func (client *AvailabilitySetsClient) NewListPager(resourceGroupName string, options *AvailabilitySetsClientListOptions) *runtime.Pager[AvailabilitySetsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListResponse]{
+ More: func(page AvailabilitySetsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListResponse) (AvailabilitySetsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AvailabilitySetsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return AvailabilitySetsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *AvailabilitySetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *AvailabilitySetsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *AvailabilitySetsClient) listHandleResponse(resp *http.Response) (AvailabilitySetsClientListResponse, error) {
+ result := AvailabilitySetsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySetListResult); err != nil {
+ return AvailabilitySetsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAvailableSizesPager - Lists all available virtual machine sizes that can be used to create a new virtual machine
+// in an existing availability set.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - availabilitySetName - The name of the availability set.
+// - options - AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.NewListAvailableSizesPager
+// method.
+func (client *AvailabilitySetsClient) NewListAvailableSizesPager(resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientListAvailableSizesOptions) *runtime.Pager[AvailabilitySetsClientListAvailableSizesResponse] {
+ return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListAvailableSizesResponse]{
+ More: func(page AvailabilitySetsClientListAvailableSizesResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListAvailableSizesResponse) (AvailabilitySetsClientListAvailableSizesResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AvailabilitySetsClient.NewListAvailableSizesPager")
+ req, err := client.listAvailableSizesCreateRequest(ctx, resourceGroupName, availabilitySetName, options)
+ if err != nil {
+ return AvailabilitySetsClientListAvailableSizesResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AvailabilitySetsClientListAvailableSizesResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return AvailabilitySetsClientListAvailableSizesResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listAvailableSizesHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAvailableSizesCreateRequest creates the ListAvailableSizes request.
+func (client *AvailabilitySetsClient) listAvailableSizesCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, options *AvailabilitySetsClientListAvailableSizesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if availabilitySetName == "" {
+ return nil, errors.New("parameter availabilitySetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAvailableSizesHandleResponse handles the ListAvailableSizes response.
+func (client *AvailabilitySetsClient) listAvailableSizesHandleResponse(resp *http.Response) (AvailabilitySetsClientListAvailableSizesResponse, error) {
+ result := AvailabilitySetsClientListAvailableSizesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil {
+ return AvailabilitySetsClientListAvailableSizesResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListBySubscriptionPager - Lists all availability sets in a subscription.
+//
+// Generated from API version 2023-07-01
+// - options - AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager
+// method.
+func (client *AvailabilitySetsClient) NewListBySubscriptionPager(options *AvailabilitySetsClientListBySubscriptionOptions) *runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse] {
+ return runtime.NewPager(runtime.PagingHandler[AvailabilitySetsClientListBySubscriptionResponse]{
+ More: func(page AvailabilitySetsClientListBySubscriptionResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *AvailabilitySetsClientListBySubscriptionResponse) (AvailabilitySetsClientListBySubscriptionResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AvailabilitySetsClient.NewListBySubscriptionPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listBySubscriptionCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return AvailabilitySetsClientListBySubscriptionResponse{}, err
+ }
+ return client.listBySubscriptionHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listBySubscriptionCreateRequest creates the ListBySubscription request.
+func (client *AvailabilitySetsClient) listBySubscriptionCreateRequest(ctx context.Context, options *AvailabilitySetsClientListBySubscriptionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listBySubscriptionHandleResponse handles the ListBySubscription response.
+func (client *AvailabilitySetsClient) listBySubscriptionHandleResponse(resp *http.Response) (AvailabilitySetsClientListBySubscriptionResponse, error) {
+ result := AvailabilitySetsClientListBySubscriptionResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySetListResult); err != nil {
+ return AvailabilitySetsClientListBySubscriptionResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - Update an availability set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - availabilitySetName - The name of the availability set.
+// - parameters - Parameters supplied to the Update Availability Set operation.
+// - options - AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method.
+func (client *AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate, options *AvailabilitySetsClientUpdateOptions) (AvailabilitySetsClientUpdateResponse, error) {
+ var err error
+ const operationName = "AvailabilitySetsClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, availabilitySetName, parameters, options)
+ if err != nil {
+ return AvailabilitySetsClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AvailabilitySetsClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AvailabilitySetsClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *AvailabilitySetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate, options *AvailabilitySetsClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if availabilitySetName == "" {
+ return nil, errors.New("parameter availabilitySetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{availabilitySetName}", url.PathEscape(availabilitySetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *AvailabilitySetsClient) updateHandleResponse(resp *http.Response) (AvailabilitySetsClientUpdateResponse, error) {
+ result := AvailabilitySetsClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AvailabilitySet); err != nil {
+ return AvailabilitySetsClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.go
new file mode 100644
index 000000000..f88d006f4
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.go
@@ -0,0 +1,7 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+// This file enables 'go generate' to regenerate this specific SDK
+//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -alwaysSetBodyParamRequired resourcemanager/compute/armcompute
+
+package armcompute
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.go
new file mode 100644
index 000000000..246dbd2b5
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.go
@@ -0,0 +1,434 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// CapacityReservationGroupsClient contains the methods for the CapacityReservationGroups group.
+// Don't use this type directly, use NewCapacityReservationGroupsClient() instead.
+type CapacityReservationGroupsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewCapacityReservationGroupsClient creates a new instance of CapacityReservationGroupsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewCapacityReservationGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapacityReservationGroupsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &CapacityReservationGroupsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - The operation to create or update a capacity reservation group. When updating a capacity reservation group,
+// only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more
+// details.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - capacityReservationGroupName - The name of the capacity reservation group.
+// - parameters - Parameters supplied to the Create capacity reservation Group.
+// - options - CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate
+// method.
+func (client *CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup, options *CapacityReservationGroupsClientCreateOrUpdateOptions) (CapacityReservationGroupsClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "CapacityReservationGroupsClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, parameters, options)
+ if err != nil {
+ return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *CapacityReservationGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup, options *CapacityReservationGroupsClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if capacityReservationGroupName == "" {
+ return nil, errors.New("parameter capacityReservationGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *CapacityReservationGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (CapacityReservationGroupsClientCreateOrUpdateResponse, error) {
+ result := CapacityReservationGroupsClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil {
+ return CapacityReservationGroupsClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources
+// are disassociated from the reservation group and all capacity reservations under
+// the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - capacityReservationGroupName - The name of the capacity reservation group.
+// - options - CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete
+// method.
+func (client *CapacityReservationGroupsClient) Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientDeleteOptions) (CapacityReservationGroupsClientDeleteResponse, error) {
+ var err error
+ const operationName = "CapacityReservationGroupsClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options)
+ if err != nil {
+ return CapacityReservationGroupsClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CapacityReservationGroupsClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return CapacityReservationGroupsClientDeleteResponse{}, err
+ }
+ return CapacityReservationGroupsClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *CapacityReservationGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if capacityReservationGroupName == "" {
+ return nil, errors.New("parameter capacityReservationGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - The operation that retrieves information about a capacity reservation group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - capacityReservationGroupName - The name of the capacity reservation group.
+// - options - CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get
+// method.
+func (client *CapacityReservationGroupsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientGetOptions) (CapacityReservationGroupsClientGetResponse, error) {
+ var err error
+ const operationName = "CapacityReservationGroupsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options)
+ if err != nil {
+ return CapacityReservationGroupsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CapacityReservationGroupsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CapacityReservationGroupsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *CapacityReservationGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationGroupsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if capacityReservationGroupName == "" {
+ return nil, errors.New("parameter capacityReservationGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *CapacityReservationGroupsClient) getHandleResponse(resp *http.Response) (CapacityReservationGroupsClientGetResponse, error) {
+ result := CapacityReservationGroupsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil {
+ return CapacityReservationGroupsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Lists all of the capacity reservation groups in the specified resource group. Use the nextLink
+// property in the response to get the next page of capacity reservation groups.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - options - CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListByResourceGroupPager
+// method.
+func (client *CapacityReservationGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *CapacityReservationGroupsClientListByResourceGroupOptions) *runtime.Pager[CapacityReservationGroupsClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CapacityReservationGroupsClientListByResourceGroupResponse]{
+ More: func(page CapacityReservationGroupsClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CapacityReservationGroupsClientListByResourceGroupResponse) (CapacityReservationGroupsClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacityReservationGroupsClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return CapacityReservationGroupsClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *CapacityReservationGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CapacityReservationGroupsClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *CapacityReservationGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (CapacityReservationGroupsClientListByResourceGroupResponse, error) {
+ result := CapacityReservationGroupsClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroupListResult); err != nil {
+ return CapacityReservationGroupsClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListBySubscriptionPager - Lists all of the capacity reservation groups in the subscription. Use the nextLink property
+// in the response to get the next page of capacity reservation groups.
+//
+// Generated from API version 2023-07-01
+// - options - CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager
+// method.
+func (client *CapacityReservationGroupsClient) NewListBySubscriptionPager(options *CapacityReservationGroupsClientListBySubscriptionOptions) *runtime.Pager[CapacityReservationGroupsClientListBySubscriptionResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CapacityReservationGroupsClientListBySubscriptionResponse]{
+ More: func(page CapacityReservationGroupsClientListBySubscriptionResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CapacityReservationGroupsClientListBySubscriptionResponse) (CapacityReservationGroupsClientListBySubscriptionResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacityReservationGroupsClient.NewListBySubscriptionPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listBySubscriptionCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return CapacityReservationGroupsClientListBySubscriptionResponse{}, err
+ }
+ return client.listBySubscriptionHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listBySubscriptionCreateRequest creates the ListBySubscription request.
+func (client *CapacityReservationGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *CapacityReservationGroupsClientListBySubscriptionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listBySubscriptionHandleResponse handles the ListBySubscription response.
+func (client *CapacityReservationGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (CapacityReservationGroupsClientListBySubscriptionResponse, error) {
+ result := CapacityReservationGroupsClientListBySubscriptionResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroupListResult); err != nil {
+ return CapacityReservationGroupsClientListBySubscriptionResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - The operation to update a capacity reservation group. When updating a capacity reservation group, only tags may
+// be modified.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - capacityReservationGroupName - The name of the capacity reservation group.
+// - parameters - Parameters supplied to the Update capacity reservation Group operation.
+// - options - CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update
+// method.
+func (client *CapacityReservationGroupsClient) Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate, options *CapacityReservationGroupsClientUpdateOptions) (CapacityReservationGroupsClientUpdateResponse, error) {
+ var err error
+ const operationName = "CapacityReservationGroupsClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, parameters, options)
+ if err != nil {
+ return CapacityReservationGroupsClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CapacityReservationGroupsClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CapacityReservationGroupsClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *CapacityReservationGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate, options *CapacityReservationGroupsClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if capacityReservationGroupName == "" {
+ return nil, errors.New("parameter capacityReservationGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *CapacityReservationGroupsClient) updateHandleResponse(resp *http.Response) (CapacityReservationGroupsClientUpdateResponse, error) {
+ result := CapacityReservationGroupsClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationGroup); err != nil {
+ return CapacityReservationGroupsClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.go
new file mode 100644
index 000000000..3b76610c7
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.go
@@ -0,0 +1,443 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// CapacityReservationsClient contains the methods for the CapacityReservations group.
+// Don't use this type directly, use NewCapacityReservationsClient() instead.
+type CapacityReservationsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewCapacityReservationsClient creates a new instance of CapacityReservationsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewCapacityReservationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapacityReservationsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &CapacityReservationsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - The operation to create or update a capacity reservation. Please note some properties can be set
+// only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more
+// details.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - capacityReservationGroupName - The name of the capacity reservation group.
+// - capacityReservationName - The name of the capacity reservation.
+// - parameters - Parameters supplied to the Create capacity reservation.
+// - options - CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate
+// method.
+func (client *CapacityReservationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[CapacityReservationsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CapacityReservationsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CapacityReservationsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - The operation to create or update a capacity reservation. Please note some properties can be set only
+// during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more
+// details.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *CapacityReservationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CapacityReservationsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *CapacityReservationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if capacityReservationGroupName == "" {
+ return nil, errors.New("parameter capacityReservationGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName))
+ if capacityReservationName == "" {
+ return nil, errors.New("parameter capacityReservationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - The operation to delete a capacity reservation. This operation is allowed only when all the associated resources
+// are disassociated from the capacity reservation. Please refer to
+// https://aka.ms/CapacityReservation for more details.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - capacityReservationGroupName - The name of the capacity reservation group.
+// - capacityReservationName - The name of the capacity reservation.
+// - options - CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete
+// method.
+func (client *CapacityReservationsClient) BeginDelete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*runtime.Poller[CapacityReservationsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CapacityReservationsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CapacityReservationsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - The operation to delete a capacity reservation. This operation is allowed only when all the associated resources
+// are disassociated from the capacity reservation. Please refer to
+// https://aka.ms/CapacityReservation for more details.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *CapacityReservationsClient) deleteOperation(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CapacityReservationsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *CapacityReservationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if capacityReservationGroupName == "" {
+ return nil, errors.New("parameter capacityReservationGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName))
+ if capacityReservationName == "" {
+ return nil, errors.New("parameter capacityReservationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - The operation that retrieves information about the capacity reservation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - capacityReservationGroupName - The name of the capacity reservation group.
+// - capacityReservationName - The name of the capacity reservation.
+// - options - CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get
+// method.
+func (client *CapacityReservationsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientGetOptions) (CapacityReservationsClientGetResponse, error) {
+ var err error
+ const operationName = "CapacityReservationsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, options)
+ if err != nil {
+ return CapacityReservationsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CapacityReservationsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CapacityReservationsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *CapacityReservationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if capacityReservationGroupName == "" {
+ return nil, errors.New("parameter capacityReservationGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName))
+ if capacityReservationName == "" {
+ return nil, errors.New("parameter capacityReservationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *CapacityReservationsClient) getHandleResponse(resp *http.Response) (CapacityReservationsClientGetResponse, error) {
+ result := CapacityReservationsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservation); err != nil {
+ return CapacityReservationsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByCapacityReservationGroupPager - Lists all of the capacity reservations in the specified capacity reservation group.
+// Use the nextLink property in the response to get the next page of capacity reservations.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - capacityReservationGroupName - The name of the capacity reservation group.
+// - options - CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.NewListByCapacityReservationGroupPager
+// method.
+func (client *CapacityReservationsClient) NewListByCapacityReservationGroupPager(resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationsClientListByCapacityReservationGroupOptions) *runtime.Pager[CapacityReservationsClientListByCapacityReservationGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CapacityReservationsClientListByCapacityReservationGroupResponse]{
+ More: func(page CapacityReservationsClientListByCapacityReservationGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CapacityReservationsClientListByCapacityReservationGroupResponse) (CapacityReservationsClientListByCapacityReservationGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CapacityReservationsClient.NewListByCapacityReservationGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByCapacityReservationGroupCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, options)
+ }, nil)
+ if err != nil {
+ return CapacityReservationsClientListByCapacityReservationGroupResponse{}, err
+ }
+ return client.listByCapacityReservationGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByCapacityReservationGroupCreateRequest creates the ListByCapacityReservationGroup request.
+func (client *CapacityReservationsClient) listByCapacityReservationGroupCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, options *CapacityReservationsClientListByCapacityReservationGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if capacityReservationGroupName == "" {
+ return nil, errors.New("parameter capacityReservationGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByCapacityReservationGroupHandleResponse handles the ListByCapacityReservationGroup response.
+func (client *CapacityReservationsClient) listByCapacityReservationGroupHandleResponse(resp *http.Response) (CapacityReservationsClientListByCapacityReservationGroupResponse, error) {
+ result := CapacityReservationsClientListByCapacityReservationGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CapacityReservationListResult); err != nil {
+ return CapacityReservationsClientListByCapacityReservationGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - The operation to update a capacity reservation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - capacityReservationGroupName - The name of the capacity reservation group.
+// - capacityReservationName - The name of the capacity reservation.
+// - parameters - Parameters supplied to the Update capacity reservation operation.
+// - options - CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate
+// method.
+func (client *CapacityReservationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*runtime.Poller[CapacityReservationsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CapacityReservationsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CapacityReservationsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - The operation to update a capacity reservation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *CapacityReservationsClient) update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CapacityReservationsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *CapacityReservationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if capacityReservationGroupName == "" {
+ return nil, errors.New("parameter capacityReservationGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationGroupName}", url.PathEscape(capacityReservationGroupName))
+ if capacityReservationName == "" {
+ return nil, errors.New("parameter capacityReservationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{capacityReservationName}", url.PathEscape(capacityReservationName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.yml
new file mode 100644
index 000000000..084ed1b49
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.yml
@@ -0,0 +1,28 @@
+# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
+trigger:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/compute/armcompute/
+
+pr:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/compute/armcompute/
+
+stages:
+- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
+ parameters:
+ IncludeRelease: true
+ ServiceDirectory: 'resourcemanager/compute/armcompute'
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.go
new file mode 100644
index 000000000..b8600b614
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.go
@@ -0,0 +1,333 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+)
+
+// ClientFactory is a client factory used to create any client in this module.
+// Don't use this type directly, use NewClientFactory instead.
+type ClientFactory struct {
+ subscriptionID string
+ credential azcore.TokenCredential
+ options *arm.ClientOptions
+}
+
+// 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 - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {
+ _, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ return &ClientFactory{
+ subscriptionID: subscriptionID, credential: credential,
+ options: options.Clone(),
+ }, nil
+}
+
+// NewAvailabilitySetsClient creates a new instance of AvailabilitySetsClient.
+func (c *ClientFactory) NewAvailabilitySetsClient() *AvailabilitySetsClient {
+ subClient, _ := NewAvailabilitySetsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewCapacityReservationGroupsClient creates a new instance of CapacityReservationGroupsClient.
+func (c *ClientFactory) NewCapacityReservationGroupsClient() *CapacityReservationGroupsClient {
+ subClient, _ := NewCapacityReservationGroupsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewCapacityReservationsClient creates a new instance of CapacityReservationsClient.
+func (c *ClientFactory) NewCapacityReservationsClient() *CapacityReservationsClient {
+ subClient, _ := NewCapacityReservationsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewCloudServiceOperatingSystemsClient creates a new instance of CloudServiceOperatingSystemsClient.
+func (c *ClientFactory) NewCloudServiceOperatingSystemsClient() *CloudServiceOperatingSystemsClient {
+ subClient, _ := NewCloudServiceOperatingSystemsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewCloudServiceRoleInstancesClient creates a new instance of CloudServiceRoleInstancesClient.
+func (c *ClientFactory) NewCloudServiceRoleInstancesClient() *CloudServiceRoleInstancesClient {
+ subClient, _ := NewCloudServiceRoleInstancesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewCloudServiceRolesClient creates a new instance of CloudServiceRolesClient.
+func (c *ClientFactory) NewCloudServiceRolesClient() *CloudServiceRolesClient {
+ subClient, _ := NewCloudServiceRolesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewCloudServicesClient creates a new instance of CloudServicesClient.
+func (c *ClientFactory) NewCloudServicesClient() *CloudServicesClient {
+ subClient, _ := NewCloudServicesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewCloudServicesUpdateDomainClient creates a new instance of CloudServicesUpdateDomainClient.
+func (c *ClientFactory) NewCloudServicesUpdateDomainClient() *CloudServicesUpdateDomainClient {
+ subClient, _ := NewCloudServicesUpdateDomainClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewCommunityGalleriesClient creates a new instance of CommunityGalleriesClient.
+func (c *ClientFactory) NewCommunityGalleriesClient() *CommunityGalleriesClient {
+ subClient, _ := NewCommunityGalleriesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewCommunityGalleryImageVersionsClient creates a new instance of CommunityGalleryImageVersionsClient.
+func (c *ClientFactory) NewCommunityGalleryImageVersionsClient() *CommunityGalleryImageVersionsClient {
+ subClient, _ := NewCommunityGalleryImageVersionsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewCommunityGalleryImagesClient creates a new instance of CommunityGalleryImagesClient.
+func (c *ClientFactory) NewCommunityGalleryImagesClient() *CommunityGalleryImagesClient {
+ subClient, _ := NewCommunityGalleryImagesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewDedicatedHostGroupsClient creates a new instance of DedicatedHostGroupsClient.
+func (c *ClientFactory) NewDedicatedHostGroupsClient() *DedicatedHostGroupsClient {
+ subClient, _ := NewDedicatedHostGroupsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewDedicatedHostsClient creates a new instance of DedicatedHostsClient.
+func (c *ClientFactory) NewDedicatedHostsClient() *DedicatedHostsClient {
+ subClient, _ := NewDedicatedHostsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewDiskAccessesClient creates a new instance of DiskAccessesClient.
+func (c *ClientFactory) NewDiskAccessesClient() *DiskAccessesClient {
+ subClient, _ := NewDiskAccessesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewDiskEncryptionSetsClient creates a new instance of DiskEncryptionSetsClient.
+func (c *ClientFactory) NewDiskEncryptionSetsClient() *DiskEncryptionSetsClient {
+ subClient, _ := NewDiskEncryptionSetsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewDiskRestorePointClient creates a new instance of DiskRestorePointClient.
+func (c *ClientFactory) NewDiskRestorePointClient() *DiskRestorePointClient {
+ subClient, _ := NewDiskRestorePointClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewDisksClient creates a new instance of DisksClient.
+func (c *ClientFactory) NewDisksClient() *DisksClient {
+ subClient, _ := NewDisksClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewGalleriesClient creates a new instance of GalleriesClient.
+func (c *ClientFactory) NewGalleriesClient() *GalleriesClient {
+ subClient, _ := NewGalleriesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewGalleryApplicationVersionsClient creates a new instance of GalleryApplicationVersionsClient.
+func (c *ClientFactory) NewGalleryApplicationVersionsClient() *GalleryApplicationVersionsClient {
+ subClient, _ := NewGalleryApplicationVersionsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewGalleryApplicationsClient creates a new instance of GalleryApplicationsClient.
+func (c *ClientFactory) NewGalleryApplicationsClient() *GalleryApplicationsClient {
+ subClient, _ := NewGalleryApplicationsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewGalleryImageVersionsClient creates a new instance of GalleryImageVersionsClient.
+func (c *ClientFactory) NewGalleryImageVersionsClient() *GalleryImageVersionsClient {
+ subClient, _ := NewGalleryImageVersionsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewGalleryImagesClient creates a new instance of GalleryImagesClient.
+func (c *ClientFactory) NewGalleryImagesClient() *GalleryImagesClient {
+ subClient, _ := NewGalleryImagesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewGallerySharingProfileClient creates a new instance of GallerySharingProfileClient.
+func (c *ClientFactory) NewGallerySharingProfileClient() *GallerySharingProfileClient {
+ subClient, _ := NewGallerySharingProfileClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewImagesClient creates a new instance of ImagesClient.
+func (c *ClientFactory) NewImagesClient() *ImagesClient {
+ subClient, _ := NewImagesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewLogAnalyticsClient creates a new instance of LogAnalyticsClient.
+func (c *ClientFactory) NewLogAnalyticsClient() *LogAnalyticsClient {
+ subClient, _ := NewLogAnalyticsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewOperationsClient creates a new instance of OperationsClient.
+func (c *ClientFactory) NewOperationsClient() *OperationsClient {
+ subClient, _ := NewOperationsClient(c.credential, c.options)
+ return subClient
+}
+
+// NewProximityPlacementGroupsClient creates a new instance of ProximityPlacementGroupsClient.
+func (c *ClientFactory) NewProximityPlacementGroupsClient() *ProximityPlacementGroupsClient {
+ subClient, _ := NewProximityPlacementGroupsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewResourceSKUsClient creates a new instance of ResourceSKUsClient.
+func (c *ClientFactory) NewResourceSKUsClient() *ResourceSKUsClient {
+ subClient, _ := NewResourceSKUsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewRestorePointCollectionsClient creates a new instance of RestorePointCollectionsClient.
+func (c *ClientFactory) NewRestorePointCollectionsClient() *RestorePointCollectionsClient {
+ subClient, _ := NewRestorePointCollectionsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewRestorePointsClient creates a new instance of RestorePointsClient.
+func (c *ClientFactory) NewRestorePointsClient() *RestorePointsClient {
+ subClient, _ := NewRestorePointsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewSSHPublicKeysClient creates a new instance of SSHPublicKeysClient.
+func (c *ClientFactory) NewSSHPublicKeysClient() *SSHPublicKeysClient {
+ subClient, _ := NewSSHPublicKeysClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewSharedGalleriesClient creates a new instance of SharedGalleriesClient.
+func (c *ClientFactory) NewSharedGalleriesClient() *SharedGalleriesClient {
+ subClient, _ := NewSharedGalleriesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewSharedGalleryImageVersionsClient creates a new instance of SharedGalleryImageVersionsClient.
+func (c *ClientFactory) NewSharedGalleryImageVersionsClient() *SharedGalleryImageVersionsClient {
+ subClient, _ := NewSharedGalleryImageVersionsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewSharedGalleryImagesClient creates a new instance of SharedGalleryImagesClient.
+func (c *ClientFactory) NewSharedGalleryImagesClient() *SharedGalleryImagesClient {
+ subClient, _ := NewSharedGalleryImagesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewSnapshotsClient creates a new instance of SnapshotsClient.
+func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient {
+ subClient, _ := NewSnapshotsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewUsageClient creates a new instance of UsageClient.
+func (c *ClientFactory) NewUsageClient() *UsageClient {
+ subClient, _ := NewUsageClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineExtensionImagesClient creates a new instance of VirtualMachineExtensionImagesClient.
+func (c *ClientFactory) NewVirtualMachineExtensionImagesClient() *VirtualMachineExtensionImagesClient {
+ subClient, _ := NewVirtualMachineExtensionImagesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineExtensionsClient creates a new instance of VirtualMachineExtensionsClient.
+func (c *ClientFactory) NewVirtualMachineExtensionsClient() *VirtualMachineExtensionsClient {
+ subClient, _ := NewVirtualMachineExtensionsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineImagesClient creates a new instance of VirtualMachineImagesClient.
+func (c *ClientFactory) NewVirtualMachineImagesClient() *VirtualMachineImagesClient {
+ subClient, _ := NewVirtualMachineImagesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineImagesEdgeZoneClient creates a new instance of VirtualMachineImagesEdgeZoneClient.
+func (c *ClientFactory) NewVirtualMachineImagesEdgeZoneClient() *VirtualMachineImagesEdgeZoneClient {
+ subClient, _ := NewVirtualMachineImagesEdgeZoneClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineRunCommandsClient creates a new instance of VirtualMachineRunCommandsClient.
+func (c *ClientFactory) NewVirtualMachineRunCommandsClient() *VirtualMachineRunCommandsClient {
+ subClient, _ := NewVirtualMachineRunCommandsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineScaleSetExtensionsClient creates a new instance of VirtualMachineScaleSetExtensionsClient.
+func (c *ClientFactory) NewVirtualMachineScaleSetExtensionsClient() *VirtualMachineScaleSetExtensionsClient {
+ subClient, _ := NewVirtualMachineScaleSetExtensionsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineScaleSetRollingUpgradesClient creates a new instance of VirtualMachineScaleSetRollingUpgradesClient.
+func (c *ClientFactory) NewVirtualMachineScaleSetRollingUpgradesClient() *VirtualMachineScaleSetRollingUpgradesClient {
+ subClient, _ := NewVirtualMachineScaleSetRollingUpgradesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineScaleSetVMExtensionsClient creates a new instance of VirtualMachineScaleSetVMExtensionsClient.
+func (c *ClientFactory) NewVirtualMachineScaleSetVMExtensionsClient() *VirtualMachineScaleSetVMExtensionsClient {
+ subClient, _ := NewVirtualMachineScaleSetVMExtensionsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineScaleSetVMRunCommandsClient creates a new instance of VirtualMachineScaleSetVMRunCommandsClient.
+func (c *ClientFactory) NewVirtualMachineScaleSetVMRunCommandsClient() *VirtualMachineScaleSetVMRunCommandsClient {
+ subClient, _ := NewVirtualMachineScaleSetVMRunCommandsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineScaleSetVMsClient creates a new instance of VirtualMachineScaleSetVMsClient.
+func (c *ClientFactory) NewVirtualMachineScaleSetVMsClient() *VirtualMachineScaleSetVMsClient {
+ subClient, _ := NewVirtualMachineScaleSetVMsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineScaleSetsClient creates a new instance of VirtualMachineScaleSetsClient.
+func (c *ClientFactory) NewVirtualMachineScaleSetsClient() *VirtualMachineScaleSetsClient {
+ subClient, _ := NewVirtualMachineScaleSetsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient.
+func (c *ClientFactory) NewVirtualMachineSizesClient() *VirtualMachineSizesClient {
+ subClient, _ := NewVirtualMachineSizesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewVirtualMachinesClient creates a new instance of VirtualMachinesClient.
+func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient {
+ subClient, _ := NewVirtualMachinesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.go
new file mode 100644
index 000000000..bd0cda902
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.go
@@ -0,0 +1,301 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// CloudServiceOperatingSystemsClient contains the methods for the CloudServiceOperatingSystems group.
+// Don't use this type directly, use NewCloudServiceOperatingSystemsClient() instead.
+type CloudServiceOperatingSystemsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewCloudServiceOperatingSystemsClient creates a new instance of CloudServiceOperatingSystemsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewCloudServiceOperatingSystemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceOperatingSystemsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &CloudServiceOperatingSystemsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// GetOSFamily - Gets properties of a guest operating system family that can be specified in the XML service configuration
+// (.cscfg) for a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - location - Name of the location that the OS family pertains to.
+// - osFamilyName - Name of the OS family.
+// - options - CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily
+// method.
+func (client *CloudServiceOperatingSystemsClient) GetOSFamily(ctx context.Context, location string, osFamilyName string, options *CloudServiceOperatingSystemsClientGetOSFamilyOptions) (CloudServiceOperatingSystemsClientGetOSFamilyResponse, error) {
+ var err error
+ const operationName = "CloudServiceOperatingSystemsClient.GetOSFamily"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getOSFamilyCreateRequest(ctx, location, osFamilyName, options)
+ if err != nil {
+ return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err
+ }
+ resp, err := client.getOSFamilyHandleResponse(httpResp)
+ return resp, err
+}
+
+// getOSFamilyCreateRequest creates the GetOSFamily request.
+func (client *CloudServiceOperatingSystemsClient) getOSFamilyCreateRequest(ctx context.Context, location string, osFamilyName string, options *CloudServiceOperatingSystemsClientGetOSFamilyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName}"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if osFamilyName == "" {
+ return nil, errors.New("parameter osFamilyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{osFamilyName}", url.PathEscape(osFamilyName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getOSFamilyHandleResponse handles the GetOSFamily response.
+func (client *CloudServiceOperatingSystemsClient) getOSFamilyHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientGetOSFamilyResponse, error) {
+ result := CloudServiceOperatingSystemsClientGetOSFamilyResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.OSFamily); err != nil {
+ return CloudServiceOperatingSystemsClientGetOSFamilyResponse{}, err
+ }
+ return result, nil
+}
+
+// GetOSVersion - Gets properties of a guest operating system version that can be specified in the XML service configuration
+// (.cscfg) for a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - location - Name of the location that the OS version pertains to.
+// - osVersionName - Name of the OS version.
+// - options - CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion
+// method.
+func (client *CloudServiceOperatingSystemsClient) GetOSVersion(ctx context.Context, location string, osVersionName string, options *CloudServiceOperatingSystemsClientGetOSVersionOptions) (CloudServiceOperatingSystemsClientGetOSVersionResponse, error) {
+ var err error
+ const operationName = "CloudServiceOperatingSystemsClient.GetOSVersion"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getOSVersionCreateRequest(ctx, location, osVersionName, options)
+ if err != nil {
+ return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err
+ }
+ resp, err := client.getOSVersionHandleResponse(httpResp)
+ return resp, err
+}
+
+// getOSVersionCreateRequest creates the GetOSVersion request.
+func (client *CloudServiceOperatingSystemsClient) getOSVersionCreateRequest(ctx context.Context, location string, osVersionName string, options *CloudServiceOperatingSystemsClientGetOSVersionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName}"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if osVersionName == "" {
+ return nil, errors.New("parameter osVersionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{osVersionName}", url.PathEscape(osVersionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getOSVersionHandleResponse handles the GetOSVersion response.
+func (client *CloudServiceOperatingSystemsClient) getOSVersionHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientGetOSVersionResponse, error) {
+ result := CloudServiceOperatingSystemsClientGetOSVersionResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.OSVersion); err != nil {
+ return CloudServiceOperatingSystemsClientGetOSVersionResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListOSFamiliesPager - Gets a list of all guest operating system families available to be specified in the XML service
+// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page
+// of OS Families. Do this till nextLink is null to fetch all the OS Families.
+//
+// Generated from API version 2022-09-04
+// - location - Name of the location that the OS families pertain to.
+// - options - CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSFamiliesPager
+// method.
+func (client *CloudServiceOperatingSystemsClient) NewListOSFamiliesPager(location string, options *CloudServiceOperatingSystemsClientListOSFamiliesOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSFamiliesResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CloudServiceOperatingSystemsClientListOSFamiliesResponse]{
+ More: func(page CloudServiceOperatingSystemsClientListOSFamiliesResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CloudServiceOperatingSystemsClientListOSFamiliesResponse) (CloudServiceOperatingSystemsClientListOSFamiliesResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceOperatingSystemsClient.NewListOSFamiliesPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listOSFamiliesCreateRequest(ctx, location, options)
+ }, nil)
+ if err != nil {
+ return CloudServiceOperatingSystemsClientListOSFamiliesResponse{}, err
+ }
+ return client.listOSFamiliesHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listOSFamiliesCreateRequest creates the ListOSFamilies request.
+func (client *CloudServiceOperatingSystemsClient) listOSFamiliesCreateRequest(ctx context.Context, location string, options *CloudServiceOperatingSystemsClientListOSFamiliesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listOSFamiliesHandleResponse handles the ListOSFamilies response.
+func (client *CloudServiceOperatingSystemsClient) listOSFamiliesHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientListOSFamiliesResponse, error) {
+ result := CloudServiceOperatingSystemsClientListOSFamiliesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.OSFamilyListResult); err != nil {
+ return CloudServiceOperatingSystemsClientListOSFamiliesResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListOSVersionsPager - Gets a list of all guest operating system versions available to be specified in the XML service
+// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page
+// of OS versions. Do this till nextLink is null to fetch all the OS versions.
+//
+// Generated from API version 2022-09-04
+// - location - Name of the location that the OS versions pertain to.
+// - options - CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSVersionsPager
+// method.
+func (client *CloudServiceOperatingSystemsClient) NewListOSVersionsPager(location string, options *CloudServiceOperatingSystemsClientListOSVersionsOptions) *runtime.Pager[CloudServiceOperatingSystemsClientListOSVersionsResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CloudServiceOperatingSystemsClientListOSVersionsResponse]{
+ More: func(page CloudServiceOperatingSystemsClientListOSVersionsResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CloudServiceOperatingSystemsClientListOSVersionsResponse) (CloudServiceOperatingSystemsClientListOSVersionsResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceOperatingSystemsClient.NewListOSVersionsPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listOSVersionsCreateRequest(ctx, location, options)
+ }, nil)
+ if err != nil {
+ return CloudServiceOperatingSystemsClientListOSVersionsResponse{}, err
+ }
+ return client.listOSVersionsHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listOSVersionsCreateRequest creates the ListOSVersions request.
+func (client *CloudServiceOperatingSystemsClient) listOSVersionsCreateRequest(ctx context.Context, location string, options *CloudServiceOperatingSystemsClientListOSVersionsOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listOSVersionsHandleResponse handles the ListOSVersions response.
+func (client *CloudServiceOperatingSystemsClient) listOSVersionsHandleResponse(resp *http.Response) (CloudServiceOperatingSystemsClientListOSVersionsResponse, error) {
+ result := CloudServiceOperatingSystemsClientListOSVersionsResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.OSVersionListResult); err != nil {
+ return CloudServiceOperatingSystemsClientListOSVersionsResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.go
new file mode 100644
index 000000000..b84530166
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.go
@@ -0,0 +1,648 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// CloudServiceRoleInstancesClient contains the methods for the CloudServiceRoleInstances group.
+// Don't use this type directly, use NewCloudServiceRoleInstancesClient() instead.
+type CloudServiceRoleInstancesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewCloudServiceRoleInstancesClient creates a new instance of CloudServiceRoleInstancesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewCloudServiceRoleInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceRoleInstancesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &CloudServiceRoleInstancesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginDelete - Deletes a role instance from a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - roleInstanceName - Name of the role instance.
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete
+// method.
+func (client *CloudServiceRoleInstancesClient) BeginDelete(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*runtime.Poller[CloudServiceRoleInstancesClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a role instance from a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServiceRoleInstancesClient) deleteOperation(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServiceRoleInstancesClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *CloudServiceRoleInstancesClient) deleteCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}"
+ if roleInstanceName == "" {
+ return nil, errors.New("parameter roleInstanceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets a role instance from a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - roleInstanceName - Name of the role instance.
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get
+// method.
+func (client *CloudServiceRoleInstancesClient) Get(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetOptions) (CloudServiceRoleInstancesClientGetResponse, error) {
+ var err error
+ const operationName = "CloudServiceRoleInstancesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return CloudServiceRoleInstancesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CloudServiceRoleInstancesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CloudServiceRoleInstancesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *CloudServiceRoleInstancesClient) getCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}"
+ if roleInstanceName == "" {
+ return nil, errors.New("parameter roleInstanceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *CloudServiceRoleInstancesClient) getHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientGetResponse, error) {
+ result := CloudServiceRoleInstancesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstance); err != nil {
+ return CloudServiceRoleInstancesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetInstanceView - Retrieves information about the run-time state of a role instance in a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - roleInstanceName - Name of the role instance.
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView
+// method.
+func (client *CloudServiceRoleInstancesClient) GetInstanceView(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetInstanceViewOptions) (CloudServiceRoleInstancesClientGetInstanceViewResponse, error) {
+ var err error
+ const operationName = "CloudServiceRoleInstancesClient.GetInstanceView"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getInstanceViewCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err
+ }
+ resp, err := client.getInstanceViewHandleResponse(httpResp)
+ return resp, err
+}
+
+// getInstanceViewCreateRequest creates the GetInstanceView request.
+func (client *CloudServiceRoleInstancesClient) getInstanceViewCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetInstanceViewOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView"
+ if roleInstanceName == "" {
+ return nil, errors.New("parameter roleInstanceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getInstanceViewHandleResponse handles the GetInstanceView response.
+func (client *CloudServiceRoleInstancesClient) getInstanceViewHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientGetInstanceViewResponse, error) {
+ result := CloudServiceRoleInstancesClientGetInstanceViewResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstanceView); err != nil {
+ return CloudServiceRoleInstancesClientGetInstanceViewResponse{}, err
+ }
+ return result, nil
+}
+
+// GetRemoteDesktopFile - Gets a remote desktop file for a role instance in a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - roleInstanceName - Name of the role instance.
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile
+// method.
+func (client *CloudServiceRoleInstancesClient) GetRemoteDesktopFile(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions) (CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse, error) {
+ var err error
+ const operationName = "CloudServiceRoleInstancesClient.GetRemoteDesktopFile"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getRemoteDesktopFileCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{}, err
+ }
+ return CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse{Body: httpResp.Body}, nil
+}
+
+// getRemoteDesktopFileCreateRequest creates the GetRemoteDesktopFile request.
+func (client *CloudServiceRoleInstancesClient) getRemoteDesktopFileCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile"
+ if roleInstanceName == "" {
+ return nil, errors.New("parameter roleInstanceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ runtime.SkipBodyDownload(req)
+ req.Raw().Header["Accept"] = []string{"application/x-rdp"}
+ return req, nil
+}
+
+// NewListPager - Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the
+// next page of role instances. Do this till nextLink is null to fetch all the role instances.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.NewListPager
+// method.
+func (client *CloudServiceRoleInstancesClient) NewListPager(resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientListOptions) *runtime.Pager[CloudServiceRoleInstancesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CloudServiceRoleInstancesClientListResponse]{
+ More: func(page CloudServiceRoleInstancesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CloudServiceRoleInstancesClientListResponse) (CloudServiceRoleInstancesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceRoleInstancesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ }, nil)
+ if err != nil {
+ return CloudServiceRoleInstancesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *CloudServiceRoleInstancesClient) listCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *CloudServiceRoleInstancesClient) listHandleResponse(resp *http.Response) (CloudServiceRoleInstancesClientListResponse, error) {
+ result := CloudServiceRoleInstancesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RoleInstanceListResult); err != nil {
+ return CloudServiceRoleInstancesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginRebuild - The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles
+// or worker roles and initializes the storage resources that are used by them. If you do not
+// want to initialize storage resources, you can use Reimage Role Instance.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - roleInstanceName - Name of the role instance.
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild
+// method.
+func (client *CloudServiceRoleInstancesClient) BeginRebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*runtime.Poller[CloudServiceRoleInstancesClientRebuildResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.rebuild(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientRebuildResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientRebuildResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Rebuild - The Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles or
+// worker roles and initializes the storage resources that are used by them. If you do not
+// want to initialize storage resources, you can use Reimage Role Instance.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServiceRoleInstancesClient) rebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServiceRoleInstancesClient.BeginRebuild"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.rebuildCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// rebuildCreateRequest creates the Rebuild request.
+func (client *CloudServiceRoleInstancesClient) rebuildCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild"
+ if roleInstanceName == "" {
+ return nil, errors.New("parameter roleInstanceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginReimage - The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles
+// or worker roles.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - roleInstanceName - Name of the role instance.
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage
+// method.
+func (client *CloudServiceRoleInstancesClient) BeginReimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*runtime.Poller[CloudServiceRoleInstancesClientReimageResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.reimage(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientReimageResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientReimageResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Reimage - The Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles or
+// worker roles.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServiceRoleInstancesClient) reimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServiceRoleInstancesClient.BeginReimage"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.reimageCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// reimageCreateRequest creates the Reimage request.
+func (client *CloudServiceRoleInstancesClient) reimageCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage"
+ if roleInstanceName == "" {
+ return nil, errors.New("parameter roleInstanceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginRestart - The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - roleInstanceName - Name of the role instance.
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart
+// method.
+func (client *CloudServiceRoleInstancesClient) BeginRestart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*runtime.Poller[CloudServiceRoleInstancesClientRestartResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.restart(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServiceRoleInstancesClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServiceRoleInstancesClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Restart - The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServiceRoleInstancesClient) restart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServiceRoleInstancesClient.BeginRestart"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.restartCreateRequest(ctx, roleInstanceName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// restartCreateRequest creates the Restart request.
+func (client *CloudServiceRoleInstancesClient) restartCreateRequest(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart"
+ if roleInstanceName == "" {
+ return nil, errors.New("parameter roleInstanceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{roleInstanceName}", url.PathEscape(roleInstanceName))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.go
new file mode 100644
index 000000000..a4572cf14
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.go
@@ -0,0 +1,180 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// CloudServiceRolesClient contains the methods for the CloudServiceRoles group.
+// Don't use this type directly, use NewCloudServiceRolesClient() instead.
+type CloudServiceRolesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewCloudServiceRolesClient creates a new instance of CloudServiceRolesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewCloudServiceRolesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServiceRolesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &CloudServiceRolesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Gets a role from a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - roleName - Name of the role.
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method.
+func (client *CloudServiceRolesClient) Get(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientGetOptions) (CloudServiceRolesClientGetResponse, error) {
+ var err error
+ const operationName = "CloudServiceRolesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, roleName, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return CloudServiceRolesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CloudServiceRolesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CloudServiceRolesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *CloudServiceRolesClient) getCreateRequest(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}"
+ if roleName == "" {
+ return nil, errors.New("parameter roleName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{roleName}", url.PathEscape(roleName))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *CloudServiceRolesClient) getHandleResponse(resp *http.Response) (CloudServiceRolesClientGetResponse, error) {
+ result := CloudServiceRolesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceRole); err != nil {
+ return CloudServiceRolesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page
+// of roles. Do this till nextLink is null to fetch all the roles.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.NewListPager
+// method.
+func (client *CloudServiceRolesClient) NewListPager(resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientListOptions) *runtime.Pager[CloudServiceRolesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CloudServiceRolesClientListResponse]{
+ More: func(page CloudServiceRolesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CloudServiceRolesClientListResponse) (CloudServiceRolesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServiceRolesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ }, nil)
+ if err != nil {
+ return CloudServiceRolesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *CloudServiceRolesClient) listCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServiceRolesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *CloudServiceRolesClient) listHandleResponse(resp *http.Response) (CloudServiceRolesClientListResponse, error) {
+ result := CloudServiceRolesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceRoleListResult); err != nil {
+ return CloudServiceRolesClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.go
new file mode 100644
index 000000000..283d3a6fe
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.go
@@ -0,0 +1,1013 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// CloudServicesClient contains the methods for the CloudServices group.
+// Don't use this type directly, use NewCloudServicesClient() instead.
+type CloudServicesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewCloudServicesClient creates a new instance of CloudServicesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewCloudServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServicesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &CloudServicesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Create or update a cloud service. Please note some properties can be set only during cloud service
+// creation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - parameters - The cloud service object.
+// - options - CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate
+// method.
+func (client *CloudServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudService, options *CloudServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[CloudServicesClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, cloudServiceName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Create or update a cloud service. Please note some properties can be set only during cloud service creation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudService, options *CloudServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServicesClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, cloudServiceName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *CloudServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudService, options *CloudServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete
+// method.
+func (client *CloudServicesClient) BeginDelete(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*runtime.Poller[CloudServicesClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServicesClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *CloudServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginDeleteInstances - Deletes role instances in a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances
+// method.
+func (client *CloudServicesClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*runtime.Poller[CloudServicesClientDeleteInstancesResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteInstances(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientDeleteInstancesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientDeleteInstancesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// DeleteInstances - Deletes role instances in a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServicesClient) deleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServicesClient.BeginDeleteInstances"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteInstancesCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteInstancesCreateRequest creates the DeleteInstances request.
+func (client *CloudServicesClient) deleteInstancesCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/delete"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// Get - Display information about a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method.
+func (client *CloudServicesClient) Get(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetOptions) (CloudServicesClientGetResponse, error) {
+ var err error
+ const operationName = "CloudServicesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return CloudServicesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CloudServicesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CloudServicesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *CloudServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *CloudServicesClient) getHandleResponse(resp *http.Response) (CloudServicesClientGetResponse, error) {
+ result := CloudServicesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CloudService); err != nil {
+ return CloudServicesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetInstanceView - Gets the status of a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView
+// method.
+func (client *CloudServicesClient) GetInstanceView(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetInstanceViewOptions) (CloudServicesClientGetInstanceViewResponse, error) {
+ var err error
+ const operationName = "CloudServicesClient.GetInstanceView"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return CloudServicesClientGetInstanceViewResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CloudServicesClientGetInstanceViewResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CloudServicesClientGetInstanceViewResponse{}, err
+ }
+ resp, err := client.getInstanceViewHandleResponse(httpResp)
+ return resp, err
+}
+
+// getInstanceViewCreateRequest creates the GetInstanceView request.
+func (client *CloudServicesClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientGetInstanceViewOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getInstanceViewHandleResponse handles the GetInstanceView response.
+func (client *CloudServicesClient) getInstanceViewHandleResponse(resp *http.Response) (CloudServicesClientGetInstanceViewResponse, error) {
+ result := CloudServicesClientGetInstanceViewResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceInstanceView); err != nil {
+ return CloudServicesClientGetInstanceViewResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the
+// next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - options - CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.NewListPager method.
+func (client *CloudServicesClient) NewListPager(resourceGroupName string, options *CloudServicesClientListOptions) *runtime.Pager[CloudServicesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CloudServicesClientListResponse]{
+ More: func(page CloudServicesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CloudServicesClientListResponse) (CloudServicesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServicesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return CloudServicesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *CloudServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *CloudServicesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *CloudServicesClient) listHandleResponse(resp *http.Response) (CloudServicesClientListResponse, error) {
+ result := CloudServicesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceListResult); err != nil {
+ return CloudServicesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAllPager - Gets a list of all cloud services in the subscription, regardless of the associated resource group. Use
+// nextLink property in the response to get the next page of Cloud Services. Do this till nextLink
+// is null to fetch all the Cloud Services.
+//
+// Generated from API version 2022-09-04
+// - options - CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.NewListAllPager
+// method.
+func (client *CloudServicesClient) NewListAllPager(options *CloudServicesClientListAllOptions) *runtime.Pager[CloudServicesClientListAllResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CloudServicesClientListAllResponse]{
+ More: func(page CloudServicesClientListAllResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CloudServicesClientListAllResponse) (CloudServicesClientListAllResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServicesClient.NewListAllPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAllCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return CloudServicesClientListAllResponse{}, err
+ }
+ return client.listAllHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAllCreateRequest creates the ListAll request.
+func (client *CloudServicesClient) listAllCreateRequest(ctx context.Context, options *CloudServicesClientListAllOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAllHandleResponse handles the ListAll response.
+func (client *CloudServicesClient) listAllHandleResponse(resp *http.Response) (CloudServicesClientListAllResponse, error) {
+ result := CloudServicesClientListAllResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CloudServiceListResult); err != nil {
+ return CloudServicesClientListAllResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginPowerOff - Power off the cloud service. Note that resources are still attached and you are getting charged for the
+// resources.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff
+// method.
+func (client *CloudServicesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*runtime.Poller[CloudServicesClientPowerOffResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.powerOff(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientPowerOffResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientPowerOffResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// PowerOff - Power off the cloud service. Note that resources are still attached and you are getting charged for the resources.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServicesClient) powerOff(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServicesClient.BeginPowerOff"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.powerOffCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// powerOffCreateRequest creates the PowerOff request.
+func (client *CloudServicesClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginRebuild - Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes
+// the storage resources that are used by them. If you do not want to initialize storage
+// resources, you can use Reimage Role Instances.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild
+// method.
+func (client *CloudServicesClient) BeginRebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*runtime.Poller[CloudServicesClientRebuildResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.rebuild(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientRebuildResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientRebuildResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Rebuild - Rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and initializes
+// the storage resources that are used by them. If you do not want to initialize storage
+// resources, you can use Reimage Role Instances.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServicesClient) rebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServicesClient.BeginRebuild"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.rebuildCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// rebuildCreateRequest creates the Rebuild request.
+func (client *CloudServicesClient) rebuildCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/rebuild"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginReimage - Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage
+// method.
+func (client *CloudServicesClient) BeginReimage(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*runtime.Poller[CloudServicesClientReimageResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.reimage(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientReimageResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientReimageResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Reimage - Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServicesClient) reimage(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServicesClient.BeginReimage"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.reimageCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// reimageCreateRequest creates the Reimage request.
+func (client *CloudServicesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/reimage"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginRestart - Restarts one or more role instances in a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart
+// method.
+func (client *CloudServicesClient) BeginRestart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*runtime.Poller[CloudServicesClientRestartResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.restart(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Restart - Restarts one or more role instances in a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServicesClient) restart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServicesClient.BeginRestart"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.restartCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// restartCreateRequest creates the Restart request.
+func (client *CloudServicesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/restart"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginStart - Starts the cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart
+// method.
+func (client *CloudServicesClient) BeginStart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*runtime.Poller[CloudServicesClientStartResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.start(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientStartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientStartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Start - Starts the cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServicesClient) start(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServicesClient.BeginStart"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.startCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// startCreateRequest creates the Start request.
+func (client *CloudServicesClient) startCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginUpdate - Update a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - parameters - The cloud service object.
+// - options - CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate
+// method.
+func (client *CloudServicesClient) BeginUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudServiceUpdate, options *CloudServicesClientBeginUpdateOptions) (*runtime.Poller[CloudServicesClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, cloudServiceName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update a cloud service.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServicesClient) update(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudServiceUpdate, options *CloudServicesClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServicesClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, cloudServiceName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *CloudServicesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudServiceUpdate, options *CloudServicesClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.go
new file mode 100644
index 000000000..a4bd1e7b1
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.go
@@ -0,0 +1,263 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// CloudServicesUpdateDomainClient contains the methods for the CloudServicesUpdateDomain group.
+// Don't use this type directly, use NewCloudServicesUpdateDomainClient() instead.
+type CloudServicesUpdateDomainClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewCloudServicesUpdateDomainClient creates a new instance of CloudServicesUpdateDomainClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewCloudServicesUpdateDomainClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CloudServicesUpdateDomainClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &CloudServicesUpdateDomainClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// GetUpdateDomain - Gets the specified update domain of a cloud service. Use nextLink property in the response to get the
+// next page of update domains. Do this till nextLink is null to fetch all the update domains.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based
+// index: the first update domain has an ID of 0, the second has an ID of 1, and so on.
+// - options - CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain
+// method.
+func (client *CloudServicesUpdateDomainClient) GetUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientGetUpdateDomainOptions) (CloudServicesUpdateDomainClientGetUpdateDomainResponse, error) {
+ var err error
+ const operationName = "CloudServicesUpdateDomainClient.GetUpdateDomain"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getUpdateDomainCreateRequest(ctx, resourceGroupName, cloudServiceName, updateDomain, options)
+ if err != nil {
+ return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err
+ }
+ resp, err := client.getUpdateDomainHandleResponse(httpResp)
+ return resp, err
+}
+
+// getUpdateDomainCreateRequest creates the GetUpdateDomain request.
+func (client *CloudServicesUpdateDomainClient) getUpdateDomainCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, options *CloudServicesUpdateDomainClientGetUpdateDomainOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ urlPath = strings.ReplaceAll(urlPath, "{updateDomain}", url.PathEscape(strconv.FormatInt(int64(updateDomain), 10)))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getUpdateDomainHandleResponse handles the GetUpdateDomain response.
+func (client *CloudServicesUpdateDomainClient) getUpdateDomainHandleResponse(resp *http.Response) (CloudServicesUpdateDomainClientGetUpdateDomainResponse, error) {
+ result := CloudServicesUpdateDomainClientGetUpdateDomainResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.UpdateDomain); err != nil {
+ return CloudServicesUpdateDomainClientGetUpdateDomainResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListUpdateDomainsPager - Gets a list of all update domains in a cloud service.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - options - CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.NewListUpdateDomainsPager
+// method.
+func (client *CloudServicesUpdateDomainClient) NewListUpdateDomainsPager(resourceGroupName string, cloudServiceName string, options *CloudServicesUpdateDomainClientListUpdateDomainsOptions) *runtime.Pager[CloudServicesUpdateDomainClientListUpdateDomainsResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CloudServicesUpdateDomainClientListUpdateDomainsResponse]{
+ More: func(page CloudServicesUpdateDomainClientListUpdateDomainsResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CloudServicesUpdateDomainClientListUpdateDomainsResponse) (CloudServicesUpdateDomainClientListUpdateDomainsResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CloudServicesUpdateDomainClient.NewListUpdateDomainsPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listUpdateDomainsCreateRequest(ctx, resourceGroupName, cloudServiceName, options)
+ }, nil)
+ if err != nil {
+ return CloudServicesUpdateDomainClientListUpdateDomainsResponse{}, err
+ }
+ return client.listUpdateDomainsHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listUpdateDomainsCreateRequest creates the ListUpdateDomains request.
+func (client *CloudServicesUpdateDomainClient) listUpdateDomainsCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesUpdateDomainClientListUpdateDomainsOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listUpdateDomainsHandleResponse handles the ListUpdateDomains response.
+func (client *CloudServicesUpdateDomainClient) listUpdateDomainsHandleResponse(resp *http.Response) (CloudServicesUpdateDomainClientListUpdateDomainsResponse, error) {
+ result := CloudServicesUpdateDomainClientListUpdateDomainsResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.UpdateDomainListResult); err != nil {
+ return CloudServicesUpdateDomainClientListUpdateDomainsResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginWalkUpdateDomain - Updates the role instances in the specified update domain.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+// - resourceGroupName - Name of the resource group.
+// - cloudServiceName - Name of the cloud service.
+// - updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based
+// index: the first update domain has an ID of 0, the second has an ID of 1, and so on.
+// - parameters - The update domain object.
+// - options - CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain
+// method.
+func (client *CloudServicesUpdateDomainClient) BeginWalkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters UpdateDomain, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*runtime.Poller[CloudServicesUpdateDomainClientWalkUpdateDomainResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.walkUpdateDomain(ctx, resourceGroupName, cloudServiceName, updateDomain, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CloudServicesUpdateDomainClientWalkUpdateDomainResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[CloudServicesUpdateDomainClientWalkUpdateDomainResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// WalkUpdateDomain - Updates the role instances in the specified update domain.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-09-04
+func (client *CloudServicesUpdateDomainClient) walkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters UpdateDomain, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*http.Response, error) {
+ var err error
+ const operationName = "CloudServicesUpdateDomainClient.BeginWalkUpdateDomain"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.walkUpdateDomainCreateRequest(ctx, resourceGroupName, cloudServiceName, updateDomain, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// walkUpdateDomainCreateRequest creates the WalkUpdateDomain request.
+func (client *CloudServicesUpdateDomainClient) walkUpdateDomainCreateRequest(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters UpdateDomain, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if cloudServiceName == "" {
+ return nil, errors.New("parameter cloudServiceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{cloudServiceName}", url.PathEscape(cloudServiceName))
+ urlPath = strings.ReplaceAll(urlPath, "{updateDomain}", url.PathEscape(strconv.FormatInt(int64(updateDomain), 10)))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-09-04")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.go
new file mode 100644
index 000000000..3cda3a9d0
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.go
@@ -0,0 +1,109 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// CommunityGalleriesClient contains the methods for the CommunityGalleries group.
+// Don't use this type directly, use NewCommunityGalleriesClient() instead.
+type CommunityGalleriesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewCommunityGalleriesClient creates a new instance of CommunityGalleriesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewCommunityGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleriesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &CommunityGalleriesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Get a community gallery by gallery public name.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - location - Resource location.
+// - publicGalleryName - The public name of the community gallery.
+// - options - CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method.
+func (client *CommunityGalleriesClient) Get(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleriesClientGetOptions) (CommunityGalleriesClientGetResponse, error) {
+ var err error
+ const operationName = "CommunityGalleriesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, location, publicGalleryName, options)
+ if err != nil {
+ return CommunityGalleriesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CommunityGalleriesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CommunityGalleriesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *CommunityGalleriesClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleriesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publicGalleryName == "" {
+ return nil, errors.New("parameter publicGalleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *CommunityGalleriesClient) getHandleResponse(resp *http.Response) (CommunityGalleriesClientGetResponse, error) {
+ result := CommunityGalleriesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGallery); err != nil {
+ return CommunityGalleriesClientGetResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.go
new file mode 100644
index 000000000..8d1c8c534
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.go
@@ -0,0 +1,180 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// CommunityGalleryImagesClient contains the methods for the CommunityGalleryImages group.
+// Don't use this type directly, use NewCommunityGalleryImagesClient() instead.
+type CommunityGalleryImagesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewCommunityGalleryImagesClient creates a new instance of CommunityGalleryImagesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewCommunityGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleryImagesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &CommunityGalleryImagesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Get a community gallery image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - location - Resource location.
+// - publicGalleryName - The public name of the community gallery.
+// - galleryImageName - The name of the community gallery image definition.
+// - options - CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get
+// method.
+func (client *CommunityGalleryImagesClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImagesClientGetOptions) (CommunityGalleryImagesClientGetResponse, error) {
+ var err error
+ const operationName = "CommunityGalleryImagesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, location, publicGalleryName, galleryImageName, options)
+ if err != nil {
+ return CommunityGalleryImagesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CommunityGalleryImagesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CommunityGalleryImagesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *CommunityGalleryImagesClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImagesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publicGalleryName == "" {
+ return nil, errors.New("parameter publicGalleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *CommunityGalleryImagesClient) getHandleResponse(resp *http.Response) (CommunityGalleryImagesClientGetResponse, error) {
+ result := CommunityGalleryImagesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImage); err != nil {
+ return CommunityGalleryImagesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List community gallery images inside a gallery.
+//
+// Generated from API version 2022-03-03
+// - location - Resource location.
+// - publicGalleryName - The public name of the community gallery.
+// - options - CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.NewListPager
+// method.
+func (client *CommunityGalleryImagesClient) NewListPager(location string, publicGalleryName string, options *CommunityGalleryImagesClientListOptions) *runtime.Pager[CommunityGalleryImagesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CommunityGalleryImagesClientListResponse]{
+ More: func(page CommunityGalleryImagesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CommunityGalleryImagesClientListResponse) (CommunityGalleryImagesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommunityGalleryImagesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, location, publicGalleryName, options)
+ }, nil)
+ if err != nil {
+ return CommunityGalleryImagesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *CommunityGalleryImagesClient) listCreateRequest(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleryImagesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publicGalleryName == "" {
+ return nil, errors.New("parameter publicGalleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *CommunityGalleryImagesClient) listHandleResponse(resp *http.Response) (CommunityGalleryImagesClientListResponse, error) {
+ result := CommunityGalleryImagesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageList); err != nil {
+ return CommunityGalleryImagesClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.go
new file mode 100644
index 000000000..f1c46f849
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.go
@@ -0,0 +1,192 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// CommunityGalleryImageVersionsClient contains the methods for the CommunityGalleryImageVersions group.
+// Don't use this type directly, use NewCommunityGalleryImageVersionsClient() instead.
+type CommunityGalleryImageVersionsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewCommunityGalleryImageVersionsClient creates a new instance of CommunityGalleryImageVersionsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewCommunityGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CommunityGalleryImageVersionsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &CommunityGalleryImageVersionsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Get a community gallery image version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - location - Resource location.
+// - publicGalleryName - The public name of the community gallery.
+// - galleryImageName - The name of the community gallery image definition.
+// - galleryImageVersionName - The name of the community gallery image version. Needs to follow semantic version name pattern:
+// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer.
+// Format: ..
+// - options - CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get
+// method.
+func (client *CommunityGalleryImageVersionsClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string, options *CommunityGalleryImageVersionsClientGetOptions) (CommunityGalleryImageVersionsClientGetResponse, error) {
+ var err error
+ const operationName = "CommunityGalleryImageVersionsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, location, publicGalleryName, galleryImageName, galleryImageVersionName, options)
+ if err != nil {
+ return CommunityGalleryImageVersionsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return CommunityGalleryImageVersionsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return CommunityGalleryImageVersionsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *CommunityGalleryImageVersionsClient) getCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string, options *CommunityGalleryImageVersionsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publicGalleryName == "" {
+ return nil, errors.New("parameter publicGalleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ if galleryImageVersionName == "" {
+ return nil, errors.New("parameter galleryImageVersionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *CommunityGalleryImageVersionsClient) getHandleResponse(resp *http.Response) (CommunityGalleryImageVersionsClientGetResponse, error) {
+ result := CommunityGalleryImageVersionsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageVersion); err != nil {
+ return CommunityGalleryImageVersionsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List community gallery image versions inside an image.
+//
+// Generated from API version 2022-03-03
+// - location - Resource location.
+// - publicGalleryName - The public name of the community gallery.
+// - galleryImageName - The name of the community gallery image definition.
+// - options - CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.NewListPager
+// method.
+func (client *CommunityGalleryImageVersionsClient) NewListPager(location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImageVersionsClientListOptions) *runtime.Pager[CommunityGalleryImageVersionsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[CommunityGalleryImageVersionsClientListResponse]{
+ More: func(page CommunityGalleryImageVersionsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *CommunityGalleryImageVersionsClientListResponse) (CommunityGalleryImageVersionsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CommunityGalleryImageVersionsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, location, publicGalleryName, galleryImageName, options)
+ }, nil)
+ if err != nil {
+ return CommunityGalleryImageVersionsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *CommunityGalleryImageVersionsClient) listCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImageVersionsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publicGalleryName == "" {
+ return nil, errors.New("parameter publicGalleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *CommunityGalleryImageVersionsClient) listHandleResponse(resp *http.Response) (CommunityGalleryImageVersionsClientListResponse, error) {
+ result := CommunityGalleryImageVersionsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageVersionList); err != nil {
+ return CommunityGalleryImageVersionsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.go
new file mode 100644
index 000000000..4554f9355
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.go
@@ -0,0 +1,2717 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+const (
+ moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute"
+ moduleVersion = "v5.3.0"
+)
+
+type AccessLevel string
+
+const (
+ AccessLevelNone AccessLevel = "None"
+ AccessLevelRead AccessLevel = "Read"
+ AccessLevelWrite AccessLevel = "Write"
+)
+
+// PossibleAccessLevelValues returns the possible values for the AccessLevel const type.
+func PossibleAccessLevelValues() []AccessLevel {
+ return []AccessLevel{
+ AccessLevelNone,
+ AccessLevelRead,
+ AccessLevelWrite,
+ }
+}
+
+// AggregatedReplicationState - This is the aggregated replication status based on all the regional replication status flags.
+type AggregatedReplicationState string
+
+const (
+ AggregatedReplicationStateCompleted AggregatedReplicationState = "Completed"
+ AggregatedReplicationStateFailed AggregatedReplicationState = "Failed"
+ AggregatedReplicationStateInProgress AggregatedReplicationState = "InProgress"
+ AggregatedReplicationStateUnknown AggregatedReplicationState = "Unknown"
+)
+
+// PossibleAggregatedReplicationStateValues returns the possible values for the AggregatedReplicationState const type.
+func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState {
+ return []AggregatedReplicationState{
+ AggregatedReplicationStateCompleted,
+ AggregatedReplicationStateFailed,
+ AggregatedReplicationStateInProgress,
+ AggregatedReplicationStateUnknown,
+ }
+}
+
+// AlternativeType - Describes the type of the alternative option.
+type AlternativeType string
+
+const (
+ AlternativeTypeNone AlternativeType = "None"
+ AlternativeTypeOffer AlternativeType = "Offer"
+ AlternativeTypePlan AlternativeType = "Plan"
+)
+
+// PossibleAlternativeTypeValues returns the possible values for the AlternativeType const type.
+func PossibleAlternativeTypeValues() []AlternativeType {
+ return []AlternativeType{
+ AlternativeTypeNone,
+ AlternativeTypeOffer,
+ AlternativeTypePlan,
+ }
+}
+
+// Architecture - The architecture of the image. Applicable to OS disks only.
+type Architecture string
+
+const (
+ ArchitectureArm64 Architecture = "Arm64"
+ ArchitectureX64 Architecture = "x64"
+)
+
+// PossibleArchitectureValues returns the possible values for the Architecture const type.
+func PossibleArchitectureValues() []Architecture {
+ return []Architecture{
+ ArchitectureArm64,
+ ArchitectureX64,
+ }
+}
+
+// ArchitectureTypes - Specifies the Architecture Type
+type ArchitectureTypes string
+
+const (
+ ArchitectureTypesArm64 ArchitectureTypes = "Arm64"
+ ArchitectureTypesX64 ArchitectureTypes = "x64"
+)
+
+// PossibleArchitectureTypesValues returns the possible values for the ArchitectureTypes const type.
+func PossibleArchitectureTypesValues() []ArchitectureTypes {
+ return []ArchitectureTypes{
+ ArchitectureTypesArm64,
+ ArchitectureTypesX64,
+ }
+}
+
+// AvailabilitySetSKUTypes - Specifies the sku of an Availability Set. Use 'Aligned' for virtual machines with managed disks
+// and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'.
+type AvailabilitySetSKUTypes string
+
+const (
+ AvailabilitySetSKUTypesAligned AvailabilitySetSKUTypes = "Aligned"
+ AvailabilitySetSKUTypesClassic AvailabilitySetSKUTypes = "Classic"
+)
+
+// PossibleAvailabilitySetSKUTypesValues returns the possible values for the AvailabilitySetSKUTypes const type.
+func PossibleAvailabilitySetSKUTypesValues() []AvailabilitySetSKUTypes {
+ return []AvailabilitySetSKUTypes{
+ AvailabilitySetSKUTypesAligned,
+ AvailabilitySetSKUTypesClassic,
+ }
+}
+
+// CachingTypes - Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are:
+// None for Standard storage. ReadOnly for Premium storage
+type CachingTypes string
+
+const (
+ CachingTypesNone CachingTypes = "None"
+ CachingTypesReadOnly CachingTypes = "ReadOnly"
+ CachingTypesReadWrite CachingTypes = "ReadWrite"
+)
+
+// PossibleCachingTypesValues returns the possible values for the CachingTypes const type.
+func PossibleCachingTypesValues() []CachingTypes {
+ return []CachingTypes{
+ CachingTypesNone,
+ CachingTypesReadOnly,
+ CachingTypesReadWrite,
+ }
+}
+
+type CapacityReservationGroupInstanceViewTypes string
+
+const (
+ CapacityReservationGroupInstanceViewTypesInstanceView CapacityReservationGroupInstanceViewTypes = "instanceView"
+)
+
+// PossibleCapacityReservationGroupInstanceViewTypesValues returns the possible values for the CapacityReservationGroupInstanceViewTypes const type.
+func PossibleCapacityReservationGroupInstanceViewTypesValues() []CapacityReservationGroupInstanceViewTypes {
+ return []CapacityReservationGroupInstanceViewTypes{
+ CapacityReservationGroupInstanceViewTypesInstanceView,
+ }
+}
+
+type CapacityReservationInstanceViewTypes string
+
+const (
+ CapacityReservationInstanceViewTypesInstanceView CapacityReservationInstanceViewTypes = "instanceView"
+)
+
+// PossibleCapacityReservationInstanceViewTypesValues returns the possible values for the CapacityReservationInstanceViewTypes const type.
+func PossibleCapacityReservationInstanceViewTypesValues() []CapacityReservationInstanceViewTypes {
+ return []CapacityReservationInstanceViewTypes{
+ CapacityReservationInstanceViewTypesInstanceView,
+ }
+}
+
+// CloudServiceSlotType - Slot type for the cloud service. Possible values are
+// Production
+// Staging
+// If not specified, the default value is Production.
+type CloudServiceSlotType string
+
+const (
+ CloudServiceSlotTypeProduction CloudServiceSlotType = "Production"
+ CloudServiceSlotTypeStaging CloudServiceSlotType = "Staging"
+)
+
+// PossibleCloudServiceSlotTypeValues returns the possible values for the CloudServiceSlotType const type.
+func PossibleCloudServiceSlotTypeValues() []CloudServiceSlotType {
+ return []CloudServiceSlotType{
+ CloudServiceSlotTypeProduction,
+ CloudServiceSlotTypeStaging,
+ }
+}
+
+// CloudServiceUpgradeMode - Update mode for the cloud service. Role instances are allocated to update domains when the service
+// is deployed. Updates can be initiated manually in each update domain or initiated automatically in
+// all update domains. Possible Values are
+// Auto
+// Manual
+// Simultaneous
+// If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If
+// set to Auto, the update is automatically applied to each update domain in
+// sequence.
+type CloudServiceUpgradeMode string
+
+const (
+ CloudServiceUpgradeModeAuto CloudServiceUpgradeMode = "Auto"
+ CloudServiceUpgradeModeManual CloudServiceUpgradeMode = "Manual"
+ CloudServiceUpgradeModeSimultaneous CloudServiceUpgradeMode = "Simultaneous"
+)
+
+// PossibleCloudServiceUpgradeModeValues returns the possible values for the CloudServiceUpgradeMode const type.
+func PossibleCloudServiceUpgradeModeValues() []CloudServiceUpgradeMode {
+ return []CloudServiceUpgradeMode{
+ CloudServiceUpgradeModeAuto,
+ CloudServiceUpgradeModeManual,
+ CloudServiceUpgradeModeSimultaneous,
+ }
+}
+
+// ConfidentialVMEncryptionType - confidential VM encryption types
+type ConfidentialVMEncryptionType string
+
+const (
+ ConfidentialVMEncryptionTypeEncryptedVMGuestStateOnlyWithPmk ConfidentialVMEncryptionType = "EncryptedVMGuestStateOnlyWithPmk"
+ ConfidentialVMEncryptionTypeEncryptedWithCmk ConfidentialVMEncryptionType = "EncryptedWithCmk"
+ ConfidentialVMEncryptionTypeEncryptedWithPmk ConfidentialVMEncryptionType = "EncryptedWithPmk"
+)
+
+// PossibleConfidentialVMEncryptionTypeValues returns the possible values for the ConfidentialVMEncryptionType const type.
+func PossibleConfidentialVMEncryptionTypeValues() []ConfidentialVMEncryptionType {
+ return []ConfidentialVMEncryptionType{
+ ConfidentialVMEncryptionTypeEncryptedVMGuestStateOnlyWithPmk,
+ ConfidentialVMEncryptionTypeEncryptedWithCmk,
+ ConfidentialVMEncryptionTypeEncryptedWithPmk,
+ }
+}
+
+// ConsistencyModeTypes - ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point.
+// For now, only CrashConsistent is accepted as a valid input. Please refer to
+// https://aka.ms/RestorePoints for more details.
+type ConsistencyModeTypes string
+
+const (
+ ConsistencyModeTypesApplicationConsistent ConsistencyModeTypes = "ApplicationConsistent"
+ ConsistencyModeTypesCrashConsistent ConsistencyModeTypes = "CrashConsistent"
+ ConsistencyModeTypesFileSystemConsistent ConsistencyModeTypes = "FileSystemConsistent"
+)
+
+// PossibleConsistencyModeTypesValues returns the possible values for the ConsistencyModeTypes const type.
+func PossibleConsistencyModeTypesValues() []ConsistencyModeTypes {
+ return []ConsistencyModeTypes{
+ ConsistencyModeTypesApplicationConsistent,
+ ConsistencyModeTypesCrashConsistent,
+ ConsistencyModeTypesFileSystemConsistent,
+ }
+}
+
+// CopyCompletionErrorReason - Indicates the error code if the background copy of a resource created via the CopyStart operation
+// fails.
+type CopyCompletionErrorReason string
+
+const (
+ // CopyCompletionErrorReasonCopySourceNotFound - Indicates that the source snapshot was deleted while the background copy
+ // of the resource created via CopyStart operation was in progress.
+ CopyCompletionErrorReasonCopySourceNotFound CopyCompletionErrorReason = "CopySourceNotFound"
+)
+
+// PossibleCopyCompletionErrorReasonValues returns the possible values for the CopyCompletionErrorReason const type.
+func PossibleCopyCompletionErrorReasonValues() []CopyCompletionErrorReason {
+ return []CopyCompletionErrorReason{
+ CopyCompletionErrorReasonCopySourceNotFound,
+ }
+}
+
+// DataAccessAuthMode - Additional authentication requirements when exporting or uploading to a disk or snapshot.
+type DataAccessAuthMode string
+
+const (
+ // DataAccessAuthModeAzureActiveDirectory - When export/upload URL is used, the system checks if the user has an identity
+ // in Azure Active Directory and has necessary permissions to export/upload the data. Please refer to aka.ms/DisksAzureADAuth.
+ DataAccessAuthModeAzureActiveDirectory DataAccessAuthMode = "AzureActiveDirectory"
+ // DataAccessAuthModeNone - No additional authentication would be performed when accessing export/upload URL.
+ DataAccessAuthModeNone DataAccessAuthMode = "None"
+)
+
+// PossibleDataAccessAuthModeValues returns the possible values for the DataAccessAuthMode const type.
+func PossibleDataAccessAuthModeValues() []DataAccessAuthMode {
+ return []DataAccessAuthMode{
+ DataAccessAuthModeAzureActiveDirectory,
+ DataAccessAuthModeNone,
+ }
+}
+
+// DedicatedHostLicenseTypes - Specifies the software license type that will be applied to the VMs deployed on the dedicated
+// host. Possible values are: None, WindowsServerHybrid, WindowsServerPerpetual. The default value is: None.
+type DedicatedHostLicenseTypes string
+
+const (
+ DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None"
+ DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid"
+ DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual"
+)
+
+// PossibleDedicatedHostLicenseTypesValues returns the possible values for the DedicatedHostLicenseTypes const type.
+func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes {
+ return []DedicatedHostLicenseTypes{
+ DedicatedHostLicenseTypesNone,
+ DedicatedHostLicenseTypesWindowsServerHybrid,
+ DedicatedHostLicenseTypesWindowsServerPerpetual,
+ }
+}
+
+// DeleteOptions - Specify what happens to the network interface when the VM is deleted
+type DeleteOptions string
+
+const (
+ DeleteOptionsDelete DeleteOptions = "Delete"
+ DeleteOptionsDetach DeleteOptions = "Detach"
+)
+
+// PossibleDeleteOptionsValues returns the possible values for the DeleteOptions const type.
+func PossibleDeleteOptionsValues() []DeleteOptions {
+ return []DeleteOptions{
+ DeleteOptionsDelete,
+ DeleteOptionsDetach,
+ }
+}
+
+// DiffDiskOptions - Specifies the ephemeral disk option for operating system disk.
+type DiffDiskOptions string
+
+const (
+ DiffDiskOptionsLocal DiffDiskOptions = "Local"
+)
+
+// PossibleDiffDiskOptionsValues returns the possible values for the DiffDiskOptions const type.
+func PossibleDiffDiskOptionsValues() []DiffDiskOptions {
+ return []DiffDiskOptions{
+ DiffDiskOptionsLocal,
+ }
+}
+
+// DiffDiskPlacement - Specifies the ephemeral disk placement for operating system disk. This property can be used by user
+// in the request to choose the location i.e, cache disk or resource disk space for Ephemeral OS disk
+// provisioning. For more information on Ephemeral OS disk size requirements, please refer Ephemeral OS disk size requirements
+// for Windows VM at
+// https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at
+// https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements
+type DiffDiskPlacement string
+
+const (
+ DiffDiskPlacementCacheDisk DiffDiskPlacement = "CacheDisk"
+ DiffDiskPlacementResourceDisk DiffDiskPlacement = "ResourceDisk"
+)
+
+// PossibleDiffDiskPlacementValues returns the possible values for the DiffDiskPlacement const type.
+func PossibleDiffDiskPlacementValues() []DiffDiskPlacement {
+ return []DiffDiskPlacement{
+ DiffDiskPlacementCacheDisk,
+ DiffDiskPlacementResourceDisk,
+ }
+}
+
+// DiskControllerTypes - Specifies the disk controller type configured for the VM and VirtualMachineScaleSet. This property
+// is only supported for virtual machines whose operating system disk and VM sku supports Generation 2
+// (https://docs.microsoft.com/en-us/azure/virtual-machines/generation-2), please check the HyperVGenerations capability returned
+// as part of VM sku capabilities in the response of Microsoft.Compute SKUs
+// api for the region contains V2 (https://docs.microsoft.com/rest/api/compute/resourceskus/list). For more information about
+// Disk Controller Types supported please refer to
+// https://aka.ms/azure-diskcontrollertypes.
+type DiskControllerTypes string
+
+const (
+ DiskControllerTypesNVMe DiskControllerTypes = "NVMe"
+ DiskControllerTypesSCSI DiskControllerTypes = "SCSI"
+)
+
+// PossibleDiskControllerTypesValues returns the possible values for the DiskControllerTypes const type.
+func PossibleDiskControllerTypesValues() []DiskControllerTypes {
+ return []DiskControllerTypes{
+ DiskControllerTypesNVMe,
+ DiskControllerTypesSCSI,
+ }
+}
+
+// DiskCreateOption - This enumerates the possible sources of a disk's creation.
+type DiskCreateOption string
+
+const (
+ // DiskCreateOptionAttach - Disk will be attached to a VM.
+ DiskCreateOptionAttach DiskCreateOption = "Attach"
+ // DiskCreateOptionCopy - Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId.
+ DiskCreateOptionCopy DiskCreateOption = "Copy"
+ // DiskCreateOptionCopyFromSanSnapshot - Create a new disk by exporting from elastic san volume snapshot
+ DiskCreateOptionCopyFromSanSnapshot DiskCreateOption = "CopyFromSanSnapshot"
+ // DiskCreateOptionCopyStart - Create a new disk by using a deep copy process, where the resource creation is considered complete
+ // only after all data has been copied from the source.
+ DiskCreateOptionCopyStart DiskCreateOption = "CopyStart"
+ // DiskCreateOptionEmpty - Create an empty data disk of a size given by diskSizeGB.
+ DiskCreateOptionEmpty DiskCreateOption = "Empty"
+ // DiskCreateOptionFromImage - Create a new disk from a platform image specified by the given imageReference or galleryImageReference.
+ DiskCreateOptionFromImage DiskCreateOption = "FromImage"
+ // DiskCreateOptionImport - Create a disk by importing from a blob specified by a sourceUri in a storage account specified
+ // by storageAccountId.
+ DiskCreateOptionImport DiskCreateOption = "Import"
+ // DiskCreateOptionImportSecure - Similar to Import create option. Create a new Trusted Launch VM or Confidential VM supported
+ // disk by importing additional blob for VM guest state specified by securityDataUri in storage account specified by storageAccountId
+ DiskCreateOptionImportSecure DiskCreateOption = "ImportSecure"
+ // DiskCreateOptionRestore - Create a new disk by copying from a backup recovery point.
+ DiskCreateOptionRestore DiskCreateOption = "Restore"
+ // DiskCreateOptionUpload - Create a new disk by obtaining a write token and using it to directly upload the contents of the
+ // disk.
+ DiskCreateOptionUpload DiskCreateOption = "Upload"
+ // DiskCreateOptionUploadPreparedSecure - Similar to Upload create option. Create a new Trusted Launch VM or Confidential
+ // VM supported disk and upload using write token in both disk and VM guest state
+ DiskCreateOptionUploadPreparedSecure DiskCreateOption = "UploadPreparedSecure"
+)
+
+// PossibleDiskCreateOptionValues returns the possible values for the DiskCreateOption const type.
+func PossibleDiskCreateOptionValues() []DiskCreateOption {
+ return []DiskCreateOption{
+ DiskCreateOptionAttach,
+ DiskCreateOptionCopy,
+ DiskCreateOptionCopyFromSanSnapshot,
+ DiskCreateOptionCopyStart,
+ DiskCreateOptionEmpty,
+ DiskCreateOptionFromImage,
+ DiskCreateOptionImport,
+ DiskCreateOptionImportSecure,
+ DiskCreateOptionRestore,
+ DiskCreateOptionUpload,
+ DiskCreateOptionUploadPreparedSecure,
+ }
+}
+
+// DiskCreateOptionTypes - Specifies how the virtual machine should be created. Possible values are: Attach. This value is
+// used when you are using a specialized disk to create the virtual machine. FromImage. This value is used
+// when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference
+// element described above. If you are using a marketplace image, you also
+// use the plan element previously described.
+type DiskCreateOptionTypes string
+
+const (
+ DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach"
+ DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty"
+ DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage"
+)
+
+// PossibleDiskCreateOptionTypesValues returns the possible values for the DiskCreateOptionTypes const type.
+func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes {
+ return []DiskCreateOptionTypes{
+ DiskCreateOptionTypesAttach,
+ DiskCreateOptionTypesEmpty,
+ DiskCreateOptionTypesFromImage,
+ }
+}
+
+// DiskDeleteOptionTypes - Specifies the behavior of the managed disk when the VM gets deleted, for example whether the managed
+// disk is deleted or detached. Supported values are: Delete. If this value is used, the managed disk
+// is deleted when VM gets deleted. Detach. If this value is used, the managed disk is retained after VM gets deleted. Minimum
+// api-version: 2021-03-01.
+type DiskDeleteOptionTypes string
+
+const (
+ DiskDeleteOptionTypesDelete DiskDeleteOptionTypes = "Delete"
+ DiskDeleteOptionTypesDetach DiskDeleteOptionTypes = "Detach"
+)
+
+// PossibleDiskDeleteOptionTypesValues returns the possible values for the DiskDeleteOptionTypes const type.
+func PossibleDiskDeleteOptionTypesValues() []DiskDeleteOptionTypes {
+ return []DiskDeleteOptionTypes{
+ DiskDeleteOptionTypesDelete,
+ DiskDeleteOptionTypesDetach,
+ }
+}
+
+// DiskDetachOptionTypes - Specifies the detach behavior to be used while detaching a disk or which is already in the process
+// of detachment from the virtual machine. Supported values are: ForceDetach. detachOption: ForceDetach
+// is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an
+// unexpected failure from the virtual machine and the disk is still not released
+// then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed
+// when using this detach behavior. This feature is still in preview mode and
+// is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting
+// detachOption: 'ForceDetach'.
+type DiskDetachOptionTypes string
+
+const (
+ DiskDetachOptionTypesForceDetach DiskDetachOptionTypes = "ForceDetach"
+)
+
+// PossibleDiskDetachOptionTypesValues returns the possible values for the DiskDetachOptionTypes const type.
+func PossibleDiskDetachOptionTypesValues() []DiskDetachOptionTypes {
+ return []DiskDetachOptionTypes{
+ DiskDetachOptionTypesForceDetach,
+ }
+}
+
+// DiskEncryptionSetIdentityType - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported
+// for new creations. Disk Encryption Sets can be updated with Identity type None during migration of
+// subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys.
+type DiskEncryptionSetIdentityType string
+
+const (
+ DiskEncryptionSetIdentityTypeNone DiskEncryptionSetIdentityType = "None"
+ DiskEncryptionSetIdentityTypeSystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned"
+ DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned DiskEncryptionSetIdentityType = "SystemAssigned, UserAssigned"
+ DiskEncryptionSetIdentityTypeUserAssigned DiskEncryptionSetIdentityType = "UserAssigned"
+)
+
+// PossibleDiskEncryptionSetIdentityTypeValues returns the possible values for the DiskEncryptionSetIdentityType const type.
+func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType {
+ return []DiskEncryptionSetIdentityType{
+ DiskEncryptionSetIdentityTypeNone,
+ DiskEncryptionSetIdentityTypeSystemAssigned,
+ DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned,
+ DiskEncryptionSetIdentityTypeUserAssigned,
+ }
+}
+
+// DiskEncryptionSetType - The type of key used to encrypt the data of the disk.
+type DiskEncryptionSetType string
+
+const (
+ // DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey - Confidential VM supported disk and VM guest state would be
+ // encrypted with customer managed key.
+ DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetType = "ConfidentialVmEncryptedWithCustomerKey"
+ // DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey - Resource using diskEncryptionSet would be encrypted at rest with
+ // Customer managed key that can be changed and revoked by a customer.
+ DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey DiskEncryptionSetType = "EncryptionAtRestWithCustomerKey"
+ // DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys - Resource using diskEncryptionSet would be encrypted
+ // at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed.
+ DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys DiskEncryptionSetType = "EncryptionAtRestWithPlatformAndCustomerKeys"
+)
+
+// PossibleDiskEncryptionSetTypeValues returns the possible values for the DiskEncryptionSetType const type.
+func PossibleDiskEncryptionSetTypeValues() []DiskEncryptionSetType {
+ return []DiskEncryptionSetType{
+ DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey,
+ DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey,
+ DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys,
+ }
+}
+
+// DiskSecurityTypes - Specifies the SecurityType of the VM. Applicable for OS disks only.
+type DiskSecurityTypes string
+
+const (
+ // DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey - Indicates Confidential VM disk with both OS disk and VM guest
+ // state encrypted with a customer managed key
+ DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithCustomerKey"
+ // DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey - Indicates Confidential VM disk with both OS disk and VM guest
+ // state encrypted with a platform managed key
+ DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithPlatformKey"
+ // DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey - Indicates Confidential VM disk with only VM guest
+ // state encrypted
+ DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey"
+ // DiskSecurityTypesTrustedLaunch - Trusted Launch provides security features such as secure boot and virtual Trusted Platform
+ // Module (vTPM)
+ DiskSecurityTypesTrustedLaunch DiskSecurityTypes = "TrustedLaunch"
+)
+
+// PossibleDiskSecurityTypesValues returns the possible values for the DiskSecurityTypes const type.
+func PossibleDiskSecurityTypesValues() []DiskSecurityTypes {
+ return []DiskSecurityTypes{
+ DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey,
+ DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey,
+ DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey,
+ DiskSecurityTypesTrustedLaunch,
+ }
+}
+
+// DiskState - This enumerates the possible state of the disk.
+type DiskState string
+
+const (
+ // DiskStateActiveSAS - The disk currently has an Active SAS Uri associated with it.
+ DiskStateActiveSAS DiskState = "ActiveSAS"
+ // DiskStateActiveSASFrozen - The disk is attached to a VM in hibernated state and has an active SAS URI associated with it.
+ DiskStateActiveSASFrozen DiskState = "ActiveSASFrozen"
+ // DiskStateActiveUpload - A disk is created for upload and a write token has been issued for uploading to it.
+ DiskStateActiveUpload DiskState = "ActiveUpload"
+ // DiskStateAttached - The disk is currently attached to a running VM.
+ DiskStateAttached DiskState = "Attached"
+ // DiskStateFrozen - The disk is attached to a VM which is in hibernated state.
+ DiskStateFrozen DiskState = "Frozen"
+ // DiskStateReadyToUpload - A disk is ready to be created by upload by requesting a write token.
+ DiskStateReadyToUpload DiskState = "ReadyToUpload"
+ // DiskStateReserved - The disk is attached to a stopped-deallocated VM.
+ DiskStateReserved DiskState = "Reserved"
+ // DiskStateUnattached - The disk is not being used and can be attached to a VM.
+ DiskStateUnattached DiskState = "Unattached"
+)
+
+// PossibleDiskStateValues returns the possible values for the DiskState const type.
+func PossibleDiskStateValues() []DiskState {
+ return []DiskState{
+ DiskStateActiveSAS,
+ DiskStateActiveSASFrozen,
+ DiskStateActiveUpload,
+ DiskStateAttached,
+ DiskStateFrozen,
+ DiskStateReadyToUpload,
+ DiskStateReserved,
+ DiskStateUnattached,
+ }
+}
+
+// DiskStorageAccountTypes - The sku name.
+type DiskStorageAccountTypes string
+
+const (
+ // DiskStorageAccountTypesPremiumLRS - Premium SSD locally redundant storage. Best for production and performance sensitive
+ // workloads.
+ DiskStorageAccountTypesPremiumLRS DiskStorageAccountTypes = "Premium_LRS"
+ // DiskStorageAccountTypesPremiumV2LRS - Premium SSD v2 locally redundant storage. Best for production and performance-sensitive
+ // workloads that consistently require low latency and high IOPS and throughput.
+ DiskStorageAccountTypesPremiumV2LRS DiskStorageAccountTypes = "PremiumV2_LRS"
+ // DiskStorageAccountTypesPremiumZRS - Premium SSD zone redundant storage. Best for the production workloads that need storage
+ // resiliency against zone failures.
+ DiskStorageAccountTypesPremiumZRS DiskStorageAccountTypes = "Premium_ZRS"
+ // DiskStorageAccountTypesStandardLRS - Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent
+ // access.
+ DiskStorageAccountTypesStandardLRS DiskStorageAccountTypes = "Standard_LRS"
+ // DiskStorageAccountTypesStandardSSDLRS - Standard SSD locally redundant storage. Best for web servers, lightly used enterprise
+ // applications and dev/test.
+ DiskStorageAccountTypesStandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS"
+ // DiskStorageAccountTypesStandardSSDZRS - Standard SSD zone redundant storage. Best for web servers, lightly used enterprise
+ // applications and dev/test that need storage resiliency against zone failures.
+ DiskStorageAccountTypesStandardSSDZRS DiskStorageAccountTypes = "StandardSSD_ZRS"
+ // DiskStorageAccountTypesUltraSSDLRS - Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA,
+ // top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads.
+ DiskStorageAccountTypesUltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS"
+)
+
+// PossibleDiskStorageAccountTypesValues returns the possible values for the DiskStorageAccountTypes const type.
+func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes {
+ return []DiskStorageAccountTypes{
+ DiskStorageAccountTypesPremiumLRS,
+ DiskStorageAccountTypesPremiumV2LRS,
+ DiskStorageAccountTypesPremiumZRS,
+ DiskStorageAccountTypesStandardLRS,
+ DiskStorageAccountTypesStandardSSDLRS,
+ DiskStorageAccountTypesStandardSSDZRS,
+ DiskStorageAccountTypesUltraSSDLRS,
+ }
+}
+
+// DomainNameLabelScopeTypes - The Domain name label scope.The concatenation of the hashed domain name label that generated
+// according to the policy from domain name label scope and vm index will be the domain name labels of the
+// PublicIPAddress resources that will be created
+type DomainNameLabelScopeTypes string
+
+const (
+ DomainNameLabelScopeTypesNoReuse DomainNameLabelScopeTypes = "NoReuse"
+ DomainNameLabelScopeTypesResourceGroupReuse DomainNameLabelScopeTypes = "ResourceGroupReuse"
+ DomainNameLabelScopeTypesSubscriptionReuse DomainNameLabelScopeTypes = "SubscriptionReuse"
+ DomainNameLabelScopeTypesTenantReuse DomainNameLabelScopeTypes = "TenantReuse"
+)
+
+// PossibleDomainNameLabelScopeTypesValues returns the possible values for the DomainNameLabelScopeTypes const type.
+func PossibleDomainNameLabelScopeTypesValues() []DomainNameLabelScopeTypes {
+ return []DomainNameLabelScopeTypes{
+ DomainNameLabelScopeTypesNoReuse,
+ DomainNameLabelScopeTypesResourceGroupReuse,
+ DomainNameLabelScopeTypesSubscriptionReuse,
+ DomainNameLabelScopeTypesTenantReuse,
+ }
+}
+
+// EdgeZoneStorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable.
+type EdgeZoneStorageAccountType string
+
+const (
+ EdgeZoneStorageAccountTypePremiumLRS EdgeZoneStorageAccountType = "Premium_LRS"
+ EdgeZoneStorageAccountTypeStandardLRS EdgeZoneStorageAccountType = "Standard_LRS"
+ EdgeZoneStorageAccountTypeStandardSSDLRS EdgeZoneStorageAccountType = "StandardSSD_LRS"
+ EdgeZoneStorageAccountTypeStandardZRS EdgeZoneStorageAccountType = "Standard_ZRS"
+)
+
+// PossibleEdgeZoneStorageAccountTypeValues returns the possible values for the EdgeZoneStorageAccountType const type.
+func PossibleEdgeZoneStorageAccountTypeValues() []EdgeZoneStorageAccountType {
+ return []EdgeZoneStorageAccountType{
+ EdgeZoneStorageAccountTypePremiumLRS,
+ EdgeZoneStorageAccountTypeStandardLRS,
+ EdgeZoneStorageAccountTypeStandardSSDLRS,
+ EdgeZoneStorageAccountTypeStandardZRS,
+ }
+}
+
+// EncryptionType - The type of key used to encrypt the data of the disk.
+type EncryptionType string
+
+const (
+ // EncryptionTypeEncryptionAtRestWithCustomerKey - Disk is encrypted at rest with Customer managed key that can be changed
+ // and revoked by a customer.
+ EncryptionTypeEncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey"
+ // EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys - Disk is encrypted at rest with 2 layers of encryption. One
+ // of the keys is Customer managed and the other key is Platform managed.
+ EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys EncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys"
+ // EncryptionTypeEncryptionAtRestWithPlatformKey - Disk is encrypted at rest with Platform managed key. It is the default
+ // encryption type. This is not a valid encryption type for disk encryption sets.
+ EncryptionTypeEncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey"
+)
+
+// PossibleEncryptionTypeValues returns the possible values for the EncryptionType const type.
+func PossibleEncryptionTypeValues() []EncryptionType {
+ return []EncryptionType{
+ EncryptionTypeEncryptionAtRestWithCustomerKey,
+ EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys,
+ EncryptionTypeEncryptionAtRestWithPlatformKey,
+ }
+}
+
+// ExecutionState - Script execution status.
+type ExecutionState string
+
+const (
+ ExecutionStateCanceled ExecutionState = "Canceled"
+ ExecutionStateFailed ExecutionState = "Failed"
+ ExecutionStatePending ExecutionState = "Pending"
+ ExecutionStateRunning ExecutionState = "Running"
+ ExecutionStateSucceeded ExecutionState = "Succeeded"
+ ExecutionStateTimedOut ExecutionState = "TimedOut"
+ ExecutionStateUnknown ExecutionState = "Unknown"
+)
+
+// PossibleExecutionStateValues returns the possible values for the ExecutionState const type.
+func PossibleExecutionStateValues() []ExecutionState {
+ return []ExecutionState{
+ ExecutionStateCanceled,
+ ExecutionStateFailed,
+ ExecutionStatePending,
+ ExecutionStateRunning,
+ ExecutionStateSucceeded,
+ ExecutionStateTimedOut,
+ ExecutionStateUnknown,
+ }
+}
+
+type ExpandTypeForListVMs string
+
+const (
+ ExpandTypeForListVMsInstanceView ExpandTypeForListVMs = "instanceView"
+)
+
+// PossibleExpandTypeForListVMsValues returns the possible values for the ExpandTypeForListVMs const type.
+func PossibleExpandTypeForListVMsValues() []ExpandTypeForListVMs {
+ return []ExpandTypeForListVMs{
+ ExpandTypeForListVMsInstanceView,
+ }
+}
+
+type ExpandTypesForGetCapacityReservationGroups string
+
+const (
+ ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsRef ExpandTypesForGetCapacityReservationGroups = "virtualMachineScaleSetVMs/$ref"
+ ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef ExpandTypesForGetCapacityReservationGroups = "virtualMachines/$ref"
+)
+
+// PossibleExpandTypesForGetCapacityReservationGroupsValues returns the possible values for the ExpandTypesForGetCapacityReservationGroups const type.
+func PossibleExpandTypesForGetCapacityReservationGroupsValues() []ExpandTypesForGetCapacityReservationGroups {
+ return []ExpandTypesForGetCapacityReservationGroups{
+ ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsRef,
+ ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef,
+ }
+}
+
+type ExpandTypesForGetVMScaleSets string
+
+const (
+ ExpandTypesForGetVMScaleSetsUserData ExpandTypesForGetVMScaleSets = "userData"
+)
+
+// PossibleExpandTypesForGetVMScaleSetsValues returns the possible values for the ExpandTypesForGetVMScaleSets const type.
+func PossibleExpandTypesForGetVMScaleSetsValues() []ExpandTypesForGetVMScaleSets {
+ return []ExpandTypesForGetVMScaleSets{
+ ExpandTypesForGetVMScaleSetsUserData,
+ }
+}
+
+type ExpandTypesForListVMs string
+
+const (
+ ExpandTypesForListVMsInstanceView ExpandTypesForListVMs = "instanceView"
+)
+
+// PossibleExpandTypesForListVMsValues returns the possible values for the ExpandTypesForListVMs const type.
+func PossibleExpandTypesForListVMsValues() []ExpandTypesForListVMs {
+ return []ExpandTypesForListVMs{
+ ExpandTypesForListVMsInstanceView,
+ }
+}
+
+// ExtendedLocationType - The type of the extended location.
+type ExtendedLocationType string
+
+const (
+ ExtendedLocationTypeEdgeZone ExtendedLocationType = "EdgeZone"
+)
+
+// PossibleExtendedLocationTypeValues returns the possible values for the ExtendedLocationType const type.
+func PossibleExtendedLocationTypeValues() []ExtendedLocationType {
+ return []ExtendedLocationType{
+ ExtendedLocationTypeEdgeZone,
+ }
+}
+
+// ExtendedLocationTypes - The type of extendedLocation.
+type ExtendedLocationTypes string
+
+const (
+ ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone"
+)
+
+// PossibleExtendedLocationTypesValues returns the possible values for the ExtendedLocationTypes const type.
+func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes {
+ return []ExtendedLocationTypes{
+ ExtendedLocationTypesEdgeZone,
+ }
+}
+
+// FileFormat - Used to specify the file format when making request for SAS on a VHDX file format snapshot
+type FileFormat string
+
+const (
+ // FileFormatVHD - A VHD file is a disk image file in the Virtual Hard Disk file format.
+ FileFormatVHD FileFormat = "VHD"
+ // FileFormatVHDX - A VHDX file is a disk image file in the Virtual Hard Disk v2 file format.
+ FileFormatVHDX FileFormat = "VHDX"
+)
+
+// PossibleFileFormatValues returns the possible values for the FileFormat const type.
+func PossibleFileFormatValues() []FileFormat {
+ return []FileFormat{
+ FileFormatVHD,
+ FileFormatVHDX,
+ }
+}
+
+// GalleryApplicationCustomActionParameterType - Specifies the type of the custom action parameter. Possible values are: String,
+// ConfigurationDataBlob or LogOutputBlob
+type GalleryApplicationCustomActionParameterType string
+
+const (
+ GalleryApplicationCustomActionParameterTypeConfigurationDataBlob GalleryApplicationCustomActionParameterType = "ConfigurationDataBlob"
+ GalleryApplicationCustomActionParameterTypeLogOutputBlob GalleryApplicationCustomActionParameterType = "LogOutputBlob"
+ GalleryApplicationCustomActionParameterTypeString GalleryApplicationCustomActionParameterType = "String"
+)
+
+// PossibleGalleryApplicationCustomActionParameterTypeValues returns the possible values for the GalleryApplicationCustomActionParameterType const type.
+func PossibleGalleryApplicationCustomActionParameterTypeValues() []GalleryApplicationCustomActionParameterType {
+ return []GalleryApplicationCustomActionParameterType{
+ GalleryApplicationCustomActionParameterTypeConfigurationDataBlob,
+ GalleryApplicationCustomActionParameterTypeLogOutputBlob,
+ GalleryApplicationCustomActionParameterTypeString,
+ }
+}
+
+type GalleryExpandParams string
+
+const (
+ GalleryExpandParamsSharingProfileGroups GalleryExpandParams = "SharingProfile/Groups"
+)
+
+// PossibleGalleryExpandParamsValues returns the possible values for the GalleryExpandParams const type.
+func PossibleGalleryExpandParamsValues() []GalleryExpandParams {
+ return []GalleryExpandParams{
+ GalleryExpandParamsSharingProfileGroups,
+ }
+}
+
+// GalleryExtendedLocationType - It is type of the extended location.
+type GalleryExtendedLocationType string
+
+const (
+ GalleryExtendedLocationTypeEdgeZone GalleryExtendedLocationType = "EdgeZone"
+ GalleryExtendedLocationTypeUnknown GalleryExtendedLocationType = "Unknown"
+)
+
+// PossibleGalleryExtendedLocationTypeValues returns the possible values for the GalleryExtendedLocationType const type.
+func PossibleGalleryExtendedLocationTypeValues() []GalleryExtendedLocationType {
+ return []GalleryExtendedLocationType{
+ GalleryExtendedLocationTypeEdgeZone,
+ GalleryExtendedLocationTypeUnknown,
+ }
+}
+
+// GalleryProvisioningState - The provisioning state, which only appears in the response.
+type GalleryProvisioningState string
+
+const (
+ GalleryProvisioningStateCreating GalleryProvisioningState = "Creating"
+ GalleryProvisioningStateDeleting GalleryProvisioningState = "Deleting"
+ GalleryProvisioningStateFailed GalleryProvisioningState = "Failed"
+ GalleryProvisioningStateMigrating GalleryProvisioningState = "Migrating"
+ GalleryProvisioningStateSucceeded GalleryProvisioningState = "Succeeded"
+ GalleryProvisioningStateUpdating GalleryProvisioningState = "Updating"
+)
+
+// PossibleGalleryProvisioningStateValues returns the possible values for the GalleryProvisioningState const type.
+func PossibleGalleryProvisioningStateValues() []GalleryProvisioningState {
+ return []GalleryProvisioningState{
+ GalleryProvisioningStateCreating,
+ GalleryProvisioningStateDeleting,
+ GalleryProvisioningStateFailed,
+ GalleryProvisioningStateMigrating,
+ GalleryProvisioningStateSucceeded,
+ GalleryProvisioningStateUpdating,
+ }
+}
+
+// GallerySharingPermissionTypes - This property allows you to specify the permission of sharing gallery.
+// Possible values are:
+// Private
+// Groups
+// Community
+type GallerySharingPermissionTypes string
+
+const (
+ GallerySharingPermissionTypesCommunity GallerySharingPermissionTypes = "Community"
+ GallerySharingPermissionTypesGroups GallerySharingPermissionTypes = "Groups"
+ GallerySharingPermissionTypesPrivate GallerySharingPermissionTypes = "Private"
+)
+
+// PossibleGallerySharingPermissionTypesValues returns the possible values for the GallerySharingPermissionTypes const type.
+func PossibleGallerySharingPermissionTypesValues() []GallerySharingPermissionTypes {
+ return []GallerySharingPermissionTypes{
+ GallerySharingPermissionTypesCommunity,
+ GallerySharingPermissionTypesGroups,
+ GallerySharingPermissionTypesPrivate,
+ }
+}
+
+// HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'
+type HostCaching string
+
+const (
+ HostCachingNone HostCaching = "None"
+ HostCachingReadOnly HostCaching = "ReadOnly"
+ HostCachingReadWrite HostCaching = "ReadWrite"
+)
+
+// PossibleHostCachingValues returns the possible values for the HostCaching const type.
+func PossibleHostCachingValues() []HostCaching {
+ return []HostCaching{
+ HostCachingNone,
+ HostCachingReadOnly,
+ HostCachingReadWrite,
+ }
+}
+
+// HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
+type HyperVGeneration string
+
+const (
+ HyperVGenerationV1 HyperVGeneration = "V1"
+ HyperVGenerationV2 HyperVGeneration = "V2"
+)
+
+// PossibleHyperVGenerationValues returns the possible values for the HyperVGeneration const type.
+func PossibleHyperVGenerationValues() []HyperVGeneration {
+ return []HyperVGeneration{
+ HyperVGenerationV1,
+ HyperVGenerationV2,
+ }
+}
+
+// HyperVGenerationType - Specifies the HyperVGeneration Type associated with a resource
+type HyperVGenerationType string
+
+const (
+ HyperVGenerationTypeV1 HyperVGenerationType = "V1"
+ HyperVGenerationTypeV2 HyperVGenerationType = "V2"
+)
+
+// PossibleHyperVGenerationTypeValues returns the possible values for the HyperVGenerationType const type.
+func PossibleHyperVGenerationTypeValues() []HyperVGenerationType {
+ return []HyperVGenerationType{
+ HyperVGenerationTypeV1,
+ HyperVGenerationTypeV2,
+ }
+}
+
+// HyperVGenerationTypes - Specifies the HyperVGeneration Type
+type HyperVGenerationTypes string
+
+const (
+ HyperVGenerationTypesV1 HyperVGenerationTypes = "V1"
+ HyperVGenerationTypesV2 HyperVGenerationTypes = "V2"
+)
+
+// PossibleHyperVGenerationTypesValues returns the possible values for the HyperVGenerationTypes const type.
+func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes {
+ return []HyperVGenerationTypes{
+ HyperVGenerationTypesV1,
+ HyperVGenerationTypesV2,
+ }
+}
+
+// IPVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or
+// IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
+type IPVersion string
+
+const (
+ IPVersionIPv4 IPVersion = "IPv4"
+ IPVersionIPv6 IPVersion = "IPv6"
+)
+
+// PossibleIPVersionValues returns the possible values for the IPVersion const type.
+func PossibleIPVersionValues() []IPVersion {
+ return []IPVersion{
+ IPVersionIPv4,
+ IPVersionIPv6,
+ }
+}
+
+// IPVersions - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4
+// or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
+type IPVersions string
+
+const (
+ IPVersionsIPv4 IPVersions = "IPv4"
+ IPVersionsIPv6 IPVersions = "IPv6"
+)
+
+// PossibleIPVersionsValues returns the possible values for the IPVersions const type.
+func PossibleIPVersionsValues() []IPVersions {
+ return []IPVersions{
+ IPVersionsIPv4,
+ IPVersionsIPv6,
+ }
+}
+
+// ImageState - Describes the state of the image.
+type ImageState string
+
+const (
+ ImageStateActive ImageState = "Active"
+ ImageStateDeprecated ImageState = "Deprecated"
+ ImageStateScheduledForDeprecation ImageState = "ScheduledForDeprecation"
+)
+
+// PossibleImageStateValues returns the possible values for the ImageState const type.
+func PossibleImageStateValues() []ImageState {
+ return []ImageState{
+ ImageStateActive,
+ ImageStateDeprecated,
+ ImageStateScheduledForDeprecation,
+ }
+}
+
+type InstanceViewTypes string
+
+const (
+ InstanceViewTypesInstanceView InstanceViewTypes = "instanceView"
+ InstanceViewTypesUserData InstanceViewTypes = "userData"
+)
+
+// PossibleInstanceViewTypesValues returns the possible values for the InstanceViewTypes const type.
+func PossibleInstanceViewTypesValues() []InstanceViewTypes {
+ return []InstanceViewTypes{
+ InstanceViewTypesInstanceView,
+ InstanceViewTypesUserData,
+ }
+}
+
+// IntervalInMins - Interval value in minutes used to create LogAnalytics call rate logs.
+type IntervalInMins string
+
+const (
+ IntervalInMinsFiveMins IntervalInMins = "FiveMins"
+ IntervalInMinsSixtyMins IntervalInMins = "SixtyMins"
+ IntervalInMinsThirtyMins IntervalInMins = "ThirtyMins"
+ IntervalInMinsThreeMins IntervalInMins = "ThreeMins"
+)
+
+// PossibleIntervalInMinsValues returns the possible values for the IntervalInMins const type.
+func PossibleIntervalInMinsValues() []IntervalInMins {
+ return []IntervalInMins{
+ IntervalInMinsFiveMins,
+ IntervalInMinsSixtyMins,
+ IntervalInMinsThirtyMins,
+ IntervalInMinsThreeMins,
+ }
+}
+
+// LinuxPatchAssessmentMode - Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.
+// Possible values are:
+// ImageDefault - You control the timing of patch assessments on a virtual machine.
+// AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true.
+type LinuxPatchAssessmentMode string
+
+const (
+ LinuxPatchAssessmentModeAutomaticByPlatform LinuxPatchAssessmentMode = "AutomaticByPlatform"
+ LinuxPatchAssessmentModeImageDefault LinuxPatchAssessmentMode = "ImageDefault"
+)
+
+// PossibleLinuxPatchAssessmentModeValues returns the possible values for the LinuxPatchAssessmentMode const type.
+func PossibleLinuxPatchAssessmentModeValues() []LinuxPatchAssessmentMode {
+ return []LinuxPatchAssessmentMode{
+ LinuxPatchAssessmentModeAutomaticByPlatform,
+ LinuxPatchAssessmentModeImageDefault,
+ }
+}
+
+// LinuxVMGuestPatchAutomaticByPlatformRebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation
+// operations.
+type LinuxVMGuestPatchAutomaticByPlatformRebootSetting string
+
+const (
+ LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Always"
+ LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired"
+ LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Never"
+ LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown"
+)
+
+// PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues returns the possible values for the LinuxVMGuestPatchAutomaticByPlatformRebootSetting const type.
+func PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues() []LinuxVMGuestPatchAutomaticByPlatformRebootSetting {
+ return []LinuxVMGuestPatchAutomaticByPlatformRebootSetting{
+ LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways,
+ LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired,
+ LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever,
+ LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown,
+ }
+}
+
+// LinuxVMGuestPatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated
+// to virtual machine scale set with OrchestrationMode as Flexible.
+// Possible values are:
+// ImageDefault - The virtual machine's default patching configuration is used.
+// AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent
+// must be true
+type LinuxVMGuestPatchMode string
+
+const (
+ LinuxVMGuestPatchModeAutomaticByPlatform LinuxVMGuestPatchMode = "AutomaticByPlatform"
+ LinuxVMGuestPatchModeImageDefault LinuxVMGuestPatchMode = "ImageDefault"
+)
+
+// PossibleLinuxVMGuestPatchModeValues returns the possible values for the LinuxVMGuestPatchMode const type.
+func PossibleLinuxVMGuestPatchModeValues() []LinuxVMGuestPatchMode {
+ return []LinuxVMGuestPatchMode{
+ LinuxVMGuestPatchModeAutomaticByPlatform,
+ LinuxVMGuestPatchModeImageDefault,
+ }
+}
+
+// MaintenanceOperationResultCodeTypes - The Last Maintenance Operation Result Code.
+type MaintenanceOperationResultCodeTypes string
+
+const (
+ MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted"
+ MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted"
+ MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None"
+ MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater"
+)
+
+// PossibleMaintenanceOperationResultCodeTypesValues returns the possible values for the MaintenanceOperationResultCodeTypes const type.
+func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes {
+ return []MaintenanceOperationResultCodeTypes{
+ MaintenanceOperationResultCodeTypesMaintenanceAborted,
+ MaintenanceOperationResultCodeTypesMaintenanceCompleted,
+ MaintenanceOperationResultCodeTypesNone,
+ MaintenanceOperationResultCodeTypesRetryLater,
+ }
+}
+
+// NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network
+// Interface Configurations
+type NetworkAPIVersion string
+
+const (
+ NetworkAPIVersionTwoThousandTwenty1101 NetworkAPIVersion = "2020-11-01"
+)
+
+// PossibleNetworkAPIVersionValues returns the possible values for the NetworkAPIVersion const type.
+func PossibleNetworkAPIVersionValues() []NetworkAPIVersion {
+ return []NetworkAPIVersion{
+ NetworkAPIVersionTwoThousandTwenty1101,
+ }
+}
+
+// NetworkAccessPolicy - Policy for accessing the disk via network.
+type NetworkAccessPolicy string
+
+const (
+ // NetworkAccessPolicyAllowAll - The disk can be exported or uploaded to from any network.
+ NetworkAccessPolicyAllowAll NetworkAccessPolicy = "AllowAll"
+ // NetworkAccessPolicyAllowPrivate - The disk can be exported or uploaded to using a DiskAccess resource's private endpoints.
+ NetworkAccessPolicyAllowPrivate NetworkAccessPolicy = "AllowPrivate"
+ // NetworkAccessPolicyDenyAll - The disk cannot be exported.
+ NetworkAccessPolicyDenyAll NetworkAccessPolicy = "DenyAll"
+)
+
+// PossibleNetworkAccessPolicyValues returns the possible values for the NetworkAccessPolicy const type.
+func PossibleNetworkAccessPolicyValues() []NetworkAccessPolicy {
+ return []NetworkAccessPolicy{
+ NetworkAccessPolicyAllowAll,
+ NetworkAccessPolicyAllowPrivate,
+ NetworkAccessPolicyDenyAll,
+ }
+}
+
+// NetworkInterfaceAuxiliaryMode - Specifies whether the Auxiliary mode is enabled for the Network Interface resource.
+type NetworkInterfaceAuxiliaryMode string
+
+const (
+ NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections"
+ NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating"
+ NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None"
+)
+
+// PossibleNetworkInterfaceAuxiliaryModeValues returns the possible values for the NetworkInterfaceAuxiliaryMode const type.
+func PossibleNetworkInterfaceAuxiliaryModeValues() []NetworkInterfaceAuxiliaryMode {
+ return []NetworkInterfaceAuxiliaryMode{
+ NetworkInterfaceAuxiliaryModeAcceleratedConnections,
+ NetworkInterfaceAuxiliaryModeFloating,
+ NetworkInterfaceAuxiliaryModeNone,
+ }
+}
+
+// NetworkInterfaceAuxiliarySKU - Specifies whether the Auxiliary sku is enabled for the Network Interface resource.
+type NetworkInterfaceAuxiliarySKU string
+
+const (
+ NetworkInterfaceAuxiliarySKUA1 NetworkInterfaceAuxiliarySKU = "A1"
+ NetworkInterfaceAuxiliarySKUA2 NetworkInterfaceAuxiliarySKU = "A2"
+ NetworkInterfaceAuxiliarySKUA4 NetworkInterfaceAuxiliarySKU = "A4"
+ NetworkInterfaceAuxiliarySKUA8 NetworkInterfaceAuxiliarySKU = "A8"
+ NetworkInterfaceAuxiliarySKUNone NetworkInterfaceAuxiliarySKU = "None"
+)
+
+// PossibleNetworkInterfaceAuxiliarySKUValues returns the possible values for the NetworkInterfaceAuxiliarySKU const type.
+func PossibleNetworkInterfaceAuxiliarySKUValues() []NetworkInterfaceAuxiliarySKU {
+ return []NetworkInterfaceAuxiliarySKU{
+ NetworkInterfaceAuxiliarySKUA1,
+ NetworkInterfaceAuxiliarySKUA2,
+ NetworkInterfaceAuxiliarySKUA4,
+ NetworkInterfaceAuxiliarySKUA8,
+ NetworkInterfaceAuxiliarySKUNone,
+ }
+}
+
+// OperatingSystemStateTypes - This property allows the user to specify whether the virtual machines created under this image
+// are 'Generalized' or 'Specialized'.
+type OperatingSystemStateTypes string
+
+const (
+ OperatingSystemStateTypesGeneralized OperatingSystemStateTypes = "Generalized"
+ OperatingSystemStateTypesSpecialized OperatingSystemStateTypes = "Specialized"
+)
+
+// PossibleOperatingSystemStateTypesValues returns the possible values for the OperatingSystemStateTypes const type.
+func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes {
+ return []OperatingSystemStateTypes{
+ OperatingSystemStateTypesGeneralized,
+ OperatingSystemStateTypesSpecialized,
+ }
+}
+
+// OperatingSystemType - Gets the Operating System type.
+type OperatingSystemType string
+
+const (
+ OperatingSystemTypeLinux OperatingSystemType = "Linux"
+ OperatingSystemTypeWindows OperatingSystemType = "Windows"
+)
+
+// PossibleOperatingSystemTypeValues returns the possible values for the OperatingSystemType const type.
+func PossibleOperatingSystemTypeValues() []OperatingSystemType {
+ return []OperatingSystemType{
+ OperatingSystemTypeLinux,
+ OperatingSystemTypeWindows,
+ }
+}
+
+// OperatingSystemTypes - This property allows you to specify the supported type of the OS that application is built for.
+// Possible values are:
+// Windows
+// Linux
+type OperatingSystemTypes string
+
+const (
+ OperatingSystemTypesLinux OperatingSystemTypes = "Linux"
+ OperatingSystemTypesWindows OperatingSystemTypes = "Windows"
+)
+
+// PossibleOperatingSystemTypesValues returns the possible values for the OperatingSystemTypes const type.
+func PossibleOperatingSystemTypesValues() []OperatingSystemTypes {
+ return []OperatingSystemTypes{
+ OperatingSystemTypesLinux,
+ OperatingSystemTypesWindows,
+ }
+}
+
+// OrchestrationMode - Specifies the orchestration mode for the virtual machine scale set.
+type OrchestrationMode string
+
+const (
+ OrchestrationModeFlexible OrchestrationMode = "Flexible"
+ OrchestrationModeUniform OrchestrationMode = "Uniform"
+)
+
+// PossibleOrchestrationModeValues returns the possible values for the OrchestrationMode const type.
+func PossibleOrchestrationModeValues() []OrchestrationMode {
+ return []OrchestrationMode{
+ OrchestrationModeFlexible,
+ OrchestrationModeUniform,
+ }
+}
+
+// OrchestrationServiceNames - The name of the service.
+type OrchestrationServiceNames string
+
+const (
+ OrchestrationServiceNamesAutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs"
+)
+
+// PossibleOrchestrationServiceNamesValues returns the possible values for the OrchestrationServiceNames const type.
+func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames {
+ return []OrchestrationServiceNames{
+ OrchestrationServiceNamesAutomaticRepairs,
+ }
+}
+
+// OrchestrationServiceState - The current state of the service.
+type OrchestrationServiceState string
+
+const (
+ OrchestrationServiceStateNotRunning OrchestrationServiceState = "NotRunning"
+ OrchestrationServiceStateRunning OrchestrationServiceState = "Running"
+ OrchestrationServiceStateSuspended OrchestrationServiceState = "Suspended"
+)
+
+// PossibleOrchestrationServiceStateValues returns the possible values for the OrchestrationServiceState const type.
+func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState {
+ return []OrchestrationServiceState{
+ OrchestrationServiceStateNotRunning,
+ OrchestrationServiceStateRunning,
+ OrchestrationServiceStateSuspended,
+ }
+}
+
+// OrchestrationServiceStateAction - The action to be performed.
+type OrchestrationServiceStateAction string
+
+const (
+ OrchestrationServiceStateActionResume OrchestrationServiceStateAction = "Resume"
+ OrchestrationServiceStateActionSuspend OrchestrationServiceStateAction = "Suspend"
+)
+
+// PossibleOrchestrationServiceStateActionValues returns the possible values for the OrchestrationServiceStateAction const type.
+func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction {
+ return []OrchestrationServiceStateAction{
+ OrchestrationServiceStateActionResume,
+ OrchestrationServiceStateActionSuspend,
+ }
+}
+
+// PatchAssessmentState - Describes the availability of a given patch.
+type PatchAssessmentState string
+
+const (
+ PatchAssessmentStateAvailable PatchAssessmentState = "Available"
+ PatchAssessmentStateUnknown PatchAssessmentState = "Unknown"
+)
+
+// PossiblePatchAssessmentStateValues returns the possible values for the PatchAssessmentState const type.
+func PossiblePatchAssessmentStateValues() []PatchAssessmentState {
+ return []PatchAssessmentState{
+ PatchAssessmentStateAvailable,
+ PatchAssessmentStateUnknown,
+ }
+}
+
+// PatchInstallationState - The state of the patch after the installation operation completed.
+type PatchInstallationState string
+
+const (
+ PatchInstallationStateExcluded PatchInstallationState = "Excluded"
+ PatchInstallationStateFailed PatchInstallationState = "Failed"
+ PatchInstallationStateInstalled PatchInstallationState = "Installed"
+ PatchInstallationStateNotSelected PatchInstallationState = "NotSelected"
+ PatchInstallationStatePending PatchInstallationState = "Pending"
+ PatchInstallationStateUnknown PatchInstallationState = "Unknown"
+)
+
+// PossiblePatchInstallationStateValues returns the possible values for the PatchInstallationState const type.
+func PossiblePatchInstallationStateValues() []PatchInstallationState {
+ return []PatchInstallationState{
+ PatchInstallationStateExcluded,
+ PatchInstallationStateFailed,
+ PatchInstallationStateInstalled,
+ PatchInstallationStateNotSelected,
+ PatchInstallationStatePending,
+ PatchInstallationStateUnknown,
+ }
+}
+
+// PatchOperationStatus - The overall success or failure status of the operation. It remains "InProgress" until the operation
+// completes. At that point it will become "Unknown", "Failed", "Succeeded", or
+// "CompletedWithWarnings."
+type PatchOperationStatus string
+
+const (
+ PatchOperationStatusCompletedWithWarnings PatchOperationStatus = "CompletedWithWarnings"
+ PatchOperationStatusFailed PatchOperationStatus = "Failed"
+ PatchOperationStatusInProgress PatchOperationStatus = "InProgress"
+ PatchOperationStatusSucceeded PatchOperationStatus = "Succeeded"
+ PatchOperationStatusUnknown PatchOperationStatus = "Unknown"
+)
+
+// PossiblePatchOperationStatusValues returns the possible values for the PatchOperationStatus const type.
+func PossiblePatchOperationStatusValues() []PatchOperationStatus {
+ return []PatchOperationStatus{
+ PatchOperationStatusCompletedWithWarnings,
+ PatchOperationStatusFailed,
+ PatchOperationStatusInProgress,
+ PatchOperationStatusSucceeded,
+ PatchOperationStatusUnknown,
+ }
+}
+
+// PolicyViolationCategory - Describes the nature of the policy violation.
+type PolicyViolationCategory string
+
+const (
+ PolicyViolationCategoryCopyrightValidation PolicyViolationCategory = "CopyrightValidation"
+ PolicyViolationCategoryIPTheft PolicyViolationCategory = "IpTheft"
+ PolicyViolationCategoryImageFlaggedUnsafe PolicyViolationCategory = "ImageFlaggedUnsafe"
+ PolicyViolationCategoryOther PolicyViolationCategory = "Other"
+)
+
+// PossiblePolicyViolationCategoryValues returns the possible values for the PolicyViolationCategory const type.
+func PossiblePolicyViolationCategoryValues() []PolicyViolationCategory {
+ return []PolicyViolationCategory{
+ PolicyViolationCategoryCopyrightValidation,
+ PolicyViolationCategoryIPTheft,
+ PolicyViolationCategoryImageFlaggedUnsafe,
+ PolicyViolationCategoryOther,
+ }
+}
+
+// PrivateEndpointConnectionProvisioningState - The current provisioning state.
+type PrivateEndpointConnectionProvisioningState string
+
+const (
+ PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating"
+ PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting"
+ PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed"
+ PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded"
+)
+
+// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type.
+func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {
+ return []PrivateEndpointConnectionProvisioningState{
+ PrivateEndpointConnectionProvisioningStateCreating,
+ PrivateEndpointConnectionProvisioningStateDeleting,
+ PrivateEndpointConnectionProvisioningStateFailed,
+ PrivateEndpointConnectionProvisioningStateSucceeded,
+ }
+}
+
+// PrivateEndpointServiceConnectionStatus - The private endpoint connection status.
+type PrivateEndpointServiceConnectionStatus string
+
+const (
+ PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved"
+ PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending"
+ PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected"
+)
+
+// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type.
+func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus {
+ return []PrivateEndpointServiceConnectionStatus{
+ PrivateEndpointServiceConnectionStatusApproved,
+ PrivateEndpointServiceConnectionStatusPending,
+ PrivateEndpointServiceConnectionStatusRejected,
+ }
+}
+
+// ProtocolTypes - Specifies the protocol of WinRM listener. Possible values are: http, https.
+type ProtocolTypes string
+
+const (
+ ProtocolTypesHTTP ProtocolTypes = "Http"
+ ProtocolTypesHTTPS ProtocolTypes = "Https"
+)
+
+// PossibleProtocolTypesValues returns the possible values for the ProtocolTypes const type.
+func PossibleProtocolTypesValues() []ProtocolTypes {
+ return []ProtocolTypes{
+ ProtocolTypesHTTP,
+ ProtocolTypesHTTPS,
+ }
+}
+
+// ProximityPlacementGroupType - Specifies the type of the proximity placement group. Possible values are: Standard : Co-locate
+// resources within an Azure region or Availability Zone. Ultra : For future use.
+type ProximityPlacementGroupType string
+
+const (
+ ProximityPlacementGroupTypeStandard ProximityPlacementGroupType = "Standard"
+ ProximityPlacementGroupTypeUltra ProximityPlacementGroupType = "Ultra"
+)
+
+// PossibleProximityPlacementGroupTypeValues returns the possible values for the ProximityPlacementGroupType const type.
+func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType {
+ return []ProximityPlacementGroupType{
+ ProximityPlacementGroupTypeStandard,
+ ProximityPlacementGroupTypeUltra,
+ }
+}
+
+// PublicIPAddressSKUName - Specify public IP sku name
+type PublicIPAddressSKUName string
+
+const (
+ PublicIPAddressSKUNameBasic PublicIPAddressSKUName = "Basic"
+ PublicIPAddressSKUNameStandard PublicIPAddressSKUName = "Standard"
+)
+
+// PossiblePublicIPAddressSKUNameValues returns the possible values for the PublicIPAddressSKUName const type.
+func PossiblePublicIPAddressSKUNameValues() []PublicIPAddressSKUName {
+ return []PublicIPAddressSKUName{
+ PublicIPAddressSKUNameBasic,
+ PublicIPAddressSKUNameStandard,
+ }
+}
+
+// PublicIPAddressSKUTier - Specify public IP sku tier
+type PublicIPAddressSKUTier string
+
+const (
+ PublicIPAddressSKUTierGlobal PublicIPAddressSKUTier = "Global"
+ PublicIPAddressSKUTierRegional PublicIPAddressSKUTier = "Regional"
+)
+
+// PossiblePublicIPAddressSKUTierValues returns the possible values for the PublicIPAddressSKUTier const type.
+func PossiblePublicIPAddressSKUTierValues() []PublicIPAddressSKUTier {
+ return []PublicIPAddressSKUTier{
+ PublicIPAddressSKUTierGlobal,
+ PublicIPAddressSKUTierRegional,
+ }
+}
+
+// PublicIPAllocationMethod - Specify the public IP allocation type
+type PublicIPAllocationMethod string
+
+const (
+ PublicIPAllocationMethodDynamic PublicIPAllocationMethod = "Dynamic"
+ PublicIPAllocationMethodStatic PublicIPAllocationMethod = "Static"
+)
+
+// PossiblePublicIPAllocationMethodValues returns the possible values for the PublicIPAllocationMethod const type.
+func PossiblePublicIPAllocationMethodValues() []PublicIPAllocationMethod {
+ return []PublicIPAllocationMethod{
+ PublicIPAllocationMethodDynamic,
+ PublicIPAllocationMethodStatic,
+ }
+}
+
+// PublicNetworkAccess - Policy for controlling export on the disk.
+type PublicNetworkAccess string
+
+const (
+ // PublicNetworkAccessDisabled - You cannot access the underlying data of the disk publicly on the internet even when NetworkAccessPolicy
+ // is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET when NetworkAccessPolicy
+ // is set to AllowPrivate.
+ PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled"
+ // PublicNetworkAccessEnabled - You can generate a SAS URI to access the underlying data of the disk publicly on the internet
+ // when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your trusted Azure VNET
+ // when NetworkAccessPolicy is set to AllowPrivate.
+ PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled"
+)
+
+// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type.
+func PossiblePublicNetworkAccessValues() []PublicNetworkAccess {
+ return []PublicNetworkAccess{
+ PublicNetworkAccessDisabled,
+ PublicNetworkAccessEnabled,
+ }
+}
+
+// RepairAction - Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines
+// in the scale set. Default value is replace.
+type RepairAction string
+
+const (
+ RepairActionReimage RepairAction = "Reimage"
+ RepairActionReplace RepairAction = "Replace"
+ RepairActionRestart RepairAction = "Restart"
+)
+
+// PossibleRepairActionValues returns the possible values for the RepairAction const type.
+func PossibleRepairActionValues() []RepairAction {
+ return []RepairAction{
+ RepairActionReimage,
+ RepairActionReplace,
+ RepairActionRestart,
+ }
+}
+
+// ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable.
+type ReplicationMode string
+
+const (
+ ReplicationModeFull ReplicationMode = "Full"
+ ReplicationModeShallow ReplicationMode = "Shallow"
+)
+
+// PossibleReplicationModeValues returns the possible values for the ReplicationMode const type.
+func PossibleReplicationModeValues() []ReplicationMode {
+ return []ReplicationMode{
+ ReplicationModeFull,
+ ReplicationModeShallow,
+ }
+}
+
+// ReplicationState - This is the regional replication state.
+type ReplicationState string
+
+const (
+ ReplicationStateCompleted ReplicationState = "Completed"
+ ReplicationStateFailed ReplicationState = "Failed"
+ ReplicationStateReplicating ReplicationState = "Replicating"
+ ReplicationStateUnknown ReplicationState = "Unknown"
+)
+
+// PossibleReplicationStateValues returns the possible values for the ReplicationState const type.
+func PossibleReplicationStateValues() []ReplicationState {
+ return []ReplicationState{
+ ReplicationStateCompleted,
+ ReplicationStateFailed,
+ ReplicationStateReplicating,
+ ReplicationStateUnknown,
+ }
+}
+
+type ReplicationStatusTypes string
+
+const (
+ ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus"
+)
+
+// PossibleReplicationStatusTypesValues returns the possible values for the ReplicationStatusTypes const type.
+func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes {
+ return []ReplicationStatusTypes{
+ ReplicationStatusTypesReplicationStatus,
+ }
+}
+
+// ResourceIdentityType - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned'
+// includes both an implicitly created identity and a set of user assigned identities. The type 'None'
+// will remove any identities from the virtual machine scale set.
+type ResourceIdentityType string
+
+const (
+ ResourceIdentityTypeNone ResourceIdentityType = "None"
+ ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned"
+ ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned"
+ ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned"
+)
+
+// PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type.
+func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
+ return []ResourceIdentityType{
+ ResourceIdentityTypeNone,
+ ResourceIdentityTypeSystemAssigned,
+ ResourceIdentityTypeSystemAssignedUserAssigned,
+ ResourceIdentityTypeUserAssigned,
+ }
+}
+
+// ResourceSKUCapacityScaleType - The scale type applicable to the sku.
+type ResourceSKUCapacityScaleType string
+
+const (
+ ResourceSKUCapacityScaleTypeAutomatic ResourceSKUCapacityScaleType = "Automatic"
+ ResourceSKUCapacityScaleTypeManual ResourceSKUCapacityScaleType = "Manual"
+ ResourceSKUCapacityScaleTypeNone ResourceSKUCapacityScaleType = "None"
+)
+
+// PossibleResourceSKUCapacityScaleTypeValues returns the possible values for the ResourceSKUCapacityScaleType const type.
+func PossibleResourceSKUCapacityScaleTypeValues() []ResourceSKUCapacityScaleType {
+ return []ResourceSKUCapacityScaleType{
+ ResourceSKUCapacityScaleTypeAutomatic,
+ ResourceSKUCapacityScaleTypeManual,
+ ResourceSKUCapacityScaleTypeNone,
+ }
+}
+
+// ResourceSKURestrictionsReasonCode - The reason for restriction.
+type ResourceSKURestrictionsReasonCode string
+
+const (
+ ResourceSKURestrictionsReasonCodeNotAvailableForSubscription ResourceSKURestrictionsReasonCode = "NotAvailableForSubscription"
+ ResourceSKURestrictionsReasonCodeQuotaID ResourceSKURestrictionsReasonCode = "QuotaId"
+)
+
+// PossibleResourceSKURestrictionsReasonCodeValues returns the possible values for the ResourceSKURestrictionsReasonCode const type.
+func PossibleResourceSKURestrictionsReasonCodeValues() []ResourceSKURestrictionsReasonCode {
+ return []ResourceSKURestrictionsReasonCode{
+ ResourceSKURestrictionsReasonCodeNotAvailableForSubscription,
+ ResourceSKURestrictionsReasonCodeQuotaID,
+ }
+}
+
+// ResourceSKURestrictionsType - The type of restrictions.
+type ResourceSKURestrictionsType string
+
+const (
+ ResourceSKURestrictionsTypeLocation ResourceSKURestrictionsType = "Location"
+ ResourceSKURestrictionsTypeZone ResourceSKURestrictionsType = "Zone"
+)
+
+// PossibleResourceSKURestrictionsTypeValues returns the possible values for the ResourceSKURestrictionsType const type.
+func PossibleResourceSKURestrictionsTypeValues() []ResourceSKURestrictionsType {
+ return []ResourceSKURestrictionsType{
+ ResourceSKURestrictionsTypeLocation,
+ ResourceSKURestrictionsTypeZone,
+ }
+}
+
+type RestorePointCollectionExpandOptions string
+
+const (
+ RestorePointCollectionExpandOptionsRestorePoints RestorePointCollectionExpandOptions = "restorePoints"
+)
+
+// PossibleRestorePointCollectionExpandOptionsValues returns the possible values for the RestorePointCollectionExpandOptions const type.
+func PossibleRestorePointCollectionExpandOptionsValues() []RestorePointCollectionExpandOptions {
+ return []RestorePointCollectionExpandOptions{
+ RestorePointCollectionExpandOptionsRestorePoints,
+ }
+}
+
+// RestorePointEncryptionType - The type of key used to encrypt the data of the disk restore point.
+type RestorePointEncryptionType string
+
+const (
+ // RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey - Disk Restore Point is encrypted at rest with Customer managed
+ // key that can be changed and revoked by a customer.
+ RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey RestorePointEncryptionType = "EncryptionAtRestWithCustomerKey"
+ // RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys - Disk Restore Point is encrypted at rest with 2
+ // layers of encryption. One of the keys is Customer managed and the other key is Platform managed.
+ RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys RestorePointEncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys"
+ // RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey - Disk Restore Point is encrypted at rest with Platform managed
+ // key.
+ RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey RestorePointEncryptionType = "EncryptionAtRestWithPlatformKey"
+)
+
+// PossibleRestorePointEncryptionTypeValues returns the possible values for the RestorePointEncryptionType const type.
+func PossibleRestorePointEncryptionTypeValues() []RestorePointEncryptionType {
+ return []RestorePointEncryptionType{
+ RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey,
+ RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys,
+ RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey,
+ }
+}
+
+type RestorePointExpandOptions string
+
+const (
+ RestorePointExpandOptionsInstanceView RestorePointExpandOptions = "instanceView"
+)
+
+// PossibleRestorePointExpandOptionsValues returns the possible values for the RestorePointExpandOptions const type.
+func PossibleRestorePointExpandOptionsValues() []RestorePointExpandOptions {
+ return []RestorePointExpandOptions{
+ RestorePointExpandOptionsInstanceView,
+ }
+}
+
+// RollingUpgradeActionType - The last action performed on the rolling upgrade.
+type RollingUpgradeActionType string
+
+const (
+ RollingUpgradeActionTypeCancel RollingUpgradeActionType = "Cancel"
+ RollingUpgradeActionTypeStart RollingUpgradeActionType = "Start"
+)
+
+// PossibleRollingUpgradeActionTypeValues returns the possible values for the RollingUpgradeActionType const type.
+func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType {
+ return []RollingUpgradeActionType{
+ RollingUpgradeActionTypeCancel,
+ RollingUpgradeActionTypeStart,
+ }
+}
+
+// RollingUpgradeStatusCode - Code indicating the current status of the upgrade.
+type RollingUpgradeStatusCode string
+
+const (
+ RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled"
+ RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed"
+ RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted"
+ RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward"
+)
+
+// PossibleRollingUpgradeStatusCodeValues returns the possible values for the RollingUpgradeStatusCode const type.
+func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode {
+ return []RollingUpgradeStatusCode{
+ RollingUpgradeStatusCodeCancelled,
+ RollingUpgradeStatusCodeCompleted,
+ RollingUpgradeStatusCodeFaulted,
+ RollingUpgradeStatusCodeRollingForward,
+ }
+}
+
+// SecurityEncryptionTypes - Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption
+// of the managed disk along with VMGuestState blob, and VMGuestStateOnly for encryption of just the
+// VMGuestState blob. Note: It can be set for only Confidential VMs.
+type SecurityEncryptionTypes string
+
+const (
+ SecurityEncryptionTypesDiskWithVMGuestState SecurityEncryptionTypes = "DiskWithVMGuestState"
+ SecurityEncryptionTypesVMGuestStateOnly SecurityEncryptionTypes = "VMGuestStateOnly"
+)
+
+// PossibleSecurityEncryptionTypesValues returns the possible values for the SecurityEncryptionTypes const type.
+func PossibleSecurityEncryptionTypesValues() []SecurityEncryptionTypes {
+ return []SecurityEncryptionTypes{
+ SecurityEncryptionTypesDiskWithVMGuestState,
+ SecurityEncryptionTypesVMGuestStateOnly,
+ }
+}
+
+// SecurityTypes - Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings.
+// The default behavior is: UefiSettings will not be enabled unless this property is
+// set.
+type SecurityTypes string
+
+const (
+ SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM"
+ SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch"
+)
+
+// PossibleSecurityTypesValues returns the possible values for the SecurityTypes const type.
+func PossibleSecurityTypesValues() []SecurityTypes {
+ return []SecurityTypes{
+ SecurityTypesConfidentialVM,
+ SecurityTypesTrustedLaunch,
+ }
+}
+
+type SelectPermissions string
+
+const (
+ SelectPermissionsPermissions SelectPermissions = "Permissions"
+)
+
+// PossibleSelectPermissionsValues returns the possible values for the SelectPermissions const type.
+func PossibleSelectPermissionsValues() []SelectPermissions {
+ return []SelectPermissions{
+ SelectPermissionsPermissions,
+ }
+}
+
+// SettingNames - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands
+// and AutoLogon.
+type SettingNames string
+
+const (
+ SettingNamesAutoLogon SettingNames = "AutoLogon"
+ SettingNamesFirstLogonCommands SettingNames = "FirstLogonCommands"
+)
+
+// PossibleSettingNamesValues returns the possible values for the SettingNames const type.
+func PossibleSettingNamesValues() []SettingNames {
+ return []SettingNames{
+ SettingNamesAutoLogon,
+ SettingNamesFirstLogonCommands,
+ }
+}
+
+// SharedGalleryHostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'
+type SharedGalleryHostCaching string
+
+const (
+ SharedGalleryHostCachingNone SharedGalleryHostCaching = "None"
+ SharedGalleryHostCachingReadOnly SharedGalleryHostCaching = "ReadOnly"
+ SharedGalleryHostCachingReadWrite SharedGalleryHostCaching = "ReadWrite"
+)
+
+// PossibleSharedGalleryHostCachingValues returns the possible values for the SharedGalleryHostCaching const type.
+func PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching {
+ return []SharedGalleryHostCaching{
+ SharedGalleryHostCachingNone,
+ SharedGalleryHostCachingReadOnly,
+ SharedGalleryHostCachingReadWrite,
+ }
+}
+
+type SharedToValues string
+
+const (
+ SharedToValuesTenant SharedToValues = "tenant"
+)
+
+// PossibleSharedToValuesValues returns the possible values for the SharedToValues const type.
+func PossibleSharedToValuesValues() []SharedToValues {
+ return []SharedToValues{
+ SharedToValuesTenant,
+ }
+}
+
+// SharingProfileGroupTypes - This property allows you to specify the type of sharing group.
+// Possible values are:
+// Subscriptions
+// AADTenants
+type SharingProfileGroupTypes string
+
+const (
+ SharingProfileGroupTypesAADTenants SharingProfileGroupTypes = "AADTenants"
+ SharingProfileGroupTypesSubscriptions SharingProfileGroupTypes = "Subscriptions"
+)
+
+// PossibleSharingProfileGroupTypesValues returns the possible values for the SharingProfileGroupTypes const type.
+func PossibleSharingProfileGroupTypesValues() []SharingProfileGroupTypes {
+ return []SharingProfileGroupTypes{
+ SharingProfileGroupTypesAADTenants,
+ SharingProfileGroupTypesSubscriptions,
+ }
+}
+
+// SharingState - The sharing state of the gallery, which only appears in the response.
+type SharingState string
+
+const (
+ SharingStateFailed SharingState = "Failed"
+ SharingStateInProgress SharingState = "InProgress"
+ SharingStateSucceeded SharingState = "Succeeded"
+ SharingStateUnknown SharingState = "Unknown"
+)
+
+// PossibleSharingStateValues returns the possible values for the SharingState const type.
+func PossibleSharingStateValues() []SharingState {
+ return []SharingState{
+ SharingStateFailed,
+ SharingStateInProgress,
+ SharingStateSucceeded,
+ SharingStateUnknown,
+ }
+}
+
+// SharingUpdateOperationTypes - This property allows you to specify the operation type of gallery sharing update.
+// Possible values are:
+// Add
+// Remove
+// Reset
+type SharingUpdateOperationTypes string
+
+const (
+ SharingUpdateOperationTypesAdd SharingUpdateOperationTypes = "Add"
+ SharingUpdateOperationTypesEnableCommunity SharingUpdateOperationTypes = "EnableCommunity"
+ SharingUpdateOperationTypesRemove SharingUpdateOperationTypes = "Remove"
+ SharingUpdateOperationTypesReset SharingUpdateOperationTypes = "Reset"
+)
+
+// PossibleSharingUpdateOperationTypesValues returns the possible values for the SharingUpdateOperationTypes const type.
+func PossibleSharingUpdateOperationTypesValues() []SharingUpdateOperationTypes {
+ return []SharingUpdateOperationTypes{
+ SharingUpdateOperationTypesAdd,
+ SharingUpdateOperationTypesEnableCommunity,
+ SharingUpdateOperationTypesRemove,
+ SharingUpdateOperationTypesReset,
+ }
+}
+
+// SnapshotStorageAccountTypes - The sku name.
+type SnapshotStorageAccountTypes string
+
+const (
+ // SnapshotStorageAccountTypesPremiumLRS - Premium SSD locally redundant storage
+ SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS"
+ // SnapshotStorageAccountTypesStandardLRS - Standard HDD locally redundant storage
+ SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS"
+ // SnapshotStorageAccountTypesStandardZRS - Standard zone redundant storage
+ SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS"
+)
+
+// PossibleSnapshotStorageAccountTypesValues returns the possible values for the SnapshotStorageAccountTypes const type.
+func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes {
+ return []SnapshotStorageAccountTypes{
+ SnapshotStorageAccountTypesPremiumLRS,
+ SnapshotStorageAccountTypesStandardLRS,
+ SnapshotStorageAccountTypesStandardZRS,
+ }
+}
+
+// StatusLevelTypes - The level code.
+type StatusLevelTypes string
+
+const (
+ StatusLevelTypesError StatusLevelTypes = "Error"
+ StatusLevelTypesInfo StatusLevelTypes = "Info"
+ StatusLevelTypesWarning StatusLevelTypes = "Warning"
+)
+
+// PossibleStatusLevelTypesValues returns the possible values for the StatusLevelTypes const type.
+func PossibleStatusLevelTypesValues() []StatusLevelTypes {
+ return []StatusLevelTypes{
+ StatusLevelTypesError,
+ StatusLevelTypesInfo,
+ StatusLevelTypesWarning,
+ }
+}
+
+// StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable.
+type StorageAccountType string
+
+const (
+ StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS"
+ StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS"
+ StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS"
+)
+
+// PossibleStorageAccountTypeValues returns the possible values for the StorageAccountType const type.
+func PossibleStorageAccountTypeValues() []StorageAccountType {
+ return []StorageAccountType{
+ StorageAccountTypePremiumLRS,
+ StorageAccountTypeStandardLRS,
+ StorageAccountTypeStandardZRS,
+ }
+}
+
+// StorageAccountTypes - Specifies the storage account type for the managed disk. Managed OS disk storage account type can
+// only be set when you create the scale set. NOTE: UltraSSDLRS can only be used with data disks. It
+// cannot be used with OS Disk. StandardLRS uses Standard HDD. StandardSSDLRS uses Standard SSD. PremiumLRS uses Premium SSD.
+// UltraSSDLRS uses Ultra disk. PremiumZRS uses Premium SSD zone redundant
+// storage. StandardSSD_ZRS uses Standard SSD zone redundant storage. For more information regarding disks supported for Windows
+// Virtual Machines, refer to
+// https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to https://docs.microsoft.com/azure/virtual-machines/linux/disks-types
+type StorageAccountTypes string
+
+const (
+ StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS"
+ StorageAccountTypesPremiumV2LRS StorageAccountTypes = "PremiumV2_LRS"
+ StorageAccountTypesPremiumZRS StorageAccountTypes = "Premium_ZRS"
+ StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS"
+ StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS"
+ StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS"
+ StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS"
+)
+
+// PossibleStorageAccountTypesValues returns the possible values for the StorageAccountTypes const type.
+func PossibleStorageAccountTypesValues() []StorageAccountTypes {
+ return []StorageAccountTypes{
+ StorageAccountTypesPremiumLRS,
+ StorageAccountTypesPremiumV2LRS,
+ StorageAccountTypesPremiumZRS,
+ StorageAccountTypesStandardLRS,
+ StorageAccountTypesStandardSSDLRS,
+ StorageAccountTypesStandardSSDZRS,
+ StorageAccountTypesUltraSSDLRS,
+ }
+}
+
+// UpgradeMode - Specifies the mode of an upgrade to virtual machines in the scale set.
+// Possible values are:
+// Manual - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade
+// action.
+// Automatic - All virtual machines in the scale set are automatically updated at the same time.
+type UpgradeMode string
+
+const (
+ UpgradeModeAutomatic UpgradeMode = "Automatic"
+ UpgradeModeManual UpgradeMode = "Manual"
+ UpgradeModeRolling UpgradeMode = "Rolling"
+)
+
+// PossibleUpgradeModeValues returns the possible values for the UpgradeMode const type.
+func PossibleUpgradeModeValues() []UpgradeMode {
+ return []UpgradeMode{
+ UpgradeModeAutomatic,
+ UpgradeModeManual,
+ UpgradeModeRolling,
+ }
+}
+
+// UpgradeOperationInvoker - Invoker of the Upgrade Operation
+type UpgradeOperationInvoker string
+
+const (
+ UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform"
+ UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown"
+ UpgradeOperationInvokerUser UpgradeOperationInvoker = "User"
+)
+
+// PossibleUpgradeOperationInvokerValues returns the possible values for the UpgradeOperationInvoker const type.
+func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker {
+ return []UpgradeOperationInvoker{
+ UpgradeOperationInvokerPlatform,
+ UpgradeOperationInvokerUnknown,
+ UpgradeOperationInvokerUser,
+ }
+}
+
+// UpgradeState - Code indicating the current status of the upgrade.
+type UpgradeState string
+
+const (
+ UpgradeStateCancelled UpgradeState = "Cancelled"
+ UpgradeStateCompleted UpgradeState = "Completed"
+ UpgradeStateFaulted UpgradeState = "Faulted"
+ UpgradeStateRollingForward UpgradeState = "RollingForward"
+)
+
+// PossibleUpgradeStateValues returns the possible values for the UpgradeState const type.
+func PossibleUpgradeStateValues() []UpgradeState {
+ return []UpgradeState{
+ UpgradeStateCancelled,
+ UpgradeStateCompleted,
+ UpgradeStateFaulted,
+ UpgradeStateRollingForward,
+ }
+}
+
+// VMDiskTypes - VM disk types which are disallowed.
+type VMDiskTypes string
+
+const (
+ VMDiskTypesNone VMDiskTypes = "None"
+ VMDiskTypesUnmanaged VMDiskTypes = "Unmanaged"
+)
+
+// PossibleVMDiskTypesValues returns the possible values for the VMDiskTypes const type.
+func PossibleVMDiskTypesValues() []VMDiskTypes {
+ return []VMDiskTypes{
+ VMDiskTypesNone,
+ VMDiskTypesUnmanaged,
+ }
+}
+
+type VMGuestPatchClassificationLinux string
+
+const (
+ VMGuestPatchClassificationLinuxCritical VMGuestPatchClassificationLinux = "Critical"
+ VMGuestPatchClassificationLinuxOther VMGuestPatchClassificationLinux = "Other"
+ VMGuestPatchClassificationLinuxSecurity VMGuestPatchClassificationLinux = "Security"
+)
+
+// PossibleVMGuestPatchClassificationLinuxValues returns the possible values for the VMGuestPatchClassificationLinux const type.
+func PossibleVMGuestPatchClassificationLinuxValues() []VMGuestPatchClassificationLinux {
+ return []VMGuestPatchClassificationLinux{
+ VMGuestPatchClassificationLinuxCritical,
+ VMGuestPatchClassificationLinuxOther,
+ VMGuestPatchClassificationLinuxSecurity,
+ }
+}
+
+type VMGuestPatchClassificationWindows string
+
+const (
+ VMGuestPatchClassificationWindowsCritical VMGuestPatchClassificationWindows = "Critical"
+ VMGuestPatchClassificationWindowsDefinition VMGuestPatchClassificationWindows = "Definition"
+ VMGuestPatchClassificationWindowsFeaturePack VMGuestPatchClassificationWindows = "FeaturePack"
+ VMGuestPatchClassificationWindowsSecurity VMGuestPatchClassificationWindows = "Security"
+ VMGuestPatchClassificationWindowsServicePack VMGuestPatchClassificationWindows = "ServicePack"
+ VMGuestPatchClassificationWindowsTools VMGuestPatchClassificationWindows = "Tools"
+ VMGuestPatchClassificationWindowsUpdateRollUp VMGuestPatchClassificationWindows = "UpdateRollUp"
+ VMGuestPatchClassificationWindowsUpdates VMGuestPatchClassificationWindows = "Updates"
+)
+
+// PossibleVMGuestPatchClassificationWindowsValues returns the possible values for the VMGuestPatchClassificationWindows const type.
+func PossibleVMGuestPatchClassificationWindowsValues() []VMGuestPatchClassificationWindows {
+ return []VMGuestPatchClassificationWindows{
+ VMGuestPatchClassificationWindowsCritical,
+ VMGuestPatchClassificationWindowsDefinition,
+ VMGuestPatchClassificationWindowsFeaturePack,
+ VMGuestPatchClassificationWindowsSecurity,
+ VMGuestPatchClassificationWindowsServicePack,
+ VMGuestPatchClassificationWindowsTools,
+ VMGuestPatchClassificationWindowsUpdateRollUp,
+ VMGuestPatchClassificationWindowsUpdates,
+ }
+}
+
+// VMGuestPatchRebootBehavior - Describes the reboot requirements of the patch.
+type VMGuestPatchRebootBehavior string
+
+const (
+ VMGuestPatchRebootBehaviorAlwaysRequiresReboot VMGuestPatchRebootBehavior = "AlwaysRequiresReboot"
+ VMGuestPatchRebootBehaviorCanRequestReboot VMGuestPatchRebootBehavior = "CanRequestReboot"
+ VMGuestPatchRebootBehaviorNeverReboots VMGuestPatchRebootBehavior = "NeverReboots"
+ VMGuestPatchRebootBehaviorUnknown VMGuestPatchRebootBehavior = "Unknown"
+)
+
+// PossibleVMGuestPatchRebootBehaviorValues returns the possible values for the VMGuestPatchRebootBehavior const type.
+func PossibleVMGuestPatchRebootBehaviorValues() []VMGuestPatchRebootBehavior {
+ return []VMGuestPatchRebootBehavior{
+ VMGuestPatchRebootBehaviorAlwaysRequiresReboot,
+ VMGuestPatchRebootBehaviorCanRequestReboot,
+ VMGuestPatchRebootBehaviorNeverReboots,
+ VMGuestPatchRebootBehaviorUnknown,
+ }
+}
+
+// VMGuestPatchRebootSetting - Defines when it is acceptable to reboot a VM during a software update operation.
+type VMGuestPatchRebootSetting string
+
+const (
+ VMGuestPatchRebootSettingAlways VMGuestPatchRebootSetting = "Always"
+ VMGuestPatchRebootSettingIfRequired VMGuestPatchRebootSetting = "IfRequired"
+ VMGuestPatchRebootSettingNever VMGuestPatchRebootSetting = "Never"
+)
+
+// PossibleVMGuestPatchRebootSettingValues returns the possible values for the VMGuestPatchRebootSetting const type.
+func PossibleVMGuestPatchRebootSettingValues() []VMGuestPatchRebootSetting {
+ return []VMGuestPatchRebootSetting{
+ VMGuestPatchRebootSettingAlways,
+ VMGuestPatchRebootSettingIfRequired,
+ VMGuestPatchRebootSettingNever,
+ }
+}
+
+// VMGuestPatchRebootStatus - The reboot state of the VM following completion of the operation.
+type VMGuestPatchRebootStatus string
+
+const (
+ VMGuestPatchRebootStatusCompleted VMGuestPatchRebootStatus = "Completed"
+ VMGuestPatchRebootStatusFailed VMGuestPatchRebootStatus = "Failed"
+ VMGuestPatchRebootStatusNotNeeded VMGuestPatchRebootStatus = "NotNeeded"
+ VMGuestPatchRebootStatusRequired VMGuestPatchRebootStatus = "Required"
+ VMGuestPatchRebootStatusStarted VMGuestPatchRebootStatus = "Started"
+ VMGuestPatchRebootStatusUnknown VMGuestPatchRebootStatus = "Unknown"
+)
+
+// PossibleVMGuestPatchRebootStatusValues returns the possible values for the VMGuestPatchRebootStatus const type.
+func PossibleVMGuestPatchRebootStatusValues() []VMGuestPatchRebootStatus {
+ return []VMGuestPatchRebootStatus{
+ VMGuestPatchRebootStatusCompleted,
+ VMGuestPatchRebootStatusFailed,
+ VMGuestPatchRebootStatusNotNeeded,
+ VMGuestPatchRebootStatusRequired,
+ VMGuestPatchRebootStatusStarted,
+ VMGuestPatchRebootStatusUnknown,
+ }
+}
+
+// VirtualMachineEvictionPolicyTypes - Specifies the eviction policy for the Azure Spot VM/VMSS
+type VirtualMachineEvictionPolicyTypes string
+
+const (
+ VirtualMachineEvictionPolicyTypesDeallocate VirtualMachineEvictionPolicyTypes = "Deallocate"
+ VirtualMachineEvictionPolicyTypesDelete VirtualMachineEvictionPolicyTypes = "Delete"
+)
+
+// PossibleVirtualMachineEvictionPolicyTypesValues returns the possible values for the VirtualMachineEvictionPolicyTypes const type.
+func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes {
+ return []VirtualMachineEvictionPolicyTypes{
+ VirtualMachineEvictionPolicyTypesDeallocate,
+ VirtualMachineEvictionPolicyTypesDelete,
+ }
+}
+
+// VirtualMachinePriorityTypes - Specifies the priority for a standalone virtual machine or the virtual machines in the scale
+// set. 'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot
+// VM/VMSS.
+type VirtualMachinePriorityTypes string
+
+const (
+ VirtualMachinePriorityTypesLow VirtualMachinePriorityTypes = "Low"
+ VirtualMachinePriorityTypesRegular VirtualMachinePriorityTypes = "Regular"
+ VirtualMachinePriorityTypesSpot VirtualMachinePriorityTypes = "Spot"
+)
+
+// PossibleVirtualMachinePriorityTypesValues returns the possible values for the VirtualMachinePriorityTypes const type.
+func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes {
+ return []VirtualMachinePriorityTypes{
+ VirtualMachinePriorityTypesLow,
+ VirtualMachinePriorityTypesRegular,
+ VirtualMachinePriorityTypesSpot,
+ }
+}
+
+// VirtualMachineScaleSetSKUScaleType - The scale type applicable to the sku.
+type VirtualMachineScaleSetSKUScaleType string
+
+const (
+ VirtualMachineScaleSetSKUScaleTypeAutomatic VirtualMachineScaleSetSKUScaleType = "Automatic"
+ VirtualMachineScaleSetSKUScaleTypeNone VirtualMachineScaleSetSKUScaleType = "None"
+)
+
+// PossibleVirtualMachineScaleSetSKUScaleTypeValues returns the possible values for the VirtualMachineScaleSetSKUScaleType const type.
+func PossibleVirtualMachineScaleSetSKUScaleTypeValues() []VirtualMachineScaleSetSKUScaleType {
+ return []VirtualMachineScaleSetSKUScaleType{
+ VirtualMachineScaleSetSKUScaleTypeAutomatic,
+ VirtualMachineScaleSetSKUScaleTypeNone,
+ }
+}
+
+type VirtualMachineScaleSetScaleInRules string
+
+const (
+ VirtualMachineScaleSetScaleInRulesDefault VirtualMachineScaleSetScaleInRules = "Default"
+ VirtualMachineScaleSetScaleInRulesNewestVM VirtualMachineScaleSetScaleInRules = "NewestVM"
+ VirtualMachineScaleSetScaleInRulesOldestVM VirtualMachineScaleSetScaleInRules = "OldestVM"
+)
+
+// PossibleVirtualMachineScaleSetScaleInRulesValues returns the possible values for the VirtualMachineScaleSetScaleInRules const type.
+func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules {
+ return []VirtualMachineScaleSetScaleInRules{
+ VirtualMachineScaleSetScaleInRulesDefault,
+ VirtualMachineScaleSetScaleInRulesNewestVM,
+ VirtualMachineScaleSetScaleInRulesOldestVM,
+ }
+}
+
+// VirtualMachineSizeTypes - Specifies the size of the virtual machine. The enum data type is currently deprecated and will
+// be removed by December 23rd 2023. The recommended way to get the list of available sizes is using these
+// APIs: List all available virtual machine sizes in an availability set [https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes],
+// List all available virtual machine sizes in a
+// region [https://docs.microsoft.com/rest/api/compute/resourceskus/list], List all available virtual machine sizes for resizing
+// [https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes]. For more information about virtual machine
+// sizes, see Sizes for virtual machines
+// [https://docs.microsoft.com/azure/virtual-machines/sizes]. The available VM sizes depend on region and availability set.
+type VirtualMachineSizeTypes string
+
+const (
+ VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0"
+ VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1"
+ VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2"
+ VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3"
+ VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4"
+ VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0"
+ VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1"
+ VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10"
+ VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11"
+ VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2"
+ VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2"
+ VirtualMachineSizeTypesStandardA2MV2 VirtualMachineSizeTypes = "Standard_A2m_v2"
+ VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2"
+ VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3"
+ VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4"
+ VirtualMachineSizeTypesStandardA4MV2 VirtualMachineSizeTypes = "Standard_A4m_v2"
+ VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2"
+ VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5"
+ VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6"
+ VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7"
+ VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8"
+ VirtualMachineSizeTypesStandardA8MV2 VirtualMachineSizeTypes = "Standard_A8m_v2"
+ VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2"
+ VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9"
+ VirtualMachineSizeTypesStandardB1Ms VirtualMachineSizeTypes = "Standard_B1ms"
+ VirtualMachineSizeTypesStandardB1S VirtualMachineSizeTypes = "Standard_B1s"
+ VirtualMachineSizeTypesStandardB2Ms VirtualMachineSizeTypes = "Standard_B2ms"
+ VirtualMachineSizeTypesStandardB2S VirtualMachineSizeTypes = "Standard_B2s"
+ VirtualMachineSizeTypesStandardB4Ms VirtualMachineSizeTypes = "Standard_B4ms"
+ VirtualMachineSizeTypesStandardB8Ms VirtualMachineSizeTypes = "Standard_B8ms"
+ VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1"
+ VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11"
+ VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2"
+ VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12"
+ VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2"
+ VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13"
+ VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2"
+ VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14"
+ VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2"
+ VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2"
+ VirtualMachineSizeTypesStandardD16SV3 VirtualMachineSizeTypes = "Standard_D16s_v3"
+ VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3"
+ VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2"
+ VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2"
+ VirtualMachineSizeTypesStandardD2SV3 VirtualMachineSizeTypes = "Standard_D2s_v3"
+ VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2"
+ VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3"
+ VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3"
+ VirtualMachineSizeTypesStandardD32SV3 VirtualMachineSizeTypes = "Standard_D32s_v3"
+ VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3"
+ VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2"
+ VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4"
+ VirtualMachineSizeTypesStandardD4SV3 VirtualMachineSizeTypes = "Standard_D4s_v3"
+ VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2"
+ VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3"
+ VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2"
+ VirtualMachineSizeTypesStandardD64SV3 VirtualMachineSizeTypes = "Standard_D64s_v3"
+ VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3"
+ VirtualMachineSizeTypesStandardD8SV3 VirtualMachineSizeTypes = "Standard_D8s_v3"
+ VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3"
+ VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1"
+ VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11"
+ VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2"
+ VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12"
+ VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2"
+ VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13"
+ VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2"
+ VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2"
+ VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2"
+ VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14"
+ VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2"
+ VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2"
+ VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2"
+ VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2"
+ VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2"
+ VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2"
+ VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2"
+ VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3"
+ VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2"
+ VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4"
+ VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2"
+ VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2"
+ VirtualMachineSizeTypesStandardE16SV3 VirtualMachineSizeTypes = "Standard_E16s_v3"
+ VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3"
+ VirtualMachineSizeTypesStandardE2SV3 VirtualMachineSizeTypes = "Standard_E2s_v3"
+ VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3"
+ VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3"
+ VirtualMachineSizeTypesStandardE328SV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3"
+ VirtualMachineSizeTypesStandardE32SV3 VirtualMachineSizeTypes = "Standard_E32s_v3"
+ VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3"
+ VirtualMachineSizeTypesStandardE4SV3 VirtualMachineSizeTypes = "Standard_E4s_v3"
+ VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3"
+ VirtualMachineSizeTypesStandardE6416SV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3"
+ VirtualMachineSizeTypesStandardE6432SV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3"
+ VirtualMachineSizeTypesStandardE64SV3 VirtualMachineSizeTypes = "Standard_E64s_v3"
+ VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3"
+ VirtualMachineSizeTypesStandardE8SV3 VirtualMachineSizeTypes = "Standard_E8s_v3"
+ VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3"
+ VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1"
+ VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16"
+ VirtualMachineSizeTypesStandardF16S VirtualMachineSizeTypes = "Standard_F16s"
+ VirtualMachineSizeTypesStandardF16SV2 VirtualMachineSizeTypes = "Standard_F16s_v2"
+ VirtualMachineSizeTypesStandardF1S VirtualMachineSizeTypes = "Standard_F1s"
+ VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2"
+ VirtualMachineSizeTypesStandardF2S VirtualMachineSizeTypes = "Standard_F2s"
+ VirtualMachineSizeTypesStandardF2SV2 VirtualMachineSizeTypes = "Standard_F2s_v2"
+ VirtualMachineSizeTypesStandardF32SV2 VirtualMachineSizeTypes = "Standard_F32s_v2"
+ VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4"
+ VirtualMachineSizeTypesStandardF4S VirtualMachineSizeTypes = "Standard_F4s"
+ VirtualMachineSizeTypesStandardF4SV2 VirtualMachineSizeTypes = "Standard_F4s_v2"
+ VirtualMachineSizeTypesStandardF64SV2 VirtualMachineSizeTypes = "Standard_F64s_v2"
+ VirtualMachineSizeTypesStandardF72SV2 VirtualMachineSizeTypes = "Standard_F72s_v2"
+ VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8"
+ VirtualMachineSizeTypesStandardF8S VirtualMachineSizeTypes = "Standard_F8s"
+ VirtualMachineSizeTypesStandardF8SV2 VirtualMachineSizeTypes = "Standard_F8s_v2"
+ VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1"
+ VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2"
+ VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3"
+ VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4"
+ VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5"
+ VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1"
+ VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2"
+ VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3"
+ VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4"
+ VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4"
+ VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8"
+ VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5"
+ VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16"
+ VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8"
+ VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16"
+ VirtualMachineSizeTypesStandardH16M VirtualMachineSizeTypes = "Standard_H16m"
+ VirtualMachineSizeTypesStandardH16Mr VirtualMachineSizeTypes = "Standard_H16mr"
+ VirtualMachineSizeTypesStandardH16R VirtualMachineSizeTypes = "Standard_H16r"
+ VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8"
+ VirtualMachineSizeTypesStandardH8M VirtualMachineSizeTypes = "Standard_H8m"
+ VirtualMachineSizeTypesStandardL16S VirtualMachineSizeTypes = "Standard_L16s"
+ VirtualMachineSizeTypesStandardL32S VirtualMachineSizeTypes = "Standard_L32s"
+ VirtualMachineSizeTypesStandardL4S VirtualMachineSizeTypes = "Standard_L4s"
+ VirtualMachineSizeTypesStandardL8S VirtualMachineSizeTypes = "Standard_L8s"
+ VirtualMachineSizeTypesStandardM12832Ms VirtualMachineSizeTypes = "Standard_M128-32ms"
+ VirtualMachineSizeTypesStandardM12864Ms VirtualMachineSizeTypes = "Standard_M128-64ms"
+ VirtualMachineSizeTypesStandardM128Ms VirtualMachineSizeTypes = "Standard_M128ms"
+ VirtualMachineSizeTypesStandardM128S VirtualMachineSizeTypes = "Standard_M128s"
+ VirtualMachineSizeTypesStandardM6416Ms VirtualMachineSizeTypes = "Standard_M64-16ms"
+ VirtualMachineSizeTypesStandardM6432Ms VirtualMachineSizeTypes = "Standard_M64-32ms"
+ VirtualMachineSizeTypesStandardM64Ms VirtualMachineSizeTypes = "Standard_M64ms"
+ VirtualMachineSizeTypesStandardM64S VirtualMachineSizeTypes = "Standard_M64s"
+ VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12"
+ VirtualMachineSizeTypesStandardNC12SV2 VirtualMachineSizeTypes = "Standard_NC12s_v2"
+ VirtualMachineSizeTypesStandardNC12SV3 VirtualMachineSizeTypes = "Standard_NC12s_v3"
+ VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24"
+ VirtualMachineSizeTypesStandardNC24R VirtualMachineSizeTypes = "Standard_NC24r"
+ VirtualMachineSizeTypesStandardNC24RsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2"
+ VirtualMachineSizeTypesStandardNC24RsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3"
+ VirtualMachineSizeTypesStandardNC24SV2 VirtualMachineSizeTypes = "Standard_NC24s_v2"
+ VirtualMachineSizeTypesStandardNC24SV3 VirtualMachineSizeTypes = "Standard_NC24s_v3"
+ VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6"
+ VirtualMachineSizeTypesStandardNC6SV2 VirtualMachineSizeTypes = "Standard_NC6s_v2"
+ VirtualMachineSizeTypesStandardNC6SV3 VirtualMachineSizeTypes = "Standard_NC6s_v3"
+ VirtualMachineSizeTypesStandardND12S VirtualMachineSizeTypes = "Standard_ND12s"
+ VirtualMachineSizeTypesStandardND24Rs VirtualMachineSizeTypes = "Standard_ND24rs"
+ VirtualMachineSizeTypesStandardND24S VirtualMachineSizeTypes = "Standard_ND24s"
+ VirtualMachineSizeTypesStandardND6S VirtualMachineSizeTypes = "Standard_ND6s"
+ VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12"
+ VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24"
+ VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6"
+)
+
+// PossibleVirtualMachineSizeTypesValues returns the possible values for the VirtualMachineSizeTypes const type.
+func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes {
+ return []VirtualMachineSizeTypes{
+ VirtualMachineSizeTypesBasicA0,
+ VirtualMachineSizeTypesBasicA1,
+ VirtualMachineSizeTypesBasicA2,
+ VirtualMachineSizeTypesBasicA3,
+ VirtualMachineSizeTypesBasicA4,
+ VirtualMachineSizeTypesStandardA0,
+ VirtualMachineSizeTypesStandardA1,
+ VirtualMachineSizeTypesStandardA10,
+ VirtualMachineSizeTypesStandardA11,
+ VirtualMachineSizeTypesStandardA1V2,
+ VirtualMachineSizeTypesStandardA2,
+ VirtualMachineSizeTypesStandardA2MV2,
+ VirtualMachineSizeTypesStandardA2V2,
+ VirtualMachineSizeTypesStandardA3,
+ VirtualMachineSizeTypesStandardA4,
+ VirtualMachineSizeTypesStandardA4MV2,
+ VirtualMachineSizeTypesStandardA4V2,
+ VirtualMachineSizeTypesStandardA5,
+ VirtualMachineSizeTypesStandardA6,
+ VirtualMachineSizeTypesStandardA7,
+ VirtualMachineSizeTypesStandardA8,
+ VirtualMachineSizeTypesStandardA8MV2,
+ VirtualMachineSizeTypesStandardA8V2,
+ VirtualMachineSizeTypesStandardA9,
+ VirtualMachineSizeTypesStandardB1Ms,
+ VirtualMachineSizeTypesStandardB1S,
+ VirtualMachineSizeTypesStandardB2Ms,
+ VirtualMachineSizeTypesStandardB2S,
+ VirtualMachineSizeTypesStandardB4Ms,
+ VirtualMachineSizeTypesStandardB8Ms,
+ VirtualMachineSizeTypesStandardD1,
+ VirtualMachineSizeTypesStandardD11,
+ VirtualMachineSizeTypesStandardD11V2,
+ VirtualMachineSizeTypesStandardD12,
+ VirtualMachineSizeTypesStandardD12V2,
+ VirtualMachineSizeTypesStandardD13,
+ VirtualMachineSizeTypesStandardD13V2,
+ VirtualMachineSizeTypesStandardD14,
+ VirtualMachineSizeTypesStandardD14V2,
+ VirtualMachineSizeTypesStandardD15V2,
+ VirtualMachineSizeTypesStandardD16SV3,
+ VirtualMachineSizeTypesStandardD16V3,
+ VirtualMachineSizeTypesStandardD1V2,
+ VirtualMachineSizeTypesStandardD2,
+ VirtualMachineSizeTypesStandardD2SV3,
+ VirtualMachineSizeTypesStandardD2V2,
+ VirtualMachineSizeTypesStandardD2V3,
+ VirtualMachineSizeTypesStandardD3,
+ VirtualMachineSizeTypesStandardD32SV3,
+ VirtualMachineSizeTypesStandardD32V3,
+ VirtualMachineSizeTypesStandardD3V2,
+ VirtualMachineSizeTypesStandardD4,
+ VirtualMachineSizeTypesStandardD4SV3,
+ VirtualMachineSizeTypesStandardD4V2,
+ VirtualMachineSizeTypesStandardD4V3,
+ VirtualMachineSizeTypesStandardD5V2,
+ VirtualMachineSizeTypesStandardD64SV3,
+ VirtualMachineSizeTypesStandardD64V3,
+ VirtualMachineSizeTypesStandardD8SV3,
+ VirtualMachineSizeTypesStandardD8V3,
+ VirtualMachineSizeTypesStandardDS1,
+ VirtualMachineSizeTypesStandardDS11,
+ VirtualMachineSizeTypesStandardDS11V2,
+ VirtualMachineSizeTypesStandardDS12,
+ VirtualMachineSizeTypesStandardDS12V2,
+ VirtualMachineSizeTypesStandardDS13,
+ VirtualMachineSizeTypesStandardDS132V2,
+ VirtualMachineSizeTypesStandardDS134V2,
+ VirtualMachineSizeTypesStandardDS13V2,
+ VirtualMachineSizeTypesStandardDS14,
+ VirtualMachineSizeTypesStandardDS144V2,
+ VirtualMachineSizeTypesStandardDS148V2,
+ VirtualMachineSizeTypesStandardDS14V2,
+ VirtualMachineSizeTypesStandardDS15V2,
+ VirtualMachineSizeTypesStandardDS1V2,
+ VirtualMachineSizeTypesStandardDS2,
+ VirtualMachineSizeTypesStandardDS2V2,
+ VirtualMachineSizeTypesStandardDS3,
+ VirtualMachineSizeTypesStandardDS3V2,
+ VirtualMachineSizeTypesStandardDS4,
+ VirtualMachineSizeTypesStandardDS4V2,
+ VirtualMachineSizeTypesStandardDS5V2,
+ VirtualMachineSizeTypesStandardE16SV3,
+ VirtualMachineSizeTypesStandardE16V3,
+ VirtualMachineSizeTypesStandardE2SV3,
+ VirtualMachineSizeTypesStandardE2V3,
+ VirtualMachineSizeTypesStandardE3216V3,
+ VirtualMachineSizeTypesStandardE328SV3,
+ VirtualMachineSizeTypesStandardE32SV3,
+ VirtualMachineSizeTypesStandardE32V3,
+ VirtualMachineSizeTypesStandardE4SV3,
+ VirtualMachineSizeTypesStandardE4V3,
+ VirtualMachineSizeTypesStandardE6416SV3,
+ VirtualMachineSizeTypesStandardE6432SV3,
+ VirtualMachineSizeTypesStandardE64SV3,
+ VirtualMachineSizeTypesStandardE64V3,
+ VirtualMachineSizeTypesStandardE8SV3,
+ VirtualMachineSizeTypesStandardE8V3,
+ VirtualMachineSizeTypesStandardF1,
+ VirtualMachineSizeTypesStandardF16,
+ VirtualMachineSizeTypesStandardF16S,
+ VirtualMachineSizeTypesStandardF16SV2,
+ VirtualMachineSizeTypesStandardF1S,
+ VirtualMachineSizeTypesStandardF2,
+ VirtualMachineSizeTypesStandardF2S,
+ VirtualMachineSizeTypesStandardF2SV2,
+ VirtualMachineSizeTypesStandardF32SV2,
+ VirtualMachineSizeTypesStandardF4,
+ VirtualMachineSizeTypesStandardF4S,
+ VirtualMachineSizeTypesStandardF4SV2,
+ VirtualMachineSizeTypesStandardF64SV2,
+ VirtualMachineSizeTypesStandardF72SV2,
+ VirtualMachineSizeTypesStandardF8,
+ VirtualMachineSizeTypesStandardF8S,
+ VirtualMachineSizeTypesStandardF8SV2,
+ VirtualMachineSizeTypesStandardG1,
+ VirtualMachineSizeTypesStandardG2,
+ VirtualMachineSizeTypesStandardG3,
+ VirtualMachineSizeTypesStandardG4,
+ VirtualMachineSizeTypesStandardG5,
+ VirtualMachineSizeTypesStandardGS1,
+ VirtualMachineSizeTypesStandardGS2,
+ VirtualMachineSizeTypesStandardGS3,
+ VirtualMachineSizeTypesStandardGS4,
+ VirtualMachineSizeTypesStandardGS44,
+ VirtualMachineSizeTypesStandardGS48,
+ VirtualMachineSizeTypesStandardGS5,
+ VirtualMachineSizeTypesStandardGS516,
+ VirtualMachineSizeTypesStandardGS58,
+ VirtualMachineSizeTypesStandardH16,
+ VirtualMachineSizeTypesStandardH16M,
+ VirtualMachineSizeTypesStandardH16Mr,
+ VirtualMachineSizeTypesStandardH16R,
+ VirtualMachineSizeTypesStandardH8,
+ VirtualMachineSizeTypesStandardH8M,
+ VirtualMachineSizeTypesStandardL16S,
+ VirtualMachineSizeTypesStandardL32S,
+ VirtualMachineSizeTypesStandardL4S,
+ VirtualMachineSizeTypesStandardL8S,
+ VirtualMachineSizeTypesStandardM12832Ms,
+ VirtualMachineSizeTypesStandardM12864Ms,
+ VirtualMachineSizeTypesStandardM128Ms,
+ VirtualMachineSizeTypesStandardM128S,
+ VirtualMachineSizeTypesStandardM6416Ms,
+ VirtualMachineSizeTypesStandardM6432Ms,
+ VirtualMachineSizeTypesStandardM64Ms,
+ VirtualMachineSizeTypesStandardM64S,
+ VirtualMachineSizeTypesStandardNC12,
+ VirtualMachineSizeTypesStandardNC12SV2,
+ VirtualMachineSizeTypesStandardNC12SV3,
+ VirtualMachineSizeTypesStandardNC24,
+ VirtualMachineSizeTypesStandardNC24R,
+ VirtualMachineSizeTypesStandardNC24RsV2,
+ VirtualMachineSizeTypesStandardNC24RsV3,
+ VirtualMachineSizeTypesStandardNC24SV2,
+ VirtualMachineSizeTypesStandardNC24SV3,
+ VirtualMachineSizeTypesStandardNC6,
+ VirtualMachineSizeTypesStandardNC6SV2,
+ VirtualMachineSizeTypesStandardNC6SV3,
+ VirtualMachineSizeTypesStandardND12S,
+ VirtualMachineSizeTypesStandardND24Rs,
+ VirtualMachineSizeTypesStandardND24S,
+ VirtualMachineSizeTypesStandardND6S,
+ VirtualMachineSizeTypesStandardNV12,
+ VirtualMachineSizeTypesStandardNV24,
+ VirtualMachineSizeTypesStandardNV6,
+ }
+}
+
+// WindowsPatchAssessmentMode - Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.
+// Possible values are:
+// ImageDefault - You control the timing of patch assessments on a virtual machine.
+// AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true.
+type WindowsPatchAssessmentMode string
+
+const (
+ WindowsPatchAssessmentModeAutomaticByPlatform WindowsPatchAssessmentMode = "AutomaticByPlatform"
+ WindowsPatchAssessmentModeImageDefault WindowsPatchAssessmentMode = "ImageDefault"
+)
+
+// PossibleWindowsPatchAssessmentModeValues returns the possible values for the WindowsPatchAssessmentMode const type.
+func PossibleWindowsPatchAssessmentModeValues() []WindowsPatchAssessmentMode {
+ return []WindowsPatchAssessmentMode{
+ WindowsPatchAssessmentModeAutomaticByPlatform,
+ WindowsPatchAssessmentModeImageDefault,
+ }
+}
+
+// WindowsVMGuestPatchAutomaticByPlatformRebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation
+// operations.
+type WindowsVMGuestPatchAutomaticByPlatformRebootSetting string
+
+const (
+ WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Always"
+ WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired"
+ WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Never"
+ WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown"
+)
+
+// PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues returns the possible values for the WindowsVMGuestPatchAutomaticByPlatformRebootSetting const type.
+func PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues() []WindowsVMGuestPatchAutomaticByPlatformRebootSetting {
+ return []WindowsVMGuestPatchAutomaticByPlatformRebootSetting{
+ WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways,
+ WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired,
+ WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever,
+ WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown,
+ }
+}
+
+// WindowsVMGuestPatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated
+// to virtual machine scale set with OrchestrationMode as Flexible.
+// Possible values are:
+// Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the
+// VM. In this mode, automatic updates are disabled; the property
+// WindowsConfiguration.enableAutomaticUpdates must be false
+// AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates
+// must be true.
+// AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and
+// WindowsConfiguration.enableAutomaticUpdates must be true
+type WindowsVMGuestPatchMode string
+
+const (
+ WindowsVMGuestPatchModeAutomaticByOS WindowsVMGuestPatchMode = "AutomaticByOS"
+ WindowsVMGuestPatchModeAutomaticByPlatform WindowsVMGuestPatchMode = "AutomaticByPlatform"
+ WindowsVMGuestPatchModeManual WindowsVMGuestPatchMode = "Manual"
+)
+
+// PossibleWindowsVMGuestPatchModeValues returns the possible values for the WindowsVMGuestPatchMode const type.
+func PossibleWindowsVMGuestPatchModeValues() []WindowsVMGuestPatchMode {
+ return []WindowsVMGuestPatchMode{
+ WindowsVMGuestPatchModeAutomaticByOS,
+ WindowsVMGuestPatchModeAutomaticByPlatform,
+ WindowsVMGuestPatchModeManual,
+ }
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.go
new file mode 100644
index 000000000..4a1eea66b
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.go
@@ -0,0 +1,423 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// DedicatedHostGroupsClient contains the methods for the DedicatedHostGroups group.
+// Don't use this type directly, use NewDedicatedHostGroupsClient() instead.
+type DedicatedHostGroupsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewDedicatedHostGroupsClient creates a new instance of DedicatedHostGroupsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewDedicatedHostGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DedicatedHostGroupsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &DedicatedHostGroupsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please
+// see Dedicated Host Documentation [https://go.microsoft.com/fwlink/?linkid=2082596]
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - hostGroupName - The name of the dedicated host group.
+// - parameters - Parameters supplied to the Create Dedicated Host Group.
+// - options - DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate
+// method.
+func (client *DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup, options *DedicatedHostGroupsClientCreateOrUpdateOptions) (DedicatedHostGroupsClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "DedicatedHostGroupsClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, hostGroupName, parameters, options)
+ if err != nil {
+ return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *DedicatedHostGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup, options *DedicatedHostGroupsClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if hostGroupName == "" {
+ return nil, errors.New("parameter hostGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *DedicatedHostGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (DedicatedHostGroupsClientCreateOrUpdateResponse, error) {
+ result := DedicatedHostGroupsClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil {
+ return DedicatedHostGroupsClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Delete a dedicated host group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - hostGroupName - The name of the dedicated host group.
+// - options - DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete
+// method.
+func (client *DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientDeleteOptions) (DedicatedHostGroupsClientDeleteResponse, error) {
+ var err error
+ const operationName = "DedicatedHostGroupsClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, hostGroupName, options)
+ if err != nil {
+ return DedicatedHostGroupsClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DedicatedHostGroupsClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return DedicatedHostGroupsClientDeleteResponse{}, err
+ }
+ return DedicatedHostGroupsClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *DedicatedHostGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if hostGroupName == "" {
+ return nil, errors.New("parameter hostGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Retrieves information about a dedicated host group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - hostGroupName - The name of the dedicated host group.
+// - options - DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method.
+func (client *DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientGetOptions) (DedicatedHostGroupsClientGetResponse, error) {
+ var err error
+ const operationName = "DedicatedHostGroupsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, hostGroupName, options)
+ if err != nil {
+ return DedicatedHostGroupsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DedicatedHostGroupsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DedicatedHostGroupsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *DedicatedHostGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostGroupsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if hostGroupName == "" {
+ return nil, errors.New("parameter hostGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *DedicatedHostGroupsClient) getHandleResponse(resp *http.Response) (DedicatedHostGroupsClientGetResponse, error) {
+ result := DedicatedHostGroupsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil {
+ return DedicatedHostGroupsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Lists all of the dedicated host groups in the specified resource group. Use the nextLink
+// property in the response to get the next page of dedicated host groups.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - options - DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListByResourceGroupPager
+// method.
+func (client *DedicatedHostGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *DedicatedHostGroupsClientListByResourceGroupOptions) *runtime.Pager[DedicatedHostGroupsClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DedicatedHostGroupsClientListByResourceGroupResponse]{
+ More: func(page DedicatedHostGroupsClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DedicatedHostGroupsClientListByResourceGroupResponse) (DedicatedHostGroupsClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostGroupsClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return DedicatedHostGroupsClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *DedicatedHostGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DedicatedHostGroupsClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *DedicatedHostGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (DedicatedHostGroupsClientListByResourceGroupResponse, error) {
+ result := DedicatedHostGroupsClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroupListResult); err != nil {
+ return DedicatedHostGroupsClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListBySubscriptionPager - Lists all of the dedicated host groups in the subscription. Use the nextLink property in the
+// response to get the next page of dedicated host groups.
+//
+// Generated from API version 2023-07-01
+// - options - DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListBySubscriptionPager
+// method.
+func (client *DedicatedHostGroupsClient) NewListBySubscriptionPager(options *DedicatedHostGroupsClientListBySubscriptionOptions) *runtime.Pager[DedicatedHostGroupsClientListBySubscriptionResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DedicatedHostGroupsClientListBySubscriptionResponse]{
+ More: func(page DedicatedHostGroupsClientListBySubscriptionResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DedicatedHostGroupsClientListBySubscriptionResponse) (DedicatedHostGroupsClientListBySubscriptionResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostGroupsClient.NewListBySubscriptionPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listBySubscriptionCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return DedicatedHostGroupsClientListBySubscriptionResponse{}, err
+ }
+ return client.listBySubscriptionHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listBySubscriptionCreateRequest creates the ListBySubscription request.
+func (client *DedicatedHostGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *DedicatedHostGroupsClientListBySubscriptionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listBySubscriptionHandleResponse handles the ListBySubscription response.
+func (client *DedicatedHostGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (DedicatedHostGroupsClientListBySubscriptionResponse, error) {
+ result := DedicatedHostGroupsClientListBySubscriptionResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroupListResult); err != nil {
+ return DedicatedHostGroupsClientListBySubscriptionResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - Update an dedicated host group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - hostGroupName - The name of the dedicated host group.
+// - parameters - Parameters supplied to the Update Dedicated Host Group operation.
+// - options - DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update
+// method.
+func (client *DedicatedHostGroupsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate, options *DedicatedHostGroupsClientUpdateOptions) (DedicatedHostGroupsClientUpdateResponse, error) {
+ var err error
+ const operationName = "DedicatedHostGroupsClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, hostGroupName, parameters, options)
+ if err != nil {
+ return DedicatedHostGroupsClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DedicatedHostGroupsClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DedicatedHostGroupsClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *DedicatedHostGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate, options *DedicatedHostGroupsClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if hostGroupName == "" {
+ return nil, errors.New("parameter hostGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *DedicatedHostGroupsClient) updateHandleResponse(resp *http.Response) (DedicatedHostGroupsClientUpdateResponse, error) {
+ result := DedicatedHostGroupsClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostGroup); err != nil {
+ return DedicatedHostGroupsClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.go
new file mode 100644
index 000000000..d91e4db2a
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.go
@@ -0,0 +1,593 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// DedicatedHostsClient contains the methods for the DedicatedHosts group.
+// Don't use this type directly, use NewDedicatedHostsClient() instead.
+type DedicatedHostsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewDedicatedHostsClient creates a new instance of DedicatedHostsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewDedicatedHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DedicatedHostsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &DedicatedHostsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Create or update a dedicated host .
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - hostGroupName - The name of the dedicated host group.
+// - hostName - The name of the dedicated host .
+// - parameters - Parameters supplied to the Create Dedicated Host.
+// - options - DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate
+// method.
+func (client *DedicatedHostsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DedicatedHostsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, hostGroupName, hostName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Create or update a dedicated host .
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *DedicatedHostsClient) createOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DedicatedHostsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *DedicatedHostsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if hostGroupName == "" {
+ return nil, errors.New("parameter hostGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName))
+ if hostName == "" {
+ return nil, errors.New("parameter hostName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Delete a dedicated host.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - hostGroupName - The name of the dedicated host group.
+// - hostName - The name of the dedicated host.
+// - options - DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete
+// method.
+func (client *DedicatedHostsClient) BeginDelete(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*runtime.Poller[DedicatedHostsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, hostGroupName, hostName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Delete a dedicated host.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *DedicatedHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DedicatedHostsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *DedicatedHostsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if hostGroupName == "" {
+ return nil, errors.New("parameter hostGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName))
+ if hostName == "" {
+ return nil, errors.New("parameter hostName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Retrieves information about a dedicated host.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - hostGroupName - The name of the dedicated host group.
+// - hostName - The name of the dedicated host.
+// - options - DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method.
+func (client *DedicatedHostsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientGetOptions) (DedicatedHostsClientGetResponse, error) {
+ var err error
+ const operationName = "DedicatedHostsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options)
+ if err != nil {
+ return DedicatedHostsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DedicatedHostsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DedicatedHostsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *DedicatedHostsClient) getCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if hostGroupName == "" {
+ return nil, errors.New("parameter hostGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName))
+ if hostName == "" {
+ return nil, errors.New("parameter hostName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *DedicatedHostsClient) getHandleResponse(resp *http.Response) (DedicatedHostsClientGetResponse, error) {
+ result := DedicatedHostsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHost); err != nil {
+ return DedicatedHostsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAvailableSizesPager - Lists all available dedicated host sizes to which the specified dedicated host can be resized.
+// NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - hostGroupName - The name of the dedicated host group.
+// - hostName - The name of the dedicated host.
+// - options - DedicatedHostsClientListAvailableSizesOptions contains the optional parameters for the DedicatedHostsClient.NewListAvailableSizesPager
+// method.
+func (client *DedicatedHostsClient) NewListAvailableSizesPager(resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientListAvailableSizesOptions) *runtime.Pager[DedicatedHostsClientListAvailableSizesResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DedicatedHostsClientListAvailableSizesResponse]{
+ More: func(page DedicatedHostsClientListAvailableSizesResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *DedicatedHostsClientListAvailableSizesResponse) (DedicatedHostsClientListAvailableSizesResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostsClient.NewListAvailableSizesPager")
+ req, err := client.listAvailableSizesCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options)
+ if err != nil {
+ return DedicatedHostsClientListAvailableSizesResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DedicatedHostsClientListAvailableSizesResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return DedicatedHostsClientListAvailableSizesResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listAvailableSizesHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAvailableSizesCreateRequest creates the ListAvailableSizes request.
+func (client *DedicatedHostsClient) listAvailableSizesCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientListAvailableSizesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/hostSizes"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if hostGroupName == "" {
+ return nil, errors.New("parameter hostGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName))
+ if hostName == "" {
+ return nil, errors.New("parameter hostName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAvailableSizesHandleResponse handles the ListAvailableSizes response.
+func (client *DedicatedHostsClient) listAvailableSizesHandleResponse(resp *http.Response) (DedicatedHostsClientListAvailableSizesResponse, error) {
+ result := DedicatedHostsClientListAvailableSizesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostSizeListResult); err != nil {
+ return DedicatedHostsClientListAvailableSizesResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByHostGroupPager - Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property
+// in the response to get the next page of dedicated hosts.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - hostGroupName - The name of the dedicated host group.
+// - options - DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.NewListByHostGroupPager
+// method.
+func (client *DedicatedHostsClient) NewListByHostGroupPager(resourceGroupName string, hostGroupName string, options *DedicatedHostsClientListByHostGroupOptions) *runtime.Pager[DedicatedHostsClientListByHostGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DedicatedHostsClientListByHostGroupResponse]{
+ More: func(page DedicatedHostsClientListByHostGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DedicatedHostsClientListByHostGroupResponse) (DedicatedHostsClientListByHostGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DedicatedHostsClient.NewListByHostGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByHostGroupCreateRequest(ctx, resourceGroupName, hostGroupName, options)
+ }, nil)
+ if err != nil {
+ return DedicatedHostsClientListByHostGroupResponse{}, err
+ }
+ return client.listByHostGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByHostGroupCreateRequest creates the ListByHostGroup request.
+func (client *DedicatedHostsClient) listByHostGroupCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, options *DedicatedHostsClientListByHostGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if hostGroupName == "" {
+ return nil, errors.New("parameter hostGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByHostGroupHandleResponse handles the ListByHostGroup response.
+func (client *DedicatedHostsClient) listByHostGroupHandleResponse(resp *http.Response) (DedicatedHostsClientListByHostGroupResponse, error) {
+ result := DedicatedHostsClientListByHostGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DedicatedHostListResult); err != nil {
+ return DedicatedHostsClientListByHostGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginRestart - Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted
+// and is running. To determine the health of VMs deployed on the dedicated host after the
+// restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview
+// for more details.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - hostGroupName - The name of the dedicated host group.
+// - hostName - The name of the dedicated host.
+// - options - DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart
+// method.
+func (client *DedicatedHostsClient) BeginRestart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*runtime.Poller[DedicatedHostsClientRestartResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.restart(ctx, resourceGroupName, hostGroupName, hostName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Restart - Restart the dedicated host. The operation will complete successfully once the dedicated host has restarted and
+// is running. To determine the health of VMs deployed on the dedicated host after the
+// restart check the Resource Health Center in the Azure Portal. Please refer to https://docs.microsoft.com/azure/service-health/resource-health-overview
+// for more details.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *DedicatedHostsClient) restart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DedicatedHostsClient.BeginRestart"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.restartCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// restartCreateRequest creates the Restart request.
+func (client *DedicatedHostsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if hostGroupName == "" {
+ return nil, errors.New("parameter hostGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName))
+ if hostName == "" {
+ return nil, errors.New("parameter hostName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginUpdate - Update a dedicated host .
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - hostGroupName - The name of the dedicated host group.
+// - hostName - The name of the dedicated host .
+// - parameters - Parameters supplied to the Update Dedicated Host operation.
+// - options - DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate
+// method.
+func (client *DedicatedHostsClient) BeginUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*runtime.Poller[DedicatedHostsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, hostGroupName, hostName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DedicatedHostsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DedicatedHostsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update a dedicated host .
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *DedicatedHostsClient) update(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DedicatedHostsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, hostGroupName, hostName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *DedicatedHostsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if hostGroupName == "" {
+ return nil, errors.New("parameter hostGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostGroupName}", url.PathEscape(hostGroupName))
+ if hostName == "" {
+ return nil, errors.New("parameter hostName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.go
new file mode 100644
index 000000000..b189a0340
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.go
@@ -0,0 +1,846 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// DiskAccessesClient contains the methods for the DiskAccesses group.
+// Don't use this type directly, use NewDiskAccessesClient() instead.
+type DiskAccessesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewDiskAccessesClient creates a new instance of DiskAccessesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewDiskAccessesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskAccessesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &DiskAccessesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Creates or updates a disk access resource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption
+// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The
+// maximum name length is 80 characters.
+// - diskAccess - disk access object supplied in the body of the Put disk access operation.
+// - options - DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate
+// method.
+func (client *DiskAccessesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DiskAccessesClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, diskAccessName, diskAccess, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Creates or updates a disk access resource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DiskAccessesClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DiskAccessesClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskAccessName, diskAccess, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *DiskAccessesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess, options *DiskAccessesClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskAccessName == "" {
+ return nil, errors.New("parameter diskAccessName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, diskAccess); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a disk access resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption
+// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The
+// maximum name length is 80 characters.
+// - options - DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete
+// method.
+func (client *DiskAccessesClient) BeginDelete(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*runtime.Poller[DiskAccessesClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, diskAccessName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a disk access resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DiskAccessesClient) deleteOperation(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DiskAccessesClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskAccessName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *DiskAccessesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskAccessName == "" {
+ return nil, errors.New("parameter diskAccessName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginDeleteAPrivateEndpointConnection - Deletes a private endpoint connection under a disk access resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption
+// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The
+// maximum name length is 80 characters.
+// - privateEndpointConnectionName - The name of the private endpoint connection.
+// - options - DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection
+// method.
+func (client *DiskAccessesClient) BeginDeleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*runtime.Poller[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteAPrivateEndpointConnection(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientDeleteAPrivateEndpointConnectionResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// DeleteAPrivateEndpointConnection - Deletes a private endpoint connection under a disk access resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DiskAccessesClient) deleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DiskAccessesClient.BeginDeleteAPrivateEndpointConnection"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteAPrivateEndpointConnectionCreateRequest creates the DeleteAPrivateEndpointConnection request.
+func (client *DiskAccessesClient) deleteAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskAccessName == "" {
+ return nil, errors.New("parameter diskAccessName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName))
+ if privateEndpointConnectionName == "" {
+ return nil, errors.New("parameter privateEndpointConnectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets information about a disk access resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption
+// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The
+// maximum name length is 80 characters.
+// - options - DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method.
+func (client *DiskAccessesClient) Get(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetOptions) (DiskAccessesClientGetResponse, error) {
+ var err error
+ const operationName = "DiskAccessesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, diskAccessName, options)
+ if err != nil {
+ return DiskAccessesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DiskAccessesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DiskAccessesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *DiskAccessesClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskAccessName == "" {
+ return nil, errors.New("parameter diskAccessName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *DiskAccessesClient) getHandleResponse(resp *http.Response) (DiskAccessesClientGetResponse, error) {
+ result := DiskAccessesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccess); err != nil {
+ return DiskAccessesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetAPrivateEndpointConnection - Gets information about a private endpoint connection under a disk access resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption
+// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The
+// maximum name length is 80 characters.
+// - privateEndpointConnectionName - The name of the private endpoint connection.
+// - options - DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection
+// method.
+func (client *DiskAccessesClient) GetAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientGetAPrivateEndpointConnectionOptions) (DiskAccessesClientGetAPrivateEndpointConnectionResponse, error) {
+ var err error
+ const operationName = "DiskAccessesClient.GetAPrivateEndpointConnection"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, options)
+ if err != nil {
+ return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err
+ }
+ resp, err := client.getAPrivateEndpointConnectionHandleResponse(httpResp)
+ return resp, err
+}
+
+// getAPrivateEndpointConnectionCreateRequest creates the GetAPrivateEndpointConnection request.
+func (client *DiskAccessesClient) getAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, options *DiskAccessesClientGetAPrivateEndpointConnectionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskAccessName == "" {
+ return nil, errors.New("parameter diskAccessName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName))
+ if privateEndpointConnectionName == "" {
+ return nil, errors.New("parameter privateEndpointConnectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getAPrivateEndpointConnectionHandleResponse handles the GetAPrivateEndpointConnection response.
+func (client *DiskAccessesClient) getAPrivateEndpointConnectionHandleResponse(resp *http.Response) (DiskAccessesClientGetAPrivateEndpointConnectionResponse, error) {
+ result := DiskAccessesClientGetAPrivateEndpointConnectionResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil {
+ return DiskAccessesClientGetAPrivateEndpointConnectionResponse{}, err
+ }
+ return result, nil
+}
+
+// GetPrivateLinkResources - Gets the private link resources possible under disk access resource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption
+// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The
+// maximum name length is 80 characters.
+// - options - DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources
+// method.
+func (client *DiskAccessesClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetPrivateLinkResourcesOptions) (DiskAccessesClientGetPrivateLinkResourcesResponse, error) {
+ var err error
+ const operationName = "DiskAccessesClient.GetPrivateLinkResources"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getPrivateLinkResourcesCreateRequest(ctx, resourceGroupName, diskAccessName, options)
+ if err != nil {
+ return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err
+ }
+ resp, err := client.getPrivateLinkResourcesHandleResponse(httpResp)
+ return resp, err
+}
+
+// getPrivateLinkResourcesCreateRequest creates the GetPrivateLinkResources request.
+func (client *DiskAccessesClient) getPrivateLinkResourcesCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientGetPrivateLinkResourcesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskAccessName == "" {
+ return nil, errors.New("parameter diskAccessName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getPrivateLinkResourcesHandleResponse handles the GetPrivateLinkResources response.
+func (client *DiskAccessesClient) getPrivateLinkResourcesHandleResponse(resp *http.Response) (DiskAccessesClientGetPrivateLinkResourcesResponse, error) {
+ result := DiskAccessesClientGetPrivateLinkResourcesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil {
+ return DiskAccessesClientGetPrivateLinkResourcesResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists all the disk access resources under a subscription.
+//
+// Generated from API version 2023-04-02
+// - options - DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.NewListPager method.
+func (client *DiskAccessesClient) NewListPager(options *DiskAccessesClientListOptions) *runtime.Pager[DiskAccessesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListResponse]{
+ More: func(page DiskAccessesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DiskAccessesClientListResponse) (DiskAccessesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskAccessesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return DiskAccessesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *DiskAccessesClient) listCreateRequest(ctx context.Context, options *DiskAccessesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *DiskAccessesClient) listHandleResponse(resp *http.Response) (DiskAccessesClientListResponse, error) {
+ result := DiskAccessesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccessList); err != nil {
+ return DiskAccessesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Lists all the disk access resources under a resource group.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - options - DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.NewListByResourceGroupPager
+// method.
+func (client *DiskAccessesClient) NewListByResourceGroupPager(resourceGroupName string, options *DiskAccessesClientListByResourceGroupOptions) *runtime.Pager[DiskAccessesClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListByResourceGroupResponse]{
+ More: func(page DiskAccessesClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DiskAccessesClientListByResourceGroupResponse) (DiskAccessesClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskAccessesClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return DiskAccessesClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *DiskAccessesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DiskAccessesClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *DiskAccessesClient) listByResourceGroupHandleResponse(resp *http.Response) (DiskAccessesClientListByResourceGroupResponse, error) {
+ result := DiskAccessesClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DiskAccessList); err != nil {
+ return DiskAccessesClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPrivateEndpointConnectionsPager - List information about private endpoint connections under a disk access resource
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption
+// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The
+// maximum name length is 80 characters.
+// - options - DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.NewListPrivateEndpointConnectionsPager
+// method.
+func (client *DiskAccessesClient) NewListPrivateEndpointConnectionsPager(resourceGroupName string, diskAccessName string, options *DiskAccessesClientListPrivateEndpointConnectionsOptions) *runtime.Pager[DiskAccessesClientListPrivateEndpointConnectionsResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DiskAccessesClientListPrivateEndpointConnectionsResponse]{
+ More: func(page DiskAccessesClientListPrivateEndpointConnectionsResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DiskAccessesClientListPrivateEndpointConnectionsResponse) (DiskAccessesClientListPrivateEndpointConnectionsResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskAccessesClient.NewListPrivateEndpointConnectionsPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listPrivateEndpointConnectionsCreateRequest(ctx, resourceGroupName, diskAccessName, options)
+ }, nil)
+ if err != nil {
+ return DiskAccessesClientListPrivateEndpointConnectionsResponse{}, err
+ }
+ return client.listPrivateEndpointConnectionsHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listPrivateEndpointConnectionsCreateRequest creates the ListPrivateEndpointConnections request.
+func (client *DiskAccessesClient) listPrivateEndpointConnectionsCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, options *DiskAccessesClientListPrivateEndpointConnectionsOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskAccessName == "" {
+ return nil, errors.New("parameter diskAccessName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listPrivateEndpointConnectionsHandleResponse handles the ListPrivateEndpointConnections response.
+func (client *DiskAccessesClient) listPrivateEndpointConnectionsHandleResponse(resp *http.Response) (DiskAccessesClientListPrivateEndpointConnectionsResponse, error) {
+ result := DiskAccessesClientListPrivateEndpointConnectionsResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil {
+ return DiskAccessesClientListPrivateEndpointConnectionsResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - Updates (patches) a disk access resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption
+// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The
+// maximum name length is 80 characters.
+// - diskAccess - disk access object supplied in the body of the Patch disk access operation.
+// - options - DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate
+// method.
+func (client *DiskAccessesClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*runtime.Poller[DiskAccessesClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, diskAccessName, diskAccess, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Updates (patches) a disk access resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DiskAccessesClient) update(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DiskAccessesClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, diskAccessName, diskAccess, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *DiskAccessesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate, options *DiskAccessesClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskAccessName == "" {
+ return nil, errors.New("parameter diskAccessName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, diskAccess); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginUpdateAPrivateEndpointConnection - Approve or reject a private endpoint connection under disk access resource, this
+// can't be used to create a new private endpoint connection.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskAccessName - The name of the disk access resource that is being created. The name can't be changed after the disk encryption
+// set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The
+// maximum name length is 80 characters.
+// - privateEndpointConnectionName - The name of the private endpoint connection.
+// - privateEndpointConnection - private endpoint connection object supplied in the body of the Put private endpoint connection
+// operation.
+// - options - DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection
+// method.
+func (client *DiskAccessesClient) BeginUpdateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*runtime.Poller[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.updateAPrivateEndpointConnection(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskAccessesClientUpdateAPrivateEndpointConnectionResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// UpdateAPrivateEndpointConnection - Approve or reject a private endpoint connection under disk access resource, this can't
+// be used to create a new private endpoint connection.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DiskAccessesClient) updateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DiskAccessesClient.BeginUpdateAPrivateEndpointConnection"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateAPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateAPrivateEndpointConnectionCreateRequest creates the UpdateAPrivateEndpointConnection request.
+func (client *DiskAccessesClient) updateAPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskAccessName == "" {
+ return nil, errors.New("parameter diskAccessName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskAccessName}", url.PathEscape(diskAccessName))
+ if privateEndpointConnectionName == "" {
+ return nil, errors.New("parameter privateEndpointConnectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, privateEndpointConnection); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.go
new file mode 100644
index 000000000..9306f9c0d
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.go
@@ -0,0 +1,535 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// DiskEncryptionSetsClient contains the methods for the DiskEncryptionSets group.
+// Don't use this type directly, use NewDiskEncryptionSetsClient() instead.
+type DiskEncryptionSetsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewDiskEncryptionSetsClient creates a new instance of DiskEncryptionSetsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewDiskEncryptionSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskEncryptionSetsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &DiskEncryptionSetsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Creates or updates a disk encryption set
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the
+// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum
+// name length is 80 characters.
+// - diskEncryptionSet - disk encryption set object supplied in the body of the Put disk encryption set operation.
+// - options - DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate
+// method.
+func (client *DiskEncryptionSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DiskEncryptionSetsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskEncryptionSetsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskEncryptionSetsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Creates or updates a disk encryption set
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DiskEncryptionSetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DiskEncryptionSetsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *DiskEncryptionSetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet, options *DiskEncryptionSetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskEncryptionSetName == "" {
+ return nil, errors.New("parameter diskEncryptionSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, diskEncryptionSet); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a disk encryption set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the
+// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum
+// name length is 80 characters.
+// - options - DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete
+// method.
+func (client *DiskEncryptionSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*runtime.Poller[DiskEncryptionSetsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, diskEncryptionSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskEncryptionSetsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskEncryptionSetsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a disk encryption set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DiskEncryptionSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DiskEncryptionSetsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *DiskEncryptionSetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskEncryptionSetName == "" {
+ return nil, errors.New("parameter diskEncryptionSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets information about a disk encryption set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the
+// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum
+// name length is 80 characters.
+// - options - DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method.
+func (client *DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientGetOptions) (DiskEncryptionSetsClientGetResponse, error) {
+ var err error
+ const operationName = "DiskEncryptionSetsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options)
+ if err != nil {
+ return DiskEncryptionSetsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DiskEncryptionSetsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DiskEncryptionSetsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *DiskEncryptionSetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskEncryptionSetName == "" {
+ return nil, errors.New("parameter diskEncryptionSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *DiskEncryptionSetsClient) getHandleResponse(resp *http.Response) (DiskEncryptionSetsClientGetResponse, error) {
+ result := DiskEncryptionSetsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSet); err != nil {
+ return DiskEncryptionSetsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists all the disk encryption sets under a subscription.
+//
+// Generated from API version 2023-04-02
+// - options - DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListPager
+// method.
+func (client *DiskEncryptionSetsClient) NewListPager(options *DiskEncryptionSetsClientListOptions) *runtime.Pager[DiskEncryptionSetsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListResponse]{
+ More: func(page DiskEncryptionSetsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListResponse) (DiskEncryptionSetsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskEncryptionSetsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return DiskEncryptionSetsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *DiskEncryptionSetsClient) listCreateRequest(ctx context.Context, options *DiskEncryptionSetsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *DiskEncryptionSetsClient) listHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListResponse, error) {
+ result := DiskEncryptionSetsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSetList); err != nil {
+ return DiskEncryptionSetsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAssociatedResourcesPager - Lists all resources that are encrypted with this disk encryption set.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the
+// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum
+// name length is 80 characters.
+// - options - DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListAssociatedResourcesPager
+// method.
+func (client *DiskEncryptionSetsClient) NewListAssociatedResourcesPager(resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientListAssociatedResourcesOptions) *runtime.Pager[DiskEncryptionSetsClientListAssociatedResourcesResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListAssociatedResourcesResponse]{
+ More: func(page DiskEncryptionSetsClientListAssociatedResourcesResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListAssociatedResourcesResponse) (DiskEncryptionSetsClientListAssociatedResourcesResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskEncryptionSetsClient.NewListAssociatedResourcesPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAssociatedResourcesCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, options)
+ }, nil)
+ if err != nil {
+ return DiskEncryptionSetsClientListAssociatedResourcesResponse{}, err
+ }
+ return client.listAssociatedResourcesHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAssociatedResourcesCreateRequest creates the ListAssociatedResources request.
+func (client *DiskEncryptionSetsClient) listAssociatedResourcesCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, options *DiskEncryptionSetsClientListAssociatedResourcesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskEncryptionSetName == "" {
+ return nil, errors.New("parameter diskEncryptionSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAssociatedResourcesHandleResponse handles the ListAssociatedResources response.
+func (client *DiskEncryptionSetsClient) listAssociatedResourcesHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListAssociatedResourcesResponse, error) {
+ result := DiskEncryptionSetsClientListAssociatedResourcesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ResourceURIList); err != nil {
+ return DiskEncryptionSetsClientListAssociatedResourcesResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Lists all the disk encryption sets under a resource group.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - options - DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListByResourceGroupPager
+// method.
+func (client *DiskEncryptionSetsClient) NewListByResourceGroupPager(resourceGroupName string, options *DiskEncryptionSetsClientListByResourceGroupOptions) *runtime.Pager[DiskEncryptionSetsClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DiskEncryptionSetsClientListByResourceGroupResponse]{
+ More: func(page DiskEncryptionSetsClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DiskEncryptionSetsClientListByResourceGroupResponse) (DiskEncryptionSetsClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskEncryptionSetsClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return DiskEncryptionSetsClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *DiskEncryptionSetsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DiskEncryptionSetsClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *DiskEncryptionSetsClient) listByResourceGroupHandleResponse(resp *http.Response) (DiskEncryptionSetsClientListByResourceGroupResponse, error) {
+ result := DiskEncryptionSetsClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DiskEncryptionSetList); err != nil {
+ return DiskEncryptionSetsClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - Updates (patches) a disk encryption set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskEncryptionSetName - The name of the disk encryption set that is being created. The name can't be changed after the
+// disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum
+// name length is 80 characters.
+// - diskEncryptionSet - disk encryption set object supplied in the body of the Patch disk encryption set operation.
+// - options - DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate
+// method.
+func (client *DiskEncryptionSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*runtime.Poller[DiskEncryptionSetsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskEncryptionSetsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskEncryptionSetsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Updates (patches) a disk encryption set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DiskEncryptionSetsClient) update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DiskEncryptionSetsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *DiskEncryptionSetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate, options *DiskEncryptionSetsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskEncryptionSetName == "" {
+ return nil, errors.New("parameter diskEncryptionSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskEncryptionSetName}", url.PathEscape(diskEncryptionSetName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, diskEncryptionSet); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.go
new file mode 100644
index 000000000..54b576957
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.go
@@ -0,0 +1,367 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// DiskRestorePointClient contains the methods for the DiskRestorePoint group.
+// Don't use this type directly, use NewDiskRestorePointClient() instead.
+type DiskRestorePointClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewDiskRestorePointClient creates a new instance of DiskRestorePointClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewDiskRestorePointClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiskRestorePointClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &DiskRestorePointClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Get disk restorePoint resource
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs.
+// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs.
+// - diskRestorePointName - The name of the disk restore point created.
+// - options - DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method.
+func (client *DiskRestorePointClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientGetOptions) (DiskRestorePointClientGetResponse, error) {
+ var err error
+ const operationName = "DiskRestorePointClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options)
+ if err != nil {
+ return DiskRestorePointClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DiskRestorePointClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DiskRestorePointClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *DiskRestorePointClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if restorePointCollectionName == "" {
+ return nil, errors.New("parameter restorePointCollectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName))
+ if vmRestorePointName == "" {
+ return nil, errors.New("parameter vmRestorePointName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName))
+ if diskRestorePointName == "" {
+ return nil, errors.New("parameter diskRestorePointName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *DiskRestorePointClient) getHandleResponse(resp *http.Response) (DiskRestorePointClientGetResponse, error) {
+ result := DiskRestorePointClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DiskRestorePoint); err != nil {
+ return DiskRestorePointClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginGrantAccess - Grants access to a diskRestorePoint.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs.
+// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs.
+// - diskRestorePointName - The name of the disk restore point created.
+// - grantAccessData - Access data object supplied in the body of the get disk access operation.
+// - options - DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess
+// method.
+func (client *DiskRestorePointClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*runtime.Poller[DiskRestorePointClientGrantAccessResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.grantAccess(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskRestorePointClientGrantAccessResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskRestorePointClientGrantAccessResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// GrantAccess - Grants access to a diskRestorePoint.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DiskRestorePointClient) grantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DiskRestorePointClient.BeginGrantAccess"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, grantAccessData, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// grantAccessCreateRequest creates the GrantAccess request.
+func (client *DiskRestorePointClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData, options *DiskRestorePointClientBeginGrantAccessOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if restorePointCollectionName == "" {
+ return nil, errors.New("parameter restorePointCollectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName))
+ if vmRestorePointName == "" {
+ return nil, errors.New("parameter vmRestorePointName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName))
+ if diskRestorePointName == "" {
+ return nil, errors.New("parameter diskRestorePointName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, grantAccessData); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// NewListByRestorePointPager - Lists diskRestorePoints under a vmRestorePoint.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs.
+// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs.
+// - options - DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.NewListByRestorePointPager
+// method.
+func (client *DiskRestorePointClient) NewListByRestorePointPager(resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, options *DiskRestorePointClientListByRestorePointOptions) *runtime.Pager[DiskRestorePointClientListByRestorePointResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DiskRestorePointClientListByRestorePointResponse]{
+ More: func(page DiskRestorePointClientListByRestorePointResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DiskRestorePointClientListByRestorePointResponse) (DiskRestorePointClientListByRestorePointResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DiskRestorePointClient.NewListByRestorePointPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByRestorePointCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, options)
+ }, nil)
+ if err != nil {
+ return DiskRestorePointClientListByRestorePointResponse{}, err
+ }
+ return client.listByRestorePointHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByRestorePointCreateRequest creates the ListByRestorePoint request.
+func (client *DiskRestorePointClient) listByRestorePointCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, options *DiskRestorePointClientListByRestorePointOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if restorePointCollectionName == "" {
+ return nil, errors.New("parameter restorePointCollectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName))
+ if vmRestorePointName == "" {
+ return nil, errors.New("parameter vmRestorePointName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByRestorePointHandleResponse handles the ListByRestorePoint response.
+func (client *DiskRestorePointClient) listByRestorePointHandleResponse(resp *http.Response) (DiskRestorePointClientListByRestorePointResponse, error) {
+ result := DiskRestorePointClientListByRestorePointResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DiskRestorePointList); err != nil {
+ return DiskRestorePointClientListByRestorePointResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginRevokeAccess - Revokes access to a diskRestorePoint.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - restorePointCollectionName - The name of the restore point collection that the disk restore point belongs.
+// - vmRestorePointName - The name of the vm restore point that the disk disk restore point belongs.
+// - diskRestorePointName - The name of the disk restore point created.
+// - options - DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess
+// method.
+func (client *DiskRestorePointClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*runtime.Poller[DiskRestorePointClientRevokeAccessResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.revokeAccess(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DiskRestorePointClientRevokeAccessResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DiskRestorePointClientRevokeAccessResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// RevokeAccess - Revokes access to a diskRestorePoint.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DiskRestorePointClient) revokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DiskRestorePointClient.BeginRevokeAccess"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, restorePointCollectionName, vmRestorePointName, diskRestorePointName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// revokeAccessCreateRequest creates the RevokeAccess request.
+func (client *DiskRestorePointClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, vmRestorePointName string, diskRestorePointName string, options *DiskRestorePointClientBeginRevokeAccessOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if restorePointCollectionName == "" {
+ return nil, errors.New("parameter restorePointCollectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName))
+ if vmRestorePointName == "" {
+ return nil, errors.New("parameter vmRestorePointName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmRestorePointName}", url.PathEscape(vmRestorePointName))
+ if diskRestorePointName == "" {
+ return nil, errors.New("parameter diskRestorePointName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskRestorePointName}", url.PathEscape(diskRestorePointName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.go
new file mode 100644
index 000000000..854a8ffd6
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.go
@@ -0,0 +1,623 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// DisksClient contains the methods for the Disks group.
+// Don't use this type directly, use NewDisksClient() instead.
+type DisksClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewDisksClient creates a new instance of DisksClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewDisksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DisksClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &DisksClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Creates or updates a disk.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported
+// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80
+// characters.
+// - disk - Disk object supplied in the body of the Put disk operation.
+// - options - DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate
+// method.
+func (client *DisksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*runtime.Poller[DisksClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, diskName, disk, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Creates or updates a disk.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DisksClient) createOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DisksClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, diskName, disk, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *DisksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, diskName string, disk Disk, options *DisksClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskName == "" {
+ return nil, errors.New("parameter diskName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, disk); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a disk.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported
+// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80
+// characters.
+// - options - DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method.
+func (client *DisksClient) BeginDelete(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*runtime.Poller[DisksClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, diskName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a disk.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DisksClient) deleteOperation(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DisksClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, diskName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *DisksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskName == "" {
+ return nil, errors.New("parameter diskName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// Get - Gets information about a disk.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported
+// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80
+// characters.
+// - options - DisksClientGetOptions contains the optional parameters for the DisksClient.Get method.
+func (client *DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientGetOptions) (DisksClientGetResponse, error) {
+ var err error
+ const operationName = "DisksClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, diskName, options)
+ if err != nil {
+ return DisksClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DisksClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DisksClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *DisksClient) getCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskName == "" {
+ return nil, errors.New("parameter diskName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *DisksClient) getHandleResponse(resp *http.Response) (DisksClientGetResponse, error) {
+ result := DisksClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Disk); err != nil {
+ return DisksClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginGrantAccess - Grants access to a disk.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported
+// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80
+// characters.
+// - grantAccessData - Access data object supplied in the body of the get disk access operation.
+// - options - DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method.
+func (client *DisksClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*runtime.Poller[DisksClientGrantAccessResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.grantAccess(ctx, resourceGroupName, diskName, grantAccessData, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientGrantAccessResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientGrantAccessResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// GrantAccess - Grants access to a disk.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DisksClient) grantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DisksClient.BeginGrantAccess"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, diskName, grantAccessData, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// grantAccessCreateRequest creates the GrantAccess request.
+func (client *DisksClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData, options *DisksClientBeginGrantAccessOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskName == "" {
+ return nil, errors.New("parameter diskName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, grantAccessData); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// NewListPager - Lists all the disks under a subscription.
+//
+// Generated from API version 2023-04-02
+// - options - DisksClientListOptions contains the optional parameters for the DisksClient.NewListPager method.
+func (client *DisksClient) NewListPager(options *DisksClientListOptions) *runtime.Pager[DisksClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DisksClientListResponse]{
+ More: func(page DisksClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DisksClientListResponse) (DisksClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DisksClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return DisksClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *DisksClient) listCreateRequest(ctx context.Context, options *DisksClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *DisksClient) listHandleResponse(resp *http.Response) (DisksClientListResponse, error) {
+ result := DisksClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DiskList); err != nil {
+ return DisksClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Lists all the disks under a resource group.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - options - DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.NewListByResourceGroupPager
+// method.
+func (client *DisksClient) NewListByResourceGroupPager(resourceGroupName string, options *DisksClientListByResourceGroupOptions) *runtime.Pager[DisksClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DisksClientListByResourceGroupResponse]{
+ More: func(page DisksClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DisksClientListByResourceGroupResponse) (DisksClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DisksClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return DisksClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *DisksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DisksClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *DisksClient) listByResourceGroupHandleResponse(resp *http.Response) (DisksClientListByResourceGroupResponse, error) {
+ result := DisksClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DiskList); err != nil {
+ return DisksClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginRevokeAccess - Revokes access to a disk.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported
+// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80
+// characters.
+// - options - DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method.
+func (client *DisksClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*runtime.Poller[DisksClientRevokeAccessResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.revokeAccess(ctx, resourceGroupName, diskName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientRevokeAccessResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientRevokeAccessResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// RevokeAccess - Revokes access to a disk.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DisksClient) revokeAccess(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DisksClient.BeginRevokeAccess"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, diskName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// revokeAccessCreateRequest creates the RevokeAccess request.
+func (client *DisksClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, diskName string, options *DisksClientBeginRevokeAccessOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskName == "" {
+ return nil, errors.New("parameter diskName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// BeginUpdate - Updates (patches) a disk.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - diskName - The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported
+// characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80
+// characters.
+// - disk - Disk object supplied in the body of the Patch disk operation.
+// - options - DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method.
+func (client *DisksClient) BeginUpdate(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*runtime.Poller[DisksClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, diskName, disk, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DisksClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DisksClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Updates (patches) a disk.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *DisksClient) update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DisksClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, diskName, disk, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *DisksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate, options *DisksClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if diskName == "" {
+ return nil, errors.New("parameter diskName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{diskName}", url.PathEscape(diskName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, disk); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.go
new file mode 100644
index 000000000..5bd114c06
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.go
@@ -0,0 +1,465 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// GalleriesClient contains the methods for the Galleries group.
+// Don't use this type directly, use NewGalleriesClient() instead.
+type GalleriesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewGalleriesClient creates a new instance of GalleriesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleriesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &GalleriesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Create or update a Shared Image Gallery.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with dots and periods
+// allowed in the middle. The maximum length is 80 characters.
+// - gallery - Parameters supplied to the create or update Shared Image Gallery operation.
+// - options - GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate
+// method.
+func (client *GalleriesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleriesClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, gallery, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleriesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleriesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Create or update a Shared Image Gallery.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleriesClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, gallery, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *GalleriesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, gallery); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Delete a Shared Image Gallery.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery to be deleted.
+// - options - GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method.
+func (client *GalleriesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*runtime.Poller[GalleriesClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleriesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleriesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Delete a Shared Image Gallery.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleriesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleriesClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *GalleriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Retrieves information about a Shared Image Gallery.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery.
+// - options - GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method.
+func (client *GalleriesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientGetOptions) (GalleriesClientGetResponse, error) {
+ var err error
+ const operationName = "GalleriesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, options)
+ if err != nil {
+ return GalleriesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return GalleriesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return GalleriesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *GalleriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ if options != nil && options.Select != nil {
+ reqQP.Set("$select", string(*options.Select))
+ }
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *GalleriesClient) getHandleResponse(resp *http.Response) (GalleriesClientGetResponse, error) {
+ result := GalleriesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Gallery); err != nil {
+ return GalleriesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List galleries under a subscription.
+//
+// Generated from API version 2022-03-03
+// - options - GalleriesClientListOptions contains the optional parameters for the GalleriesClient.NewListPager method.
+func (client *GalleriesClient) NewListPager(options *GalleriesClientListOptions) *runtime.Pager[GalleriesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[GalleriesClientListResponse]{
+ More: func(page GalleriesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *GalleriesClientListResponse) (GalleriesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleriesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return GalleriesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *GalleriesClient) listCreateRequest(ctx context.Context, options *GalleriesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *GalleriesClient) listHandleResponse(resp *http.Response) (GalleriesClientListResponse, error) {
+ result := GalleriesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GalleryList); err != nil {
+ return GalleriesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - List galleries under a resource group.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - options - GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.NewListByResourceGroupPager
+// method.
+func (client *GalleriesClient) NewListByResourceGroupPager(resourceGroupName string, options *GalleriesClientListByResourceGroupOptions) *runtime.Pager[GalleriesClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[GalleriesClientListByResourceGroupResponse]{
+ More: func(page GalleriesClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *GalleriesClientListByResourceGroupResponse) (GalleriesClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleriesClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return GalleriesClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *GalleriesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *GalleriesClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *GalleriesClient) listByResourceGroupHandleResponse(resp *http.Response) (GalleriesClientListByResourceGroupResponse, error) {
+ result := GalleriesClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GalleryList); err != nil {
+ return GalleriesClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - Update a Shared Image Gallery.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with dots and periods
+// allowed in the middle. The maximum length is 80 characters.
+// - gallery - Parameters supplied to the update Shared Image Gallery operation.
+// - options - GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method.
+func (client *GalleriesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*runtime.Poller[GalleriesClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, galleryName, gallery, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleriesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleriesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update a Shared Image Gallery.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleriesClient) update(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleriesClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, gallery, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *GalleriesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, gallery); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.go
new file mode 100644
index 000000000..897c18a2f
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.go
@@ -0,0 +1,434 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// GalleryApplicationsClient contains the methods for the GalleryApplications group.
+// Don't use this type directly, use NewGalleryApplicationsClient() instead.
+type GalleryApplicationsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewGalleryApplicationsClient creates a new instance of GalleryApplicationsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewGalleryApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryApplicationsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &GalleryApplicationsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Create or update a gallery Application Definition.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Application Gallery in which the Application Definition is to be created.
+// - galleryApplicationName - The name of the gallery Application Definition to be created or updated. The allowed characters
+// are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80
+// characters.
+// - galleryApplication - Parameters supplied to the create or update gallery Application operation.
+// - options - GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate
+// method.
+func (client *GalleryApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryApplicationsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Create or update a gallery Application Definition.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryApplicationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryApplicationsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *GalleryApplicationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryApplicationName == "" {
+ return nil, errors.New("parameter galleryApplicationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, galleryApplication); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Delete a gallery Application.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Application Gallery in which the Application Definition is to be deleted.
+// - galleryApplicationName - The name of the gallery Application Definition to be deleted.
+// - options - GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete
+// method.
+func (client *GalleryApplicationsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*runtime.Poller[GalleryApplicationsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryApplicationName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Delete a gallery Application.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryApplicationsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *GalleryApplicationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryApplicationName == "" {
+ return nil, errors.New("parameter galleryApplicationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Retrieves information about a gallery Application Definition.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Application Gallery from which the Application Definitions are to be retrieved.
+// - galleryApplicationName - The name of the gallery Application Definition to be retrieved.
+// - options - GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method.
+func (client *GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientGetOptions) (GalleryApplicationsClientGetResponse, error) {
+ var err error
+ const operationName = "GalleryApplicationsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options)
+ if err != nil {
+ return GalleryApplicationsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return GalleryApplicationsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return GalleryApplicationsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *GalleryApplicationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryApplicationName == "" {
+ return nil, errors.New("parameter galleryApplicationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *GalleryApplicationsClient) getHandleResponse(resp *http.Response) (GalleryApplicationsClientGetResponse, error) {
+ result := GalleryApplicationsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplication); err != nil {
+ return GalleryApplicationsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByGalleryPager - List gallery Application Definitions in a gallery.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Application Gallery from which Application Definitions are to be listed.
+// - options - GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.NewListByGalleryPager
+// method.
+func (client *GalleryApplicationsClient) NewListByGalleryPager(resourceGroupName string, galleryName string, options *GalleryApplicationsClientListByGalleryOptions) *runtime.Pager[GalleryApplicationsClientListByGalleryResponse] {
+ return runtime.NewPager(runtime.PagingHandler[GalleryApplicationsClientListByGalleryResponse]{
+ More: func(page GalleryApplicationsClientListByGalleryResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *GalleryApplicationsClientListByGalleryResponse) (GalleryApplicationsClientListByGalleryResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryApplicationsClient.NewListByGalleryPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByGalleryCreateRequest(ctx, resourceGroupName, galleryName, options)
+ }, nil)
+ if err != nil {
+ return GalleryApplicationsClientListByGalleryResponse{}, err
+ }
+ return client.listByGalleryHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByGalleryCreateRequest creates the ListByGallery request.
+func (client *GalleryApplicationsClient) listByGalleryCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleryApplicationsClientListByGalleryOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByGalleryHandleResponse handles the ListByGallery response.
+func (client *GalleryApplicationsClient) listByGalleryHandleResponse(resp *http.Response) (GalleryApplicationsClientListByGalleryResponse, error) {
+ result := GalleryApplicationsClientListByGalleryResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationList); err != nil {
+ return GalleryApplicationsClientListByGalleryResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - Update a gallery Application Definition.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Application Gallery in which the Application Definition is to be updated.
+// - galleryApplicationName - The name of the gallery Application Definition to be updated. The allowed characters are alphabets
+// and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80
+// characters.
+// - galleryApplication - Parameters supplied to the update gallery Application operation.
+// - options - GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate
+// method.
+func (client *GalleryApplicationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*runtime.Poller[GalleryApplicationsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update a gallery Application Definition.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryApplicationsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryApplicationsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *GalleryApplicationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryApplicationName == "" {
+ return nil, errors.New("parameter galleryApplicationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, galleryApplication); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.go
new file mode 100644
index 000000000..3148aa31d
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.go
@@ -0,0 +1,464 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// GalleryApplicationVersionsClient contains the methods for the GalleryApplicationVersions group.
+// Don't use this type directly, use NewGalleryApplicationVersionsClient() instead.
+type GalleryApplicationVersionsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewGalleryApplicationVersionsClient creates a new instance of GalleryApplicationVersionsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewGalleryApplicationVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryApplicationVersionsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &GalleryApplicationVersionsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Create or update a gallery Application Version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Application Gallery in which the Application Definition resides.
+// - galleryApplicationName - The name of the gallery Application Definition in which the Application Version is to be created.
+// - galleryApplicationVersionName - The name of the gallery Application Version to be created. Needs to follow semantic version
+// name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit
+// integer. Format: ..
+// - galleryApplicationVersion - Parameters supplied to the create or update gallery Application Version operation.
+// - options - GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate
+// method.
+func (client *GalleryApplicationVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryApplicationVersionsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationVersionsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationVersionsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Create or update a gallery Application Version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryApplicationVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryApplicationVersionsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *GalleryApplicationVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryApplicationName == "" {
+ return nil, errors.New("parameter galleryApplicationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName))
+ if galleryApplicationVersionName == "" {
+ return nil, errors.New("parameter galleryApplicationVersionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, galleryApplicationVersion); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Delete a gallery Application Version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Application Gallery in which the Application Definition resides.
+// - galleryApplicationName - The name of the gallery Application Definition in which the Application Version resides.
+// - galleryApplicationVersionName - The name of the gallery Application Version to be deleted.
+// - options - GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete
+// method.
+func (client *GalleryApplicationVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*runtime.Poller[GalleryApplicationVersionsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationVersionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationVersionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Delete a gallery Application Version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryApplicationVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryApplicationVersionsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *GalleryApplicationVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryApplicationName == "" {
+ return nil, errors.New("parameter galleryApplicationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName))
+ if galleryApplicationVersionName == "" {
+ return nil, errors.New("parameter galleryApplicationVersionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Retrieves information about a gallery Application Version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Application Gallery in which the Application Definition resides.
+// - galleryApplicationName - The name of the gallery Application Definition in which the Application Version resides.
+// - galleryApplicationVersionName - The name of the gallery Application Version to be retrieved.
+// - options - GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get
+// method.
+func (client *GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientGetOptions) (GalleryApplicationVersionsClientGetResponse, error) {
+ var err error
+ const operationName = "GalleryApplicationVersionsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options)
+ if err != nil {
+ return GalleryApplicationVersionsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return GalleryApplicationVersionsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return GalleryApplicationVersionsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *GalleryApplicationVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryApplicationName == "" {
+ return nil, errors.New("parameter galleryApplicationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName))
+ if galleryApplicationVersionName == "" {
+ return nil, errors.New("parameter galleryApplicationVersionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *GalleryApplicationVersionsClient) getHandleResponse(resp *http.Response) (GalleryApplicationVersionsClientGetResponse, error) {
+ result := GalleryApplicationVersionsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationVersion); err != nil {
+ return GalleryApplicationVersionsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByGalleryApplicationPager - List gallery Application Versions in a gallery Application Definition.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Application Gallery in which the Application Definition resides.
+// - galleryApplicationName - The name of the Shared Application Gallery Application Definition from which the Application Versions
+// are to be listed.
+// - options - GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.NewListByGalleryApplicationPager
+// method.
+func (client *GalleryApplicationVersionsClient) NewListByGalleryApplicationPager(resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationVersionsClientListByGalleryApplicationOptions) *runtime.Pager[GalleryApplicationVersionsClientListByGalleryApplicationResponse] {
+ return runtime.NewPager(runtime.PagingHandler[GalleryApplicationVersionsClientListByGalleryApplicationResponse]{
+ More: func(page GalleryApplicationVersionsClientListByGalleryApplicationResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *GalleryApplicationVersionsClientListByGalleryApplicationResponse) (GalleryApplicationVersionsClientListByGalleryApplicationResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryApplicationVersionsClient.NewListByGalleryApplicationPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByGalleryApplicationCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options)
+ }, nil)
+ if err != nil {
+ return GalleryApplicationVersionsClientListByGalleryApplicationResponse{}, err
+ }
+ return client.listByGalleryApplicationHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByGalleryApplicationCreateRequest creates the ListByGalleryApplication request.
+func (client *GalleryApplicationVersionsClient) listByGalleryApplicationCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationVersionsClientListByGalleryApplicationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryApplicationName == "" {
+ return nil, errors.New("parameter galleryApplicationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByGalleryApplicationHandleResponse handles the ListByGalleryApplication response.
+func (client *GalleryApplicationVersionsClient) listByGalleryApplicationHandleResponse(resp *http.Response) (GalleryApplicationVersionsClientListByGalleryApplicationResponse, error) {
+ result := GalleryApplicationVersionsClientListByGalleryApplicationResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GalleryApplicationVersionList); err != nil {
+ return GalleryApplicationVersionsClientListByGalleryApplicationResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - Update a gallery Application Version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Application Gallery in which the Application Definition resides.
+// - galleryApplicationName - The name of the gallery Application Definition in which the Application Version is to be updated.
+// - galleryApplicationVersionName - The name of the gallery Application Version to be updated. Needs to follow semantic version
+// name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit
+// integer. Format: ..
+// - galleryApplicationVersion - Parameters supplied to the update gallery Application Version operation.
+// - options - GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate
+// method.
+func (client *GalleryApplicationVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*runtime.Poller[GalleryApplicationVersionsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryApplicationVersionsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryApplicationVersionsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update a gallery Application Version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryApplicationVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryApplicationVersionsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *GalleryApplicationVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryApplicationName == "" {
+ return nil, errors.New("parameter galleryApplicationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationName}", url.PathEscape(galleryApplicationName))
+ if galleryApplicationVersionName == "" {
+ return nil, errors.New("parameter galleryApplicationVersionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryApplicationVersionName}", url.PathEscape(galleryApplicationVersionName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, galleryApplicationVersion); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.go
new file mode 100644
index 000000000..84fc57a2b
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.go
@@ -0,0 +1,433 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// GalleryImagesClient contains the methods for the GalleryImages group.
+// Don't use this type directly, use NewGalleryImagesClient() instead.
+type GalleryImagesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewGalleryImagesClient creates a new instance of GalleryImagesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryImagesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &GalleryImagesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Create or update a gallery image definition.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery in which the Image Definition is to be created.
+// - galleryImageName - The name of the gallery image definition to be created or updated. The allowed characters are alphabets
+// and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80
+// characters.
+// - galleryImage - Parameters supplied to the create or update gallery image operation.
+// - options - GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate
+// method.
+func (client *GalleryImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryImagesClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImagesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImagesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Create or update a gallery image definition.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryImagesClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *GalleryImagesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, galleryImage); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Delete a gallery image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery in which the Image Definition is to be deleted.
+// - galleryImageName - The name of the gallery image definition to be deleted.
+// - options - GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete
+// method.
+func (client *GalleryImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*runtime.Poller[GalleryImagesClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryImageName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImagesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImagesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Delete a gallery image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryImagesClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *GalleryImagesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Retrieves information about a gallery image definition.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery from which the Image Definitions are to be retrieved.
+// - galleryImageName - The name of the gallery image definition to be retrieved.
+// - options - GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method.
+func (client *GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientGetOptions) (GalleryImagesClientGetResponse, error) {
+ var err error
+ const operationName = "GalleryImagesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options)
+ if err != nil {
+ return GalleryImagesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return GalleryImagesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return GalleryImagesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *GalleryImagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *GalleryImagesClient) getHandleResponse(resp *http.Response) (GalleryImagesClientGetResponse, error) {
+ result := GalleryImagesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImage); err != nil {
+ return GalleryImagesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByGalleryPager - List gallery image definitions in a gallery.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery from which Image Definitions are to be listed.
+// - options - GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.NewListByGalleryPager
+// method.
+func (client *GalleryImagesClient) NewListByGalleryPager(resourceGroupName string, galleryName string, options *GalleryImagesClientListByGalleryOptions) *runtime.Pager[GalleryImagesClientListByGalleryResponse] {
+ return runtime.NewPager(runtime.PagingHandler[GalleryImagesClientListByGalleryResponse]{
+ More: func(page GalleryImagesClientListByGalleryResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *GalleryImagesClientListByGalleryResponse) (GalleryImagesClientListByGalleryResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryImagesClient.NewListByGalleryPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByGalleryCreateRequest(ctx, resourceGroupName, galleryName, options)
+ }, nil)
+ if err != nil {
+ return GalleryImagesClientListByGalleryResponse{}, err
+ }
+ return client.listByGalleryHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByGalleryCreateRequest creates the ListByGallery request.
+func (client *GalleryImagesClient) listByGalleryCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleryImagesClientListByGalleryOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByGalleryHandleResponse handles the ListByGallery response.
+func (client *GalleryImagesClient) listByGalleryHandleResponse(resp *http.Response) (GalleryImagesClientListByGalleryResponse, error) {
+ result := GalleryImagesClientListByGalleryResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageList); err != nil {
+ return GalleryImagesClientListByGalleryResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - Update a gallery image definition.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery in which the Image Definition is to be updated.
+// - galleryImageName - The name of the gallery image definition to be updated. The allowed characters are alphabets and numbers
+// with dots, dashes, and periods allowed in the middle. The maximum length is 80 characters.
+// - galleryImage - Parameters supplied to the update gallery image operation.
+// - options - GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate
+// method.
+func (client *GalleryImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*runtime.Poller[GalleryImagesClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImagesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImagesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update a gallery image definition.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryImagesClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryImagesClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *GalleryImagesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, galleryImage); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.go
new file mode 100644
index 000000000..7bbe1f00f
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.go
@@ -0,0 +1,463 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// GalleryImageVersionsClient contains the methods for the GalleryImageVersions group.
+// Don't use this type directly, use NewGalleryImageVersionsClient() instead.
+type GalleryImageVersionsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewGalleryImageVersionsClient creates a new instance of GalleryImageVersionsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryImageVersionsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &GalleryImageVersionsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Create or update a gallery image version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery in which the Image Definition resides.
+// - galleryImageName - The name of the gallery image definition in which the Image Version is to be created.
+// - galleryImageVersionName - The name of the gallery image version to be created. Needs to follow semantic version name pattern:
+// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer.
+// Format: ..
+// - galleryImageVersion - Parameters supplied to the create or update gallery image version operation.
+// - options - GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate
+// method.
+func (client *GalleryImageVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryImageVersionsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImageVersionsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImageVersionsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Create or update a gallery image version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryImageVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryImageVersionsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *GalleryImageVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ if galleryImageVersionName == "" {
+ return nil, errors.New("parameter galleryImageVersionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, galleryImageVersion); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Delete a gallery image version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery in which the Image Definition resides.
+// - galleryImageName - The name of the gallery image definition in which the Image Version resides.
+// - galleryImageVersionName - The name of the gallery image version to be deleted.
+// - options - GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete
+// method.
+func (client *GalleryImageVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*runtime.Poller[GalleryImageVersionsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImageVersionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImageVersionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Delete a gallery image version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryImageVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryImageVersionsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *GalleryImageVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ if galleryImageVersionName == "" {
+ return nil, errors.New("parameter galleryImageVersionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Retrieves information about a gallery image version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery in which the Image Definition resides.
+// - galleryImageName - The name of the gallery image definition in which the Image Version resides.
+// - galleryImageVersionName - The name of the gallery image version to be retrieved.
+// - options - GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get
+// method.
+func (client *GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientGetOptions) (GalleryImageVersionsClientGetResponse, error) {
+ var err error
+ const operationName = "GalleryImageVersionsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options)
+ if err != nil {
+ return GalleryImageVersionsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return GalleryImageVersionsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return GalleryImageVersionsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *GalleryImageVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ if galleryImageVersionName == "" {
+ return nil, errors.New("parameter galleryImageVersionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *GalleryImageVersionsClient) getHandleResponse(resp *http.Response) (GalleryImageVersionsClientGetResponse, error) {
+ result := GalleryImageVersionsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageVersion); err != nil {
+ return GalleryImageVersionsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByGalleryImagePager - List gallery image versions in a gallery image definition.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery in which the Image Definition resides.
+// - galleryImageName - The name of the Shared Image Gallery Image Definition from which the Image Versions are to be listed.
+// - options - GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.NewListByGalleryImagePager
+// method.
+func (client *GalleryImageVersionsClient) NewListByGalleryImagePager(resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImageVersionsClientListByGalleryImageOptions) *runtime.Pager[GalleryImageVersionsClientListByGalleryImageResponse] {
+ return runtime.NewPager(runtime.PagingHandler[GalleryImageVersionsClientListByGalleryImageResponse]{
+ More: func(page GalleryImageVersionsClientListByGalleryImageResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *GalleryImageVersionsClientListByGalleryImageResponse) (GalleryImageVersionsClientListByGalleryImageResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryImageVersionsClient.NewListByGalleryImagePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByGalleryImageCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options)
+ }, nil)
+ if err != nil {
+ return GalleryImageVersionsClientListByGalleryImageResponse{}, err
+ }
+ return client.listByGalleryImageHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByGalleryImageCreateRequest creates the ListByGalleryImage request.
+func (client *GalleryImageVersionsClient) listByGalleryImageCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImageVersionsClientListByGalleryImageOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByGalleryImageHandleResponse handles the ListByGalleryImage response.
+func (client *GalleryImageVersionsClient) listByGalleryImageHandleResponse(resp *http.Response) (GalleryImageVersionsClientListByGalleryImageResponse, error) {
+ result := GalleryImageVersionsClientListByGalleryImageResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GalleryImageVersionList); err != nil {
+ return GalleryImageVersionsClientListByGalleryImageResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - Update a gallery image version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery in which the Image Definition resides.
+// - galleryImageName - The name of the gallery image definition in which the Image Version is to be updated.
+// - galleryImageVersionName - The name of the gallery image version to be updated. Needs to follow semantic version name pattern:
+// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer.
+// Format: ..
+// - galleryImageVersion - Parameters supplied to the update gallery image version operation.
+// - options - GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate
+// method.
+func (client *GalleryImageVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*runtime.Poller[GalleryImageVersionsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryImageVersionsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryImageVersionsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update a gallery image version.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GalleryImageVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GalleryImageVersionsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *GalleryImageVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ if galleryImageVersionName == "" {
+ return nil, errors.New("parameter galleryImageVersionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, galleryImageVersion); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.go
new file mode 100644
index 000000000..e53a8f08a
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.go
@@ -0,0 +1,125 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// GallerySharingProfileClient contains the methods for the GallerySharingProfile group.
+// Don't use this type directly, use NewGallerySharingProfileClient() instead.
+type GallerySharingProfileClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewGallerySharingProfileClient creates a new instance of GallerySharingProfileClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewGallerySharingProfileClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GallerySharingProfileClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &GallerySharingProfileClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginUpdate - Update sharing profile of a gallery.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - resourceGroupName - The name of the resource group.
+// - galleryName - The name of the Shared Image Gallery.
+// - sharingUpdate - Parameters supplied to the update gallery sharing profile.
+// - options - GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate
+// method.
+func (client *GallerySharingProfileClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*runtime.Poller[GallerySharingProfileClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, galleryName, sharingUpdate, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GallerySharingProfileClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GallerySharingProfileClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update sharing profile of a gallery.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+func (client *GallerySharingProfileClient) update(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "GallerySharingProfileClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, sharingUpdate, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *GallerySharingProfileClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if galleryName == "" {
+ return nil, errors.New("parameter galleryName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, sharingUpdate); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.go
new file mode 100644
index 000000000..e97d6fa30
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.go
@@ -0,0 +1,462 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// ImagesClient contains the methods for the Images group.
+// Don't use this type directly, use NewImagesClient() instead.
+type ImagesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewImagesClient creates a new instance of ImagesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ImagesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &ImagesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Create or update an image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - imageName - The name of the image.
+// - parameters - Parameters supplied to the Create Image operation.
+// - options - ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate
+// method.
+func (client *ImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ImagesClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, imageName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ImagesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ImagesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Create or update an image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *ImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "ImagesClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, imageName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *ImagesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if imageName == "" {
+ return nil, errors.New("parameter imageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes an Image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - imageName - The name of the image.
+// - options - ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method.
+func (client *ImagesClient) BeginDelete(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*runtime.Poller[ImagesClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, imageName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ImagesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ImagesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes an Image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *ImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "ImagesClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, imageName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *ImagesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if imageName == "" {
+ return nil, errors.New("parameter imageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets an image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - imageName - The name of the image.
+// - options - ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method.
+func (client *ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientGetOptions) (ImagesClientGetResponse, error) {
+ var err error
+ const operationName = "ImagesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, imageName, options)
+ if err != nil {
+ return ImagesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ImagesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ImagesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *ImagesClient) getCreateRequest(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if imageName == "" {
+ return nil, errors.New("parameter imageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *ImagesClient) getHandleResponse(resp *http.Response) (ImagesClientGetResponse, error) {
+ result := ImagesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Image); err != nil {
+ return ImagesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets the list of Images in the subscription. Use nextLink property in the response to get the next page
+// of Images. Do this till nextLink is null to fetch all the Images.
+//
+// Generated from API version 2023-07-01
+// - options - ImagesClientListOptions contains the optional parameters for the ImagesClient.NewListPager method.
+func (client *ImagesClient) NewListPager(options *ImagesClientListOptions) *runtime.Pager[ImagesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ImagesClientListResponse]{
+ More: func(page ImagesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *ImagesClientListResponse) (ImagesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ImagesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return ImagesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *ImagesClient) listCreateRequest(ctx context.Context, options *ImagesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *ImagesClient) listHandleResponse(resp *http.Response) (ImagesClientListResponse, error) {
+ result := ImagesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImageListResult); err != nil {
+ return ImagesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Gets the list of images under a resource group. Use nextLink property in the response to
+// get the next page of Images. Do this till nextLink is null to fetch all the Images.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - options - ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.NewListByResourceGroupPager
+// method.
+func (client *ImagesClient) NewListByResourceGroupPager(resourceGroupName string, options *ImagesClientListByResourceGroupOptions) *runtime.Pager[ImagesClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ImagesClientListByResourceGroupResponse]{
+ More: func(page ImagesClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *ImagesClientListByResourceGroupResponse) (ImagesClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ImagesClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return ImagesClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *ImagesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ImagesClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *ImagesClient) listByResourceGroupHandleResponse(resp *http.Response) (ImagesClientListByResourceGroupResponse, error) {
+ result := ImagesClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImageListResult); err != nil {
+ return ImagesClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - Update an image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - imageName - The name of the image.
+// - parameters - Parameters supplied to the Update Image operation.
+// - options - ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method.
+func (client *ImagesClient) BeginUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*runtime.Poller[ImagesClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, imageName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ImagesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ImagesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update an image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *ImagesClient) update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "ImagesClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, imageName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *ImagesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if imageName == "" {
+ return nil, errors.New("parameter imageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{imageName}", url.PathEscape(imageName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.go
new file mode 100644
index 000000000..6dfabd2bf
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.go
@@ -0,0 +1,200 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// LogAnalyticsClient contains the methods for the LogAnalytics group.
+// Don't use this type directly, use NewLogAnalyticsClient() instead.
+type LogAnalyticsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewLogAnalyticsClient creates a new instance of LogAnalyticsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewLogAnalyticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LogAnalyticsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &LogAnalyticsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginExportRequestRateByInterval - Export logs that show Api requests made by this subscription in the given time window
+// to show throttling activities.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The location upon which virtual-machine-sizes is queried.
+// - parameters - Parameters supplied to the LogAnalytics getRequestRateByInterval Api.
+// - options - LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval
+// method.
+func (client *LogAnalyticsClient) BeginExportRequestRateByInterval(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*runtime.Poller[LogAnalyticsClientExportRequestRateByIntervalResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.exportRequestRateByInterval(ctx, location, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LogAnalyticsClientExportRequestRateByIntervalResponse]{
+ FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LogAnalyticsClientExportRequestRateByIntervalResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ExportRequestRateByInterval - Export logs that show Api requests made by this subscription in the given time window to
+// show throttling activities.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *LogAnalyticsClient) exportRequestRateByInterval(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*http.Response, error) {
+ var err error
+ const operationName = "LogAnalyticsClient.BeginExportRequestRateByInterval"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.exportRequestRateByIntervalCreateRequest(ctx, location, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// exportRequestRateByIntervalCreateRequest creates the ExportRequestRateByInterval request.
+func (client *LogAnalyticsClient) exportRequestRateByIntervalCreateRequest(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginExportThrottledRequests - Export logs that show total throttled Api requests for this subscription in the given time
+// window.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The location upon which virtual-machine-sizes is queried.
+// - parameters - Parameters supplied to the LogAnalytics getThrottledRequests Api.
+// - options - LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests
+// method.
+func (client *LogAnalyticsClient) BeginExportThrottledRequests(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*runtime.Poller[LogAnalyticsClientExportThrottledRequestsResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.exportThrottledRequests(ctx, location, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LogAnalyticsClientExportThrottledRequestsResponse]{
+ FinalStateVia: runtime.FinalStateViaAzureAsyncOp,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LogAnalyticsClientExportThrottledRequestsResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ExportThrottledRequests - Export logs that show total throttled Api requests for this subscription in the given time window.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *LogAnalyticsClient) exportThrottledRequests(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*http.Response, error) {
+ var err error
+ const operationName = "LogAnalyticsClient.BeginExportThrottledRequests"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.exportThrottledRequestsCreateRequest(ctx, location, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// exportThrottledRequestsCreateRequest creates the ExportThrottledRequests request.
+func (client *LogAnalyticsClient) exportThrottledRequestsCreateRequest(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.go
new file mode 100644
index 000000000..8275c7791
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.go
@@ -0,0 +1,8341 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import "time"
+
+// APIEntityReference - The API entity reference.
+type APIEntityReference struct {
+ // The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/…
+ ID *string
+}
+
+// APIError - Api error.
+type APIError struct {
+ // The error code.
+ Code *string
+
+ // The Api error details
+ Details []*APIErrorBase
+
+ // The Api inner error
+ Innererror *InnerError
+
+ // The error message.
+ Message *string
+
+ // The target of the particular error.
+ Target *string
+}
+
+// APIErrorBase - Api error base.
+type APIErrorBase struct {
+ // The error code.
+ Code *string
+
+ // The error message.
+ Message *string
+
+ // The target of the particular error.
+ Target *string
+}
+
+// AccessURI - A disk access SAS uri.
+type AccessURI struct {
+ // READ-ONLY; A SAS uri for accessing a disk.
+ AccessSAS *string
+
+ // READ-ONLY; A SAS uri for accessing a VM guest state.
+ SecurityDataAccessSAS *string
+}
+
+// AdditionalCapabilities - Enables or disables a capability on the virtual machine or virtual machine scale set.
+type AdditionalCapabilities struct {
+ // The flag that enables or disables hibernation capability on the VM.
+ HibernationEnabled *bool
+
+ // The flag that enables or disables a capability to have one or more managed data disks with UltraSSDLRS storage account
+ // type on the VM or VMSS. Managed disks with storage account type UltraSSDLRS can
+ // be added to a virtual machine or virtual machine scale set only if this property is enabled.
+ UltraSSDEnabled *bool
+}
+
+// AdditionalUnattendContent - Specifies additional XML formatted information that can be included in the Unattend.xml file,
+// which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in
+// which the content is applied.
+type AdditionalUnattendContent struct {
+ // The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup.
+ ComponentName *string
+
+ // Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML
+ // must be less than 4KB and must include the root element for the setting or
+ // feature that is being inserted.
+ Content *string
+
+ // The pass name. Currently, the only allowable value is OobeSystem.
+ PassName *string
+
+ // Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon.
+ SettingName *SettingNames
+}
+
+// AlternativeOption - Describes the alternative option specified by the Publisher for this image when this image is deprecated.
+type AlternativeOption struct {
+ // Describes the type of the alternative option.
+ Type *AlternativeType
+
+ // Indicates the alternative option value specified by the Publisher. This is the Offer name when the type is Offer or the
+ // Plan name when the type is Plan.
+ Value *string
+}
+
+// ApplicationProfile - Contains the list of gallery applications that should be made available to the VM/VMSS
+type ApplicationProfile struct {
+ // Specifies the gallery applications that should be made available to the VM/VMSS
+ GalleryApplications []*VMGalleryApplication
+}
+
+// AutomaticOSUpgradePolicy - The configuration parameters used for performing automatic OS upgrade.
+type AutomaticOSUpgradePolicy struct {
+ // Whether OS image rollback feature should be disabled. Default value is false.
+ DisableAutomaticRollback *bool
+
+ // Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer
+ // version of the OS image becomes available. Default value is false. If this is set
+ // to true for Windows based scale sets, enableAutomaticUpdates
+ // [https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet]
+ // is automatically set to false and cannot be set to true.
+ EnableAutomaticOSUpgrade *bool
+
+ // Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Default value is false. Auto OS Upgrade
+ // will fallback to the default policy if no policy is defined on the VMSS.
+ UseRollingUpgradePolicy *bool
+}
+
+// AutomaticOSUpgradeProperties - Describes automatic OS upgrade properties on the image.
+type AutomaticOSUpgradeProperties struct {
+ // REQUIRED; Specifies whether automatic OS upgrade is supported on the image.
+ AutomaticOSUpgradeSupported *bool
+}
+
+// AutomaticRepairsPolicy - Specifies the configuration parameters for automatic repairs on the virtual machine scale set.
+type AutomaticRepairsPolicy struct {
+ // Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false.
+ Enabled *bool
+
+ // The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the
+ // state change has completed. This helps avoid premature or accidental repairs.
+ // The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 10 minutes (PT10M), which
+ // is also the default value. The maximum allowed grace period is 90 minutes
+ // (PT90M).
+ GracePeriod *string
+
+ // Type of repair action (replace, restart, reimage) that will be used for repairing unhealthy virtual machines in the scale
+ // set. Default value is replace.
+ RepairAction *RepairAction
+}
+
+// AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual
+// machines specified in the same availability set are allocated to different nodes to maximize
+// availability. For more information about availability sets, see Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview].
+// For more information on Azure
+// planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates].
+// Currently, a VM can only be added to an
+// availability set at creation time. An existing VM cannot be added to an availability set.
+type AvailabilitySet struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // The instance view of a resource.
+ Properties *AvailabilitySetProperties
+
+ // Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use
+ // 'Aligned' for virtual machines with managed disks and 'Classic' for virtual
+ // machines with unmanaged disks. Default value is 'Classic'.
+ SKU *SKU
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// AvailabilitySetListResult - The List Availability Set operation response.
+type AvailabilitySetListResult struct {
+ // REQUIRED; The list of availability sets
+ Value []*AvailabilitySet
+
+ // The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets.
+ NextLink *string
+}
+
+// AvailabilitySetProperties - The instance view of a resource.
+type AvailabilitySetProperties struct {
+ // Fault Domain count.
+ PlatformFaultDomainCount *int32
+
+ // Update Domain count.
+ PlatformUpdateDomainCount *int32
+
+ // Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version:
+ // 2018-04-01.
+ ProximityPlacementGroup *SubResource
+
+ // A list of references to all virtual machines in the availability set.
+ VirtualMachines []*SubResource
+
+ // READ-ONLY; The resource status information.
+ Statuses []*InstanceViewStatus
+}
+
+// AvailabilitySetUpdate - Specifies information about the availability set that the virtual machine should be assigned to.
+// Only tags may be updated.
+type AvailabilitySetUpdate struct {
+ // The instance view of a resource.
+ Properties *AvailabilitySetProperties
+
+ // Sku of the availability set
+ SKU *SKU
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// AvailablePatchSummary - Describes the properties of an virtual machine instance view for available patch summary.
+type AvailablePatchSummary struct {
+ // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension
+ // logs.
+ AssessmentActivityID *string
+
+ // READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed.
+ CriticalAndSecurityPatchCount *int32
+
+ // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them.
+ Error *APIError
+
+ // READ-ONLY; The UTC timestamp when the operation began.
+ LastModifiedTime *time.Time
+
+ // READ-ONLY; The number of all available patches excluding critical and security.
+ OtherPatchCount *int32
+
+ // READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete
+ // installation but the reboot has not yet occurred.
+ RebootPending *bool
+
+ // READ-ONLY; The UTC timestamp when the operation began.
+ StartTime *time.Time
+
+ // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes.
+ // At that point it will become "Unknown", "Failed", "Succeeded", or
+ // "CompletedWithWarnings."
+ Status *PatchOperationStatus
+}
+
+// BillingProfile - Specifies the billing related details of a Azure Spot VM or VMSS. Minimum api-version: 2019-03-01.
+type BillingProfile struct {
+ // Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars.
+ // This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time
+ // of create/update of Azure Spot VM/VMSS and the operation will only succeed if
+ // the maxPrice is greater than the current Azure Spot price.
+ // The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice
+ // after creation of VM/VMSS.
+ // Possible values are:
+ // - Any decimal value greater than zero. Example: 0.01538
+ // -1 – indicates default price to be up-to on-demand.
+ // You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the
+ // default max price is -1 if it is not provided by you.
+ // Minimum api-version: 2019-03-01.
+ MaxPrice *float64
+}
+
+// BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose
+// VM status. You can easily view the output of your console log. Azure also enables you to see
+// a screenshot of the VM from the hypervisor.
+type BootDiagnostics struct {
+ // Whether boot diagnostics should be enabled on the Virtual Machine.
+ Enabled *bool
+
+ // Uri of the storage account to use for placing the console output and screenshot. If storageUri is not specified while enabling
+ // boot diagnostics, managed storage will be used.
+ StorageURI *string
+}
+
+// BootDiagnosticsInstanceView - The instance view of a virtual machine boot diagnostics.
+type BootDiagnosticsInstanceView struct {
+ // READ-ONLY; The console screenshot blob URI. Note: This will not be set if boot diagnostics is currently enabled with managed
+ // storage.
+ ConsoleScreenshotBlobURI *string
+
+ // READ-ONLY; The serial console log blob Uri. Note: This will not be set if boot diagnostics is currently enabled with managed
+ // storage.
+ SerialConsoleLogBlobURI *string
+
+ // READ-ONLY; The boot diagnostics status information for the VM. Note: It will be set only if there are errors encountered
+ // in enabling boot diagnostics.
+ Status *InstanceViewStatus
+}
+
+// CapacityReservation - Specifies information about the capacity reservation.
+type CapacityReservation struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // REQUIRED; SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently
+ // VM Skus with the capability called 'CapacityReservationSupported' set to true are
+ // supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list)
+ // for supported values.
+ SKU *SKU
+
+ // Properties of the Capacity reservation.
+ Properties *CapacityReservationProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the
+ // list of zones specified during the capacity reservation group creation. The zone
+ // can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided,
+ // enforces VM/VMSS using this capacity reservation to be in same zone.
+ Zones []*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// CapacityReservationGroup - Specifies information about the capacity reservation group that the capacity reservations should
+// be assigned to. Currently, a capacity reservation can only be added to a capacity reservation group at
+// creation time. An existing capacity reservation cannot be added or moved to another capacity reservation group.
+type CapacityReservationGroup struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // capacity reservation group Properties.
+ Properties *CapacityReservationGroupProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided,
+ // the group supports only regional resources in the region. If provided,
+ // enforces each capacity reservation in the group to be in one of the zones.
+ Zones []*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+type CapacityReservationGroupInstanceView struct {
+ // READ-ONLY; List of instance view of the capacity reservations under the capacity reservation group.
+ CapacityReservations []*CapacityReservationInstanceViewWithName
+}
+
+// CapacityReservationGroupListResult - The List capacity reservation group with resource group response.
+type CapacityReservationGroupListResult struct {
+ // REQUIRED; The list of capacity reservation groups
+ Value []*CapacityReservationGroup
+
+ // The URI to fetch the next page of capacity reservation groups. Call ListNext() with this URI to fetch the next page of
+ // capacity reservation groups.
+ NextLink *string
+}
+
+// CapacityReservationGroupProperties - capacity reservation group Properties.
+type CapacityReservationGroupProperties struct {
+ // READ-ONLY; A list of all capacity reservation resource ids that belong to capacity reservation group.
+ CapacityReservations []*SubResourceReadOnly
+
+ // READ-ONLY; The capacity reservation group instance view which has the list of instance views for all the capacity reservations
+ // that belong to the capacity reservation group.
+ InstanceView *CapacityReservationGroupInstanceView
+
+ // READ-ONLY; A list of references to all virtual machines associated to the capacity reservation group.
+ VirtualMachinesAssociated []*SubResourceReadOnly
+}
+
+// CapacityReservationGroupUpdate - Specifies information about the capacity reservation group. Only tags can be updated.
+type CapacityReservationGroupUpdate struct {
+ // capacity reservation group Properties.
+ Properties *CapacityReservationGroupProperties
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// CapacityReservationInstanceView - The instance view of a capacity reservation that provides as snapshot of the runtime
+// properties of the capacity reservation that is managed by the platform and can change outside of control plane
+// operations.
+type CapacityReservationInstanceView struct {
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+
+ // Unutilized capacity of the capacity reservation.
+ UtilizationInfo *CapacityReservationUtilization
+}
+
+// CapacityReservationInstanceViewWithName - The instance view of a capacity reservation that includes the name of the capacity
+// reservation. It is used for the response to the instance view of a capacity reservation group.
+type CapacityReservationInstanceViewWithName struct {
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+
+ // Unutilized capacity of the capacity reservation.
+ UtilizationInfo *CapacityReservationUtilization
+
+ // READ-ONLY; The name of the capacity reservation.
+ Name *string
+}
+
+// CapacityReservationListResult - The list capacity reservation operation response.
+type CapacityReservationListResult struct {
+ // REQUIRED; The list of capacity reservations
+ Value []*CapacityReservation
+
+ // The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity
+ // reservations.
+ NextLink *string
+}
+
+// CapacityReservationProfile - The parameters of a capacity reservation Profile.
+type CapacityReservationProfile struct {
+ // Specifies the capacity reservation group resource id that should be used for allocating the virtual machine or scaleset
+ // vm instances provided enough capacity has been reserved. Please refer to
+ // https://aka.ms/CapacityReservation for more details.
+ CapacityReservationGroup *SubResource
+}
+
+// CapacityReservationProperties - Properties of the Capacity reservation.
+type CapacityReservationProperties struct {
+ // READ-ONLY; The Capacity reservation instance view.
+ InstanceView *CapacityReservationInstanceView
+
+ // READ-ONLY; Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The
+ // fault domain count specified for a resource (like virtual machines scale set) must be less
+ // than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.
+ PlatformFaultDomainCount *int32
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *string
+
+ // READ-ONLY; The date time when the capacity reservation was last updated.
+ ProvisioningTime *time.Time
+
+ // READ-ONLY; A unique id generated and assigned to the capacity reservation by the platform which does not change throughout
+ // the lifetime of the resource.
+ ReservationID *string
+
+ // READ-ONLY; Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.
+ TimeCreated *time.Time
+
+ // READ-ONLY; A list of all virtual machine resource ids that are associated with the capacity reservation.
+ VirtualMachinesAssociated []*SubResourceReadOnly
+}
+
+// CapacityReservationUpdate - Specifies information about the capacity reservation. Only tags and sku.capacity can be updated.
+type CapacityReservationUpdate struct {
+ // Properties of the Capacity reservation.
+ Properties *CapacityReservationProperties
+
+ // SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM
+ // Skus with the capability called 'CapacityReservationSupported' set to true are
+ // supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list)
+ // for supported values.
+ SKU *SKU
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// CapacityReservationUtilization - Represents the capacity reservation utilization in terms of resources allocated.
+type CapacityReservationUtilization struct {
+ // READ-ONLY; The value provides the current capacity of the VM size which was reserved successfully and for which the customer
+ // is getting billed. Minimum api-version: 2022-08-01.
+ CurrentCapacity *int32
+
+ // READ-ONLY; A list of all virtual machines resource ids allocated against the capacity reservation.
+ VirtualMachinesAllocated []*SubResourceReadOnly
+}
+
+// CloudService - Describes the cloud service.
+type CloudService struct {
+ // REQUIRED; Resource location.
+ Location *string
+
+ // Cloud service properties
+ Properties *CloudServiceProperties
+
+ // The system meta data relating to this resource.
+ SystemData *SystemData
+
+ // Resource tags.
+ Tags map[string]*string
+
+ // List of logical availability zone of the resource. List should contain only 1 zone where cloud service should be provisioned.
+ // This field is optional.
+ Zones []*string
+
+ // READ-ONLY; Resource Id.
+ ID *string
+
+ // READ-ONLY; Resource name.
+ Name *string
+
+ // READ-ONLY; Resource type.
+ Type *string
+}
+
+// CloudServiceExtensionProfile - Describes a cloud service extension profile.
+type CloudServiceExtensionProfile struct {
+ // List of extensions for the cloud service.
+ Extensions []*Extension
+}
+
+// CloudServiceExtensionProperties - Extension Properties.
+type CloudServiceExtensionProperties struct {
+ // Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become
+ // available.
+ AutoUpgradeMinorVersion *bool
+
+ // Tag to force apply the provided public and protected settings. Changing the tag value allows for re-running the extension
+ // without changing any of the public or protected settings. If forceUpdateTag is
+ // not changed, updates to public or protected settings would still be applied by the handler. If neither forceUpdateTag nor
+ // any of public or protected settings change, extension would flow to the role
+ // instance with the same sequence-number, and it is up to handler implementation whether to re-run it or not
+ ForceUpdateTag *string
+
+ // Protected settings for the extension which are encrypted before sent to the role instance.
+ ProtectedSettings any
+
+ // Protected settings for the extension, referenced using KeyVault which are encrypted before sent to the role instance.
+ ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference
+
+ // The name of the extension handler publisher.
+ Publisher *string
+
+ // Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied
+ // to all roles in the cloud service.
+ RolesAppliedTo []*string
+
+ // Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension
+ // (like RDP), this is the XML setting for the extension.
+ Settings any
+
+ // Specifies the type of the extension.
+ Type *string
+
+ // Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an
+ // asterisk (*) is used as the value, the latest version of the extension is used.
+ // If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor
+ // version of the specified major version is selected. If a major version number
+ // and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified,
+ // an auto-upgrade is performed on the role instance.
+ TypeHandlerVersion *string
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *string
+}
+
+// CloudServiceInstanceView - InstanceView of CloudService as a whole
+type CloudServiceInstanceView struct {
+ // Instance view statuses.
+ RoleInstance *InstanceViewStatusesSummary
+
+ // READ-ONLY; Specifies a list of unique identifiers generated internally for the cloud service.
+ // NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details.
+ PrivateIDs []*string
+
+ // READ-ONLY; The version of the SDK that was used to generate the package for the cloud service.
+ SdkVersion *string
+
+ // READ-ONLY
+ Statuses []*ResourceInstanceViewStatus
+}
+
+// CloudServiceListResult - The list operation result.
+type CloudServiceListResult struct {
+ // REQUIRED; The list of resources.
+ Value []*CloudService
+
+ // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null
+ // to fetch all the resources.
+ NextLink *string
+}
+
+// CloudServiceNetworkProfile - Network Profile for the cloud service.
+type CloudServiceNetworkProfile struct {
+ // List of Load balancer configurations. Cloud service can have up to two load balancer configurations, corresponding to a
+ // Public Load Balancer and an Internal Load Balancer.
+ LoadBalancerConfigurations []*LoadBalancerConfiguration
+
+ // Slot type for the cloud service. Possible values are
+ // Production
+ // Staging
+ // If not specified, the default value is Production.
+ SlotType *CloudServiceSlotType
+
+ // The id reference of the cloud service containing the target IP with which the subject cloud service can perform a swap.
+ // This property cannot be updated once it is set. The swappable cloud service
+ // referred by this id must be present otherwise an error will be thrown.
+ SwappableCloudService *SubResource
+}
+
+// CloudServiceOsProfile - Describes the OS profile for the cloud service.
+type CloudServiceOsProfile struct {
+ // Specifies set of certificates that should be installed onto the role instances.
+ Secrets []*CloudServiceVaultSecretGroup
+}
+
+// CloudServiceProperties - Cloud service properties
+type CloudServiceProperties struct {
+ // (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) specified in the model/template should override
+ // the role instance count and vm size specified in the .cscfg and .csdef
+ // respectively. The default value is false.
+ AllowModelOverride *bool
+
+ // Specifies the XML service configuration (.cscfg) for the cloud service.
+ Configuration *string
+
+ // Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can
+ // be Shared Access Signature (SAS) URI from any storage account. This is a
+ // write-only property and is not returned in GET calls.
+ ConfigurationURL *string
+
+ // Describes a cloud service extension profile.
+ ExtensionProfile *CloudServiceExtensionProfile
+
+ // Network Profile for the cloud service.
+ NetworkProfile *CloudServiceNetworkProfile
+
+ // Describes the OS profile for the cloud service.
+ OSProfile *CloudServiceOsProfile
+
+ // Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be
+ // Shared Access Signature (SAS) URI from any storage account. This is a write-only
+ // property and is not returned in GET calls.
+ PackageURL *string
+
+ // Describes the role profile for the cloud service.
+ RoleProfile *CloudServiceRoleProfile
+
+ // (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is true. If
+ // false, the service model is still deployed, but the code is not run immediately.
+ // Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service
+ // still incurs charges, even if it is poweredoff.
+ StartCloudService *bool
+
+ // Update mode for the cloud service. Role instances are allocated to update domains when the service is deployed. Updates
+ // can be initiated manually in each update domain or initiated automatically in
+ // all update domains. Possible Values are
+ // Auto
+ // Manual
+ // Simultaneous
+ // If not specified, the default value is Auto. If set to Manual, PUT UpdateDomain must be called to apply the update. If
+ // set to Auto, the update is automatically applied to each update domain in
+ // sequence.
+ UpgradeMode *CloudServiceUpgradeMode
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *string
+
+ // READ-ONLY; The unique identifier for the cloud service.
+ UniqueID *string
+}
+
+// CloudServiceRole - Describes a role of the cloud service.
+type CloudServiceRole struct {
+ // The cloud service role properties.
+ Properties *CloudServiceRoleProperties
+
+ // Describes the cloud service role sku.
+ SKU *CloudServiceRoleSKU
+
+ // READ-ONLY; Resource id
+ ID *string
+
+ // READ-ONLY; Resource location
+ Location *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// CloudServiceRoleListResult - The list operation result.
+type CloudServiceRoleListResult struct {
+ // REQUIRED; The list of resources.
+ Value []*CloudServiceRole
+
+ // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null
+ // to fetch all the resources.
+ NextLink *string
+}
+
+// CloudServiceRoleProfile - Describes the role profile for the cloud service.
+type CloudServiceRoleProfile struct {
+ // List of roles for the cloud service.
+ Roles []*CloudServiceRoleProfileProperties
+}
+
+// CloudServiceRoleProfileProperties - Describes the role properties.
+type CloudServiceRoleProfileProperties struct {
+ // Resource name.
+ Name *string
+
+ // Describes the cloud service role sku.
+ SKU *CloudServiceRoleSKU
+}
+
+// CloudServiceRoleProperties - The cloud service role properties.
+type CloudServiceRoleProperties struct {
+ // READ-ONLY; Specifies the ID which uniquely identifies a cloud service role.
+ UniqueID *string
+}
+
+// CloudServiceRoleSKU - Describes the cloud service role sku.
+type CloudServiceRoleSKU struct {
+ // Specifies the number of role instances in the cloud service.
+ Capacity *int64
+
+ // The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete
+ // and recreate the cloud service or move back to the old sku.
+ Name *string
+
+ // Specifies the tier of the cloud service. Possible Values are
+ // Standard
+ // Basic
+ Tier *string
+}
+
+type CloudServiceUpdate struct {
+ // Resource tags
+ Tags map[string]*string
+}
+
+// CloudServiceVaultAndSecretReference - Protected settings for the extension, referenced using KeyVault which are encrypted
+// before sent to the role instance.
+type CloudServiceVaultAndSecretReference struct {
+ // Secret URL which contains the protected settings of the extension
+ SecretURL *string
+
+ // The ARM Resource ID of the Key Vault
+ SourceVault *SubResource
+}
+
+// CloudServiceVaultCertificate - Describes a single certificate reference in a Key Vault, and where the certificate should
+// reside on the role instance.
+type CloudServiceVaultCertificate struct {
+ // This is the URL of a certificate that has been uploaded to Key Vault as a secret.
+ CertificateURL *string
+}
+
+// CloudServiceVaultSecretGroup - Describes a set of certificates which are all in the same Key Vault.
+type CloudServiceVaultSecretGroup struct {
+ // The relative URL of the Key Vault containing all of the certificates in VaultCertificates.
+ SourceVault *SubResource
+
+ // The list of key vault references in SourceVault which contain certificates.
+ VaultCertificates []*CloudServiceVaultCertificate
+}
+
+// CommunityGallery - Specifies information about the Community Gallery that you want to create or update.
+type CommunityGallery struct {
+ // The identifier information of community gallery.
+ Identifier *CommunityGalleryIdentifier
+
+ // READ-ONLY; Resource location
+ Location *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// CommunityGalleryIdentifier - The identifier information of community gallery.
+type CommunityGalleryIdentifier struct {
+ // The unique id of this community gallery.
+ UniqueID *string
+}
+
+// CommunityGalleryImage - Specifies information about the gallery image definition that you want to create or update.
+type CommunityGalleryImage struct {
+ // The identifier information of community gallery.
+ Identifier *CommunityGalleryIdentifier
+
+ // Describes the properties of a gallery image definition.
+ Properties *CommunityGalleryImageProperties
+
+ // READ-ONLY; Resource location
+ Location *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// CommunityGalleryImageIdentifier - This is the community gallery image definition identifier.
+type CommunityGalleryImageIdentifier struct {
+ // The name of the gallery image definition offer.
+ Offer *string
+
+ // The name of the gallery image definition publisher.
+ Publisher *string
+
+ // The name of the gallery image definition SKU.
+ SKU *string
+}
+
+// CommunityGalleryImageList - The List Community Gallery Images operation response.
+type CommunityGalleryImageList struct {
+ // REQUIRED; A list of community gallery images.
+ Value []*CommunityGalleryImage
+
+ // The uri to fetch the next page of community gallery images. Call ListNext() with this to fetch the next page of community
+ // gallery images.
+ NextLink *string
+}
+
+// CommunityGalleryImageProperties - Describes the properties of a gallery image definition.
+type CommunityGalleryImageProperties struct {
+ // REQUIRED; This is the community gallery image definition identifier.
+ Identifier *CommunityGalleryImageIdentifier
+
+ // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized'
+ // or 'Specialized'.
+ OSState *OperatingSystemStateTypes
+
+ // REQUIRED; This property allows you to specify the type of the OS that is included in the disk when creating a VM from a
+ // managed image.
+ // Possible values are:
+ // Windows
+ // Linux
+ OSType *OperatingSystemTypes
+
+ // The architecture of the image. Applicable to OS disks only.
+ Architecture *Architecture
+
+ // Describes the disallowed disk types.
+ Disallowed *Disallowed
+
+ // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property
+ // is updatable.
+ EndOfLifeDate *time.Time
+
+ // End-user license agreement for the current community gallery image.
+ Eula *string
+
+ // A list of gallery image features.
+ Features []*GalleryImageFeature
+
+ // The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
+ HyperVGeneration *HyperVGeneration
+
+ // Privacy statement uri for the current community gallery image.
+ PrivacyStatementURI *string
+
+ // Describes the gallery image definition purchase plan. This is used by marketplace images.
+ PurchasePlan *ImagePurchasePlan
+
+ // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable.
+ Recommended *RecommendedMachineConfiguration
+}
+
+// CommunityGalleryImageVersion - Specifies information about the gallery image version that you want to create or update.
+type CommunityGalleryImageVersion struct {
+ // The identifier information of community gallery.
+ Identifier *CommunityGalleryIdentifier
+
+ // Describes the properties of a gallery image version.
+ Properties *CommunityGalleryImageVersionProperties
+
+ // READ-ONLY; Resource location
+ Location *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// CommunityGalleryImageVersionList - The List Community Gallery Image versions operation response.
+type CommunityGalleryImageVersionList struct {
+ // REQUIRED; A list of community gallery image versions.
+ Value []*CommunityGalleryImageVersion
+
+ // The uri to fetch the next page of community gallery image versions. Call ListNext() with this to fetch the next page of
+ // community gallery image versions.
+ NextLink *string
+}
+
+// CommunityGalleryImageVersionProperties - Describes the properties of a gallery image version.
+type CommunityGalleryImageVersionProperties struct {
+ // The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This
+ // property is updatable.
+ EndOfLifeDate *time.Time
+
+ // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version.
+ ExcludeFromLatest *bool
+
+ // The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This
+ // property is updatable.
+ PublishedDate *time.Time
+
+ // Describes the storage profile of the image version.
+ StorageProfile *SharedGalleryImageVersionStorageProfile
+}
+
+// CommunityGalleryInfo - Information of community gallery if current gallery is shared to community
+type CommunityGalleryInfo struct {
+ // End-user license agreement for community gallery image.
+ Eula *string
+
+ // The prefix of the gallery name that will be displayed publicly. Visible to all users.
+ PublicNamePrefix *string
+
+ // Community gallery publisher support email. The email address of the publisher. Visible to all users.
+ PublisherContact *string
+
+ // The link to the publisher website. Visible to all users.
+ PublisherURI *string
+
+ // READ-ONLY; Contains info about whether community gallery sharing is enabled.
+ CommunityGalleryEnabled *bool
+
+ // READ-ONLY; Community gallery public name list.
+ PublicNames []*string
+}
+
+// CopyCompletionError - Indicates the error details if the background copy of a resource created via the CopyStart operation
+// fails.
+type CopyCompletionError struct {
+ // REQUIRED; Indicates the error code if the background copy of a resource created via the CopyStart operation fails.
+ ErrorCode *CopyCompletionErrorReason
+
+ // REQUIRED; Indicates the error message if the background copy of a resource created via the CopyStart operation fails.
+ ErrorMessage *string
+}
+
+// CreationData - Data used when creating a disk.
+type CreationData struct {
+ // REQUIRED; This enumerates the possible sources of a disk's creation.
+ CreateOption *DiskCreateOption
+
+ // Required if createOption is CopyFromSanSnapshot. This is the ARM id of the source elastic san volume snapshot.
+ ElasticSanResourceID *string
+
+ // Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference
+ // will be the ARM id of the shared galley image version from which to create a
+ // disk.
+ GalleryImageReference *ImageDiskReference
+
+ // Disk source information for PIR or user images.
+ ImageReference *ImageDiskReference
+
+ // Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default.
+ LogicalSectorSize *int32
+
+ // Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance
+ // target. This flag can only be set on disk creation time and cannot be
+ // disabled after enabled.
+ PerformancePlus *bool
+
+ // If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state.
+ SecurityDataURI *string
+
+ // If createOption is Copy, this is the ARM id of the source snapshot or disk.
+ SourceResourceID *string
+
+ // If createOption is Import, this is the URI of a blob to be imported into a managed disk.
+ SourceURI *string
+
+ // Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to
+ // import as a disk.
+ StorageAccountID *string
+
+ // If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be
+ // between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520
+ // bytes (32 TiB + 512 bytes for the VHD footer).
+ UploadSizeBytes *int64
+
+ // READ-ONLY; If this field is set, this is the unique id identifying the source of this resource.
+ SourceUniqueID *string
+}
+
+// DataDisk - Describes a data disk.
+type DataDisk struct {
+ // REQUIRED; Specifies how the virtual machine should be created. Possible values are: Attach. This value is used when you
+ // are using a specialized disk to create the virtual machine. FromImage. This value is used
+ // when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference
+ // element described above. If you are using a marketplace image, you
+ // should also use the plan element previously described.
+ CreateOption *DiskCreateOptionTypes
+
+ // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and
+ // therefore must be unique for each data disk attached to a VM.
+ Lun *int32
+
+ // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for
+ // Standard storage. ReadOnly for Premium storage.
+ Caching *CachingTypes
+
+ // Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: Delete. If this value
+ // is used, the data disk is deleted when VM is deleted. Detach. If this value is
+ // used, the data disk is retained after VM is deleted. The default value is set to Detach.
+ DeleteOption *DiskDeleteOptionTypes
+
+ // Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the
+ // virtual machine. Supported values: ForceDetach. detachOption: ForceDetach is
+ // applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected
+ // failure from the virtual machine and the disk is still not released then
+ // use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed
+ // when using this detach behavior. This feature is still in preview mode and is
+ // not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting
+ // detachOption: 'ForceDetach'.
+ DetachOption *DiskDetachOptionTypes
+
+ // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a
+ // virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3
+ // for the disk and the value cannot be larger than 1023.
+ DiskSizeGB *int32
+
+ // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine.
+ // If SourceImage is provided, the destination virtual hard drive must not
+ // exist.
+ Image *VirtualHardDisk
+
+ // The managed disk parameters.
+ ManagedDisk *ManagedDiskParameters
+
+ // The disk name.
+ Name *string
+
+ // Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset
+ ToBeDetached *bool
+
+ // The virtual hard disk.
+ Vhd *VirtualHardDisk
+
+ // Specifies whether writeAccelerator should be enabled or disabled on the disk.
+ WriteAcceleratorEnabled *bool
+
+ // READ-ONLY; Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for
+ // VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine
+ // Scale Set.
+ DiskIOPSReadWrite *int64
+
+ // READ-ONLY; Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned
+ // only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the
+ // VirtualMachine Scale Set.
+ DiskMBpsReadWrite *int64
+}
+
+// DataDiskImage - Contains the data disk images information.
+type DataDiskImage struct {
+ // READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM
+ // and therefore must be unique for each data disk attached to a VM.
+ Lun *int32
+}
+
+// DataDiskImageEncryption - Contains encryption settings for a data disk image.
+type DataDiskImageEncryption struct {
+ // REQUIRED; This property specifies the logical unit number of the data disk. This value is used to identify data disks within
+ // the Virtual Machine and therefore must be unique for each data disk attached to the
+ // Virtual Machine.
+ Lun *int32
+
+ // A relative URI containing the resource ID of the disk encryption set.
+ DiskEncryptionSetID *string
+}
+
+// DedicatedHost - Specifies information about the Dedicated host.
+type DedicatedHost struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // REQUIRED; SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute
+ // SKUs for a list of possible values.
+ SKU *SKU
+
+ // Properties of the dedicated host.
+ Properties *DedicatedHostProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// DedicatedHostAllocatableVM - Represents the dedicated host unutilized capacity in terms of a specific VM size.
+type DedicatedHostAllocatableVM struct {
+ // Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity.
+ Count *float64
+
+ // VM size in terms of which the unutilized capacity is represented.
+ VMSize *string
+}
+
+// DedicatedHostAvailableCapacity - Dedicated host unutilized capacity.
+type DedicatedHostAvailableCapacity struct {
+ // The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the
+ // dedicated host.
+ AllocatableVMs []*DedicatedHostAllocatableVM
+}
+
+// DedicatedHostGroup - Specifies information about the dedicated host group that the dedicated hosts should be assigned to.
+// Currently, a dedicated host can only be added to a dedicated host group at creation time. An
+// existing dedicated host cannot be added to another dedicated host group.
+type DedicatedHostGroup struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // Dedicated Host Group Properties.
+ Properties *DedicatedHostGroupProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation.
+ // If not provided, the group supports all zones in the region. If provided,
+ // enforces each host in the group to be in the same zone.
+ Zones []*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+type DedicatedHostGroupInstanceView struct {
+ // List of instance view of the dedicated hosts under the dedicated host group.
+ Hosts []*DedicatedHostInstanceViewWithName
+}
+
+// DedicatedHostGroupListResult - The List Dedicated Host Group with resource group response.
+type DedicatedHostGroupListResult struct {
+ // REQUIRED; The list of dedicated host groups
+ Value []*DedicatedHostGroup
+
+ // The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated
+ // Host Groups.
+ NextLink *string
+}
+
+// DedicatedHostGroupProperties - Dedicated Host Group Properties.
+type DedicatedHostGroupProperties struct {
+ // REQUIRED; Number of fault domains that the host group can span.
+ PlatformFaultDomainCount *int32
+
+ // Enables or disables a capability on the dedicated host group. Minimum api-version: 2022-03-01.
+ AdditionalCapabilities *DedicatedHostGroupPropertiesAdditionalCapabilities
+
+ // Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group.
+ // Automatic placement means resources are allocated on dedicated hosts, that are
+ // chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided. Minimum api-version:
+ // 2020-06-01.
+ SupportAutomaticPlacement *bool
+
+ // READ-ONLY; A list of references to all dedicated hosts in the dedicated host group.
+ Hosts []*SubResourceReadOnly
+
+ // READ-ONLY; The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the
+ // dedicated host group.
+ InstanceView *DedicatedHostGroupInstanceView
+}
+
+// DedicatedHostGroupPropertiesAdditionalCapabilities - Enables or disables a capability on the dedicated host group. Minimum
+// api-version: 2022-03-01.
+type DedicatedHostGroupPropertiesAdditionalCapabilities struct {
+ // The flag that enables or disables a capability to have UltraSSD Enabled Virtual Machines on Dedicated Hosts of the Dedicated
+ // Host Group. For the Virtual Machines to be UltraSSD Enabled,
+ // UltraSSDEnabled flag for the resource needs to be set true as well. The value is defaulted to 'false' when not provided.
+ // Please refer to
+ // https://docs.microsoft.com/en-us/azure/virtual-machines/disks-enable-ultra-ssd for more details on Ultra SSD feature. Note:
+ // The ultraSSDEnabled setting can only be enabled for Host Groups that are
+ // created as zonal. Minimum api-version: 2022-03-01.
+ UltraSSDEnabled *bool
+}
+
+// DedicatedHostGroupUpdate - Specifies information about the dedicated host group that the dedicated host should be assigned
+// to. Only tags may be updated.
+type DedicatedHostGroupUpdate struct {
+ // Dedicated Host Group Properties.
+ Properties *DedicatedHostGroupProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation.
+ // If not provided, the group supports all zones in the region. If provided,
+ // enforces each host in the group to be in the same zone.
+ Zones []*string
+}
+
+// DedicatedHostInstanceView - The instance view of a dedicated host.
+type DedicatedHostInstanceView struct {
+ // Unutilized capacity of the dedicated host.
+ AvailableCapacity *DedicatedHostAvailableCapacity
+
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+
+ // READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides.
+ AssetID *string
+}
+
+// DedicatedHostInstanceViewWithName - The instance view of a dedicated host that includes the name of the dedicated host.
+// It is used for the response to the instance view of a dedicated host group.
+type DedicatedHostInstanceViewWithName struct {
+ // Unutilized capacity of the dedicated host.
+ AvailableCapacity *DedicatedHostAvailableCapacity
+
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+
+ // READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides.
+ AssetID *string
+
+ // READ-ONLY; The name of the dedicated host.
+ Name *string
+}
+
+// DedicatedHostListResult - The list dedicated host operation response.
+type DedicatedHostListResult struct {
+ // REQUIRED; The list of dedicated hosts
+ Value []*DedicatedHost
+
+ // The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts.
+ NextLink *string
+}
+
+// DedicatedHostProperties - Properties of the dedicated host.
+type DedicatedHostProperties struct {
+ // Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true'
+ // when not provided.
+ AutoReplaceOnFailure *bool
+
+ // Specifies the software license type that will be applied to the VMs deployed on the dedicated host. Possible values are:
+ // None, WindowsServerHybrid, WindowsServerPerpetual. The default value is: None.
+ LicenseType *DedicatedHostLicenseTypes
+
+ // Fault domain of the dedicated host within a dedicated host group.
+ PlatformFaultDomain *int32
+
+ // READ-ONLY; A unique id generated and assigned to the dedicated host by the platform. Does not change throughout the lifetime
+ // of the host.
+ HostID *string
+
+ // READ-ONLY; The dedicated host instance view.
+ InstanceView *DedicatedHostInstanceView
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *string
+
+ // READ-ONLY; The date when the host was first provisioned.
+ ProvisioningTime *time.Time
+
+ // READ-ONLY; Specifies the time at which the Dedicated Host resource was created. Minimum api-version: 2021-11-01.
+ TimeCreated *time.Time
+
+ // READ-ONLY; A list of references to all virtual machines in the Dedicated Host.
+ VirtualMachines []*SubResourceReadOnly
+}
+
+// DedicatedHostSizeListResult - The List Dedicated Host sizes operation response.
+type DedicatedHostSizeListResult struct {
+ // The list of dedicated host sizes.
+ Value []*string
+}
+
+// DedicatedHostUpdate - Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType may
+// be updated.
+type DedicatedHostUpdate struct {
+ // Properties of the dedicated host.
+ Properties *DedicatedHostProperties
+
+ // List all available dedicated host sizes for resizing [https://docs.microsoft.com/rest/api/compute/dedicated-hosts/listavailablesizes].
+ // Resizing can be only used to scale up DedicatedHost. Only name is
+ // required to be set.
+ SKU *SKU
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// DiagnosticsProfile - Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.
+type DiagnosticsProfile struct {
+ // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. NOTE:
+ // If storageUri is being specified then ensure that the storage account is in
+ // the same region and subscription as the VM. You can easily view the output of your console log. Azure also enables you
+ // to see a screenshot of the VM from the hypervisor.
+ BootDiagnostics *BootDiagnostics
+}
+
+// DiffDiskSettings - Describes the parameters of ephemeral disk settings that can be specified for operating system disk.
+// Note: The ephemeral disk settings can only be specified for managed disk.
+type DiffDiskSettings struct {
+ // Specifies the ephemeral disk settings for operating system disk.
+ Option *DiffDiskOptions
+
+ // Specifies the ephemeral disk placement for operating system disk. Possible values are: CacheDisk, ResourceDisk. The defaulting
+ // behavior is: CacheDisk if one is configured for the VM size otherwise
+ // ResourceDisk is used. Refer to the VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes
+ // and Linux VM at
+ // https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk.
+ Placement *DiffDiskPlacement
+}
+
+// Disallowed - Describes the disallowed disk types.
+type Disallowed struct {
+ // A list of disk types.
+ DiskTypes []*string
+}
+
+// DisallowedConfiguration - Specifies the disallowed configuration for a virtual machine image.
+type DisallowedConfiguration struct {
+ // VM disk types which are disallowed.
+ VMDiskType *VMDiskTypes
+}
+
+// Disk resource.
+type Disk struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // The extended location where the disk will be created. Extended location cannot be changed.
+ ExtendedLocation *ExtendedLocation
+
+ // Disk resource properties.
+ Properties *DiskProperties
+
+ // The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS, or PremiumV2_LRS.
+ SKU *DiskSKU
+
+ // Resource tags
+ Tags map[string]*string
+
+ // The Logical zone list for Disk.
+ Zones []*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; A relative URI containing the ID of the VM that has the disk attached.
+ ManagedBy *string
+
+ // READ-ONLY; List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to
+ // a value greater than one for disks to allow attaching them to multiple VMs.
+ ManagedByExtended []*string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// DiskAccess - disk access resource.
+type DiskAccess struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // The extended location where the disk access will be created. Extended location cannot be changed.
+ ExtendedLocation *ExtendedLocation
+ Properties *DiskAccessProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// DiskAccessList - The List disk access operation response.
+type DiskAccessList struct {
+ // REQUIRED; A list of disk access resources.
+ Value []*DiskAccess
+
+ // The uri to fetch the next page of disk access resources. Call ListNext() with this to fetch the next page of disk access
+ // resources.
+ NextLink *string
+}
+
+type DiskAccessProperties struct {
+ // READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection
+ // is supported.
+ PrivateEndpointConnections []*PrivateEndpointConnection
+
+ // READ-ONLY; The disk access resource provisioning state.
+ ProvisioningState *string
+
+ // READ-ONLY; The time when the disk access was created.
+ TimeCreated *time.Time
+}
+
+// DiskAccessUpdate - Used for updating a disk access resource.
+type DiskAccessUpdate struct {
+ // Resource tags
+ Tags map[string]*string
+}
+
+// DiskEncryptionSet - disk encryption set resource.
+type DiskEncryptionSet struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used
+ // to encrypt disks.
+ Identity *EncryptionSetIdentity
+ Properties *EncryptionSetProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// DiskEncryptionSetList - The List disk encryption set operation response.
+type DiskEncryptionSetList struct {
+ // REQUIRED; A list of disk encryption sets.
+ Value []*DiskEncryptionSet
+
+ // The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption
+ // sets.
+ NextLink *string
+}
+
+// DiskEncryptionSetParameters - Describes the parameter of customer managed disk encryption set resource id that can be specified
+// for disk. Note: The disk encryption set resource id can only be specified for managed disk. Please
+// refer https://aka.ms/mdssewithcmkoverview for more details.
+type DiskEncryptionSetParameters struct {
+ // Resource Id
+ ID *string
+}
+
+// DiskEncryptionSetUpdate - disk encryption set update resource.
+type DiskEncryptionSetUpdate struct {
+ // The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used
+ // to encrypt disks.
+ Identity *EncryptionSetIdentity
+
+ // disk encryption set resource update properties.
+ Properties *DiskEncryptionSetUpdateProperties
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// DiskEncryptionSetUpdateProperties - disk encryption set resource update properties.
+type DiskEncryptionSetUpdateProperties struct {
+ // Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots
+ ActiveKey *KeyForDiskEncryptionSet
+
+ // The type of key used to encrypt the data of the disk.
+ EncryptionType *DiskEncryptionSetType
+
+ // Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the
+ // property.
+ FederatedClientID *string
+
+ // Set this flag to true to enable auto-updating of this disk encryption set to the latest key version.
+ RotationToLatestKeyVersionEnabled *bool
+}
+
+// DiskEncryptionSettings - Describes a Encryption Settings for a Disk
+type DiskEncryptionSettings struct {
+ // Specifies the location of the disk encryption key, which is a Key Vault Secret.
+ DiskEncryptionKey *KeyVaultSecretReference
+
+ // Specifies whether disk encryption should be enabled on the virtual machine.
+ Enabled *bool
+
+ // Specifies the location of the key encryption key in Key Vault.
+ KeyEncryptionKey *KeyVaultKeyReference
+}
+
+// DiskImageEncryption - This is the disk image encryption base class.
+type DiskImageEncryption struct {
+ // A relative URI containing the resource ID of the disk encryption set.
+ DiskEncryptionSetID *string
+}
+
+// DiskInstanceView - The instance view of the disk.
+type DiskInstanceView struct {
+ // Specifies the encryption settings for the OS Disk.
+ // Minimum api-version: 2015-06-15
+ EncryptionSettings []*DiskEncryptionSettings
+
+ // The disk name.
+ Name *string
+
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+}
+
+// DiskList - The List Disks operation response.
+type DiskList struct {
+ // REQUIRED; A list of disks.
+ Value []*Disk
+
+ // The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks.
+ NextLink *string
+}
+
+// DiskProperties - Disk resource properties.
+type DiskProperties struct {
+ // REQUIRED; Disk source information. CreationData information cannot be changed after the disk has been created.
+ CreationData *CreationData
+
+ // Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default.
+ // Does not apply to Ultra disks.
+ BurstingEnabled *bool
+
+ // Percentage complete for the background copy when a resource is created via the CopyStart operation.
+ CompletionPercent *float32
+
+ // Additional authentication requirements when exporting or uploading to a disk or snapshot.
+ DataAccessAuthMode *DataAccessAuthMode
+
+ // ARM id of the DiskAccess resource for using private endpoints on disks.
+ DiskAccessID *string
+
+ // The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer
+ // between 4k and 256k bytes.
+ DiskIOPSReadOnly *int64
+
+ // The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k
+ // bytes.
+ DiskIOPSReadWrite *int64
+
+ // The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions
+ // of bytes per second - MB here uses the ISO notation, of powers of 10.
+ DiskMBpsReadOnly *int64
+
+ // The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here
+ // uses the ISO notation, of powers of 10.
+ DiskMBpsReadWrite *int64
+
+ // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this
+ // field is present for updates or creation with other options, it indicates a
+ // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size.
+ DiskSizeGB *int32
+
+ // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys.
+ Encryption *Encryption
+
+ // Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot.
+ EncryptionSettingsCollection *EncryptionSettingsCollection
+
+ // The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
+ HyperVGeneration *HyperVGeneration
+
+ // The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can
+ // be mounted on multiple VMs at the same time.
+ MaxShares *int32
+
+ // Policy for accessing the disk via network.
+ NetworkAccessPolicy *NetworkAccessPolicy
+
+ // The Operating System type.
+ OSType *OperatingSystemTypes
+
+ // Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times
+ // a day) by detached from one virtual machine and attached to another. This
+ // property should not be set for disks that are not detached and attached frequently as it causes the disks to not align
+ // with the fault domain of the virtual machine.
+ OptimizedForFrequentAttach *bool
+
+ // Policy for controlling export on the disk.
+ PublicNetworkAccess *PublicNetworkAccess
+
+ // Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher:
+ // MicrosoftWindowsServer, product: WindowsServer}
+ PurchasePlan *DiskPurchasePlan
+
+ // Contains the security related information for the resource.
+ SecurityProfile *DiskSecurityProfile
+
+ // List of supported capabilities for the image from which the OS disk was created.
+ SupportedCapabilities *SupportedCapabilities
+
+ // Indicates the OS on a disk supports hibernation.
+ SupportsHibernation *bool
+
+ // Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/.
+ // Does not apply to Ultra disks.
+ Tier *string
+
+ // READ-ONLY; Latest time when bursting was last enabled on a disk.
+ BurstingEnabledTime *time.Time
+
+ // READ-ONLY; The size of the disk in bytes. This field is read only.
+ DiskSizeBytes *int64
+
+ // READ-ONLY; The state of the disk.
+ DiskState *DiskState
+
+ // READ-ONLY; The UTC time when the ownership state of the disk was last changed i.e., the time the disk was last attached
+ // or detached from a VM or the time when the VM to which the disk was attached was
+ // deallocated or started.
+ LastOwnershipUpdateTime *time.Time
+
+ // READ-ONLY; Properties of the disk for which update is pending.
+ PropertyUpdatesInProgress *PropertyUpdatesInProgress
+
+ // READ-ONLY; The disk provisioning state.
+ ProvisioningState *string
+
+ // READ-ONLY; Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than
+ // one for disks to allow attaching them to multiple VMs.
+ ShareInfo []*ShareInfoElement
+
+ // READ-ONLY; The time when the disk was created.
+ TimeCreated *time.Time
+
+ // READ-ONLY; Unique Guid identifying the resource.
+ UniqueID *string
+}
+
+// DiskPurchasePlan - Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
+type DiskPurchasePlan struct {
+ // REQUIRED; The plan ID.
+ Name *string
+
+ // REQUIRED; Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference
+ // element.
+ Product *string
+
+ // REQUIRED; The publisher ID.
+ Publisher *string
+
+ // The Offer Promotion Code.
+ PromotionCode *string
+}
+
+// DiskRestorePoint - Properties of disk restore point
+type DiskRestorePoint struct {
+ // Properties of an incremental disk restore point
+ Properties *DiskRestorePointProperties
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// DiskRestorePointAttributes - Disk Restore Point details.
+type DiskRestorePointAttributes struct {
+ // Encryption at rest settings for disk restore point. It is an optional property that can be specified in the input while
+ // creating a restore point.
+ Encryption *RestorePointEncryption
+
+ // Resource Id of the source disk restore point.
+ SourceDiskRestorePoint *APIEntityReference
+
+ // READ-ONLY; Resource Id
+ ID *string
+}
+
+// DiskRestorePointInstanceView - The instance view of a disk restore point.
+type DiskRestorePointInstanceView struct {
+ // Disk restore point Id.
+ ID *string
+
+ // The disk restore point replication status information.
+ ReplicationStatus *DiskRestorePointReplicationStatus
+}
+
+// DiskRestorePointList - The List Disk Restore Points operation response.
+type DiskRestorePointList struct {
+ // REQUIRED; A list of disk restore points.
+ Value []*DiskRestorePoint
+
+ // The uri to fetch the next page of disk restore points. Call ListNext() with this to fetch the next page of disk restore
+ // points.
+ NextLink *string
+}
+
+// DiskRestorePointProperties - Properties of an incremental disk restore point
+type DiskRestorePointProperties struct {
+ // Percentage complete for the background copy of disk restore point when source resource is from a different region.
+ CompletionPercent *float32
+
+ // ARM id of the DiskAccess resource for using private endpoints on disks.
+ DiskAccessID *string
+
+ // The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
+ HyperVGeneration *HyperVGeneration
+
+ // Policy for accessing the disk via network.
+ NetworkAccessPolicy *NetworkAccessPolicy
+
+ // Policy for controlling export on the disk.
+ PublicNetworkAccess *PublicNetworkAccess
+
+ // Purchase plan information for the the image from which the OS disk was created.
+ PurchasePlan *DiskPurchasePlan
+
+ // Contains the security related information for the resource.
+ SecurityProfile *DiskSecurityProfile
+
+ // List of supported capabilities for the image from which the OS disk was created.
+ SupportedCapabilities *SupportedCapabilities
+
+ // Indicates the OS on a disk supports hibernation.
+ SupportsHibernation *bool
+
+ // READ-ONLY; Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys.
+ Encryption *Encryption
+
+ // READ-ONLY; id of the backing snapshot's MIS family
+ FamilyID *string
+
+ // READ-ONLY; The Operating System type.
+ OSType *OperatingSystemTypes
+
+ // READ-ONLY; Replication state of disk restore point when source resource is from a different region.
+ ReplicationState *string
+
+ // READ-ONLY; arm id of source disk or source disk restore point.
+ SourceResourceID *string
+
+ // READ-ONLY; Location of source disk or source disk restore point when source resource is from a different region.
+ SourceResourceLocation *string
+
+ // READ-ONLY; unique incarnation id of the source disk
+ SourceUniqueID *string
+
+ // READ-ONLY; The timestamp of restorePoint creation
+ TimeCreated *time.Time
+}
+
+// DiskRestorePointReplicationStatus - The instance view of a disk restore point.
+type DiskRestorePointReplicationStatus struct {
+ // Replication completion percentage.
+ CompletionPercent *int32
+
+ // The resource status information.
+ Status *InstanceViewStatus
+}
+
+// DiskSKU - The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS,
+// or PremiumV2_LRS.
+type DiskSKU struct {
+ // The sku name.
+ Name *DiskStorageAccountTypes
+
+ // READ-ONLY; The sku tier.
+ Tier *string
+}
+
+// DiskSecurityProfile - Contains the security related information for the resource.
+type DiskSecurityProfile struct {
+ // ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer managed key
+ SecureVMDiskEncryptionSetID *string
+
+ // Specifies the SecurityType of the VM. Applicable for OS disks only.
+ SecurityType *DiskSecurityTypes
+}
+
+// DiskUpdate - Disk update resource.
+type DiskUpdate struct {
+ // Disk resource update properties.
+ Properties *DiskUpdateProperties
+
+ // The disks sku name. Can be StandardLRS, PremiumLRS, StandardSSDLRS, UltraSSDLRS, PremiumZRS, StandardSSDZRS, or PremiumV2_LRS.
+ SKU *DiskSKU
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// DiskUpdateProperties - Disk resource update properties.
+type DiskUpdateProperties struct {
+ // Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default.
+ // Does not apply to Ultra disks.
+ BurstingEnabled *bool
+
+ // Additional authentication requirements when exporting or uploading to a disk or snapshot.
+ DataAccessAuthMode *DataAccessAuthMode
+
+ // ARM id of the DiskAccess resource for using private endpoints on disks.
+ DiskAccessID *string
+
+ // The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer
+ // between 4k and 256k bytes.
+ DiskIOPSReadOnly *int64
+
+ // The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k
+ // bytes.
+ DiskIOPSReadWrite *int64
+
+ // The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions
+ // of bytes per second - MB here uses the ISO notation, of powers of 10.
+ DiskMBpsReadOnly *int64
+
+ // The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here
+ // uses the ISO notation, of powers of 10.
+ DiskMBpsReadWrite *int64
+
+ // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this
+ // field is present for updates or creation with other options, it indicates a
+ // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size.
+ DiskSizeGB *int32
+
+ // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys.
+ Encryption *Encryption
+
+ // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot.
+ EncryptionSettingsCollection *EncryptionSettingsCollection
+
+ // The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can
+ // be mounted on multiple VMs at the same time.
+ MaxShares *int32
+
+ // Policy for accessing the disk via network.
+ NetworkAccessPolicy *NetworkAccessPolicy
+
+ // the Operating System type.
+ OSType *OperatingSystemTypes
+
+ // Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times
+ // a day) by detached from one virtual machine and attached to another. This
+ // property should not be set for disks that are not detached and attached frequently as it causes the disks to not align
+ // with the fault domain of the virtual machine.
+ OptimizedForFrequentAttach *bool
+
+ // Policy for controlling export on the disk.
+ PublicNetworkAccess *PublicNetworkAccess
+
+ // Purchase plan information to be added on the OS disk
+ PurchasePlan *DiskPurchasePlan
+
+ // List of supported capabilities to be added on the OS disk.
+ SupportedCapabilities *SupportedCapabilities
+
+ // Indicates the OS on a disk supports hibernation.
+ SupportsHibernation *bool
+
+ // Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/.
+ // Does not apply to Ultra disks.
+ Tier *string
+
+ // READ-ONLY; Properties of the disk for which update is pending.
+ PropertyUpdatesInProgress *PropertyUpdatesInProgress
+}
+
+// Encryption at rest settings for disk or snapshot
+type Encryption struct {
+ // ResourceId of the disk encryption set to use for enabling encryption at rest.
+ DiskEncryptionSetID *string
+
+ // The type of key used to encrypt the data of the disk.
+ Type *EncryptionType
+}
+
+// EncryptionImages - Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the
+// gallery artifact.
+type EncryptionImages struct {
+ // A list of encryption specifications for data disk images.
+ DataDiskImages []*DataDiskImageEncryption
+
+ // Contains encryption settings for an OS disk image.
+ OSDiskImage *OSDiskImageEncryption
+}
+
+// EncryptionSetIdentity - The managed identity for the disk encryption set. It should be given permission on the key vault
+// before it can be used to encrypt disks.
+type EncryptionSetIdentity struct {
+ // The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption
+ // Sets can be updated with Identity type None during migration of
+ // subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys.
+ Type *DiskEncryptionSetIdentityType
+
+ // The list of user identities associated with the disk encryption set. The user identity dictionary key references will be
+ // ARM resource ids in the form:
+ // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
+ UserAssignedIdentities map[string]*UserAssignedIdentitiesValue
+
+ // READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id
+ // header in the PUT request if the resource has a systemAssigned(implicit)
+ // identity
+ PrincipalID *string
+
+ // READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id
+ // header in the PUT request if the resource has a systemAssigned(implicit) identity
+ TenantID *string
+}
+
+type EncryptionSetProperties struct {
+ // The key vault key which is currently used by this disk encryption set.
+ ActiveKey *KeyForDiskEncryptionSet
+
+ // The type of key used to encrypt the data of the disk.
+ EncryptionType *DiskEncryptionSetType
+
+ // Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the
+ // property.
+ FederatedClientID *string
+
+ // Set this flag to true to enable auto-updating of this disk encryption set to the latest key version.
+ RotationToLatestKeyVersionEnabled *bool
+
+ // READ-ONLY; The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will
+ // not be attempted until the error on this disk encryption set is fixed.
+ AutoKeyRotationError *APIError
+
+ // READ-ONLY; The time when the active key of this disk encryption set was updated.
+ LastKeyRotationTimestamp *time.Time
+
+ // READ-ONLY; A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is
+ // in progress. It will be empty if there is no ongoing key rotation.
+ PreviousKeys []*KeyForDiskEncryptionSet
+
+ // READ-ONLY; The disk encryption set provisioning state.
+ ProvisioningState *string
+}
+
+// EncryptionSettingsCollection - Encryption settings for disk or snapshot
+type EncryptionSettingsCollection struct {
+ // REQUIRED; Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this
+ // flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption.
+ // If EncryptionSettings is null in the request object, the existing settings remain unchanged.
+ Enabled *bool
+
+ // A collection of encryption settings, one for each disk volume.
+ EncryptionSettings []*EncryptionSettingsElement
+
+ // Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds
+ // to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk
+ // Encryption.
+ EncryptionSettingsVersion *string
+}
+
+// EncryptionSettingsElement - Encryption settings for one disk volume.
+type EncryptionSettingsElement struct {
+ // Key Vault Secret Url and vault id of the disk encryption key
+ DiskEncryptionKey *KeyVaultAndSecretReference
+
+ // Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap
+ // the disk encryption key.
+ KeyEncryptionKey *KeyVaultAndKeyReference
+}
+
+// ExtendedLocation - The complex type of the extended location.
+type ExtendedLocation struct {
+ // The name of the extended location.
+ Name *string
+
+ // The type of the extended location.
+ Type *ExtendedLocationTypes
+}
+
+// Extension - Describes a cloud service Extension.
+type Extension struct {
+ // The name of the extension.
+ Name *string
+
+ // Extension Properties.
+ Properties *CloudServiceExtensionProperties
+}
+
+// Gallery - Specifies information about the Shared Image Gallery that you want to create or update.
+type Gallery struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // Describes the properties of a Shared Image Gallery.
+ Properties *GalleryProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GalleryApplication - Specifies information about the gallery Application Definition that you want to create or update.
+type GalleryApplication struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // Describes the properties of a gallery Application Definition.
+ Properties *GalleryApplicationProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GalleryApplicationCustomAction - A custom action that can be performed with a Gallery Application Version.
+type GalleryApplicationCustomAction struct {
+ // REQUIRED; The name of the custom action. Must be unique within the Gallery Application Version.
+ Name *string
+
+ // REQUIRED; The script to run when executing this custom action.
+ Script *string
+
+ // Description to help the users understand what this custom action does.
+ Description *string
+
+ // The parameters that this custom action uses
+ Parameters []*GalleryApplicationCustomActionParameter
+}
+
+// GalleryApplicationCustomActionParameter - The definition of a parameter that can be passed to a custom action of a Gallery
+// Application Version.
+type GalleryApplicationCustomActionParameter struct {
+ // REQUIRED; The name of the custom action. Must be unique within the Gallery Application Version.
+ Name *string
+
+ // The default value of the parameter. Only applies to string types
+ DefaultValue *string
+
+ // A description to help users understand what this parameter means
+ Description *string
+
+ // Indicates whether this parameter must be passed when running the custom action.
+ Required *bool
+
+ // Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob
+ Type *GalleryApplicationCustomActionParameterType
+}
+
+// GalleryApplicationList - The List Gallery Applications operation response.
+type GalleryApplicationList struct {
+ // REQUIRED; A list of Gallery Applications.
+ Value []*GalleryApplication
+
+ // The uri to fetch the next page of Application Definitions in the Application Gallery. Call ListNext() with this to fetch
+ // the next page of gallery Application Definitions.
+ NextLink *string
+}
+
+// GalleryApplicationProperties - Describes the properties of a gallery Application Definition.
+type GalleryApplicationProperties struct {
+ // REQUIRED; This property allows you to specify the supported type of the OS that application is built for.
+ // Possible values are:
+ // Windows
+ // Linux
+ SupportedOSType *OperatingSystemTypes
+
+ // A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application.
+ CustomActions []*GalleryApplicationCustomAction
+
+ // The description of this gallery Application Definition resource. This property is updatable.
+ Description *string
+
+ // The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This
+ // property is updatable.
+ EndOfLifeDate *time.Time
+
+ // The Eula agreement for the gallery Application Definition.
+ Eula *string
+
+ // The privacy statement uri.
+ PrivacyStatementURI *string
+
+ // The release note uri.
+ ReleaseNoteURI *string
+}
+
+// GalleryApplicationUpdate - Specifies information about the gallery Application Definition that you want to update.
+type GalleryApplicationUpdate struct {
+ // Describes the properties of a gallery Application Definition.
+ Properties *GalleryApplicationProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GalleryApplicationVersion - Specifies information about the gallery Application Version that you want to create or update.
+type GalleryApplicationVersion struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // Describes the properties of a gallery image version.
+ Properties *GalleryApplicationVersionProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GalleryApplicationVersionList - The List Gallery Application version operation response.
+type GalleryApplicationVersionList struct {
+ // REQUIRED; A list of gallery Application Versions.
+ Value []*GalleryApplicationVersion
+
+ // The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery
+ // Application Versions.
+ NextLink *string
+}
+
+// GalleryApplicationVersionProperties - Describes the properties of a gallery image version.
+type GalleryApplicationVersionProperties struct {
+ // REQUIRED; The publishing profile of a gallery image version.
+ PublishingProfile *GalleryApplicationVersionPublishingProfile
+
+ // The safety profile of the Gallery Application Version.
+ SafetyProfile *GalleryApplicationVersionSafetyProfile
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *GalleryProvisioningState
+
+ // READ-ONLY; This is the replication status of the gallery image version.
+ ReplicationStatus *ReplicationStatus
+}
+
+// GalleryApplicationVersionPublishingProfile - The publishing profile of a gallery image version.
+type GalleryApplicationVersionPublishingProfile struct {
+ // REQUIRED; The source image from which the Image Version is going to be created.
+ Source *UserArtifactSource
+
+ // Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only.
+ AdvancedSettings map[string]*string
+
+ // A list of custom actions that can be performed with this Gallery Application Version.
+ CustomActions []*GalleryApplicationCustomAction
+
+ // Optional. Whether or not this application reports health.
+ EnableHealthCheck *bool
+
+ // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property
+ // is updatable.
+ EndOfLifeDate *time.Time
+
+ // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version.
+ ExcludeFromLatest *bool
+ ManageActions *UserArtifactManage
+
+ // The number of replicas of the Image Version to be created per region. This property would take effect for a region when
+ // regionalReplicaCount is not specified. This property is updatable.
+ ReplicaCount *int32
+
+ // Optional parameter which specifies the mode to be used for replication. This property is not updatable.
+ ReplicationMode *ReplicationMode
+
+ // Additional settings for the VM app that contains the target package and config file name when it is deployed to target
+ // VM or VM scale set.
+ Settings *UserArtifactSettings
+
+ // Specifies the storage account type to be used to store the image. This property is not updatable.
+ StorageAccountType *StorageAccountType
+
+ // The target extended locations where the Image Version is going to be replicated to. This property is updatable.
+ TargetExtendedLocations []*GalleryTargetExtendedLocation
+
+ // The target regions where the Image Version is going to be replicated to. This property is updatable.
+ TargetRegions []*TargetRegion
+
+ // READ-ONLY; The timestamp for when the gallery image version is published.
+ PublishedDate *time.Time
+}
+
+// GalleryApplicationVersionSafetyProfile - The safety profile of the Gallery Application Version.
+type GalleryApplicationVersionSafetyProfile struct {
+ // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed.
+ AllowDeletionOfReplicatedLocations *bool
+}
+
+// GalleryApplicationVersionUpdate - Specifies information about the gallery Application Version that you want to update.
+type GalleryApplicationVersionUpdate struct {
+ // Describes the properties of a gallery image version.
+ Properties *GalleryApplicationVersionProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GalleryArtifactPublishingProfileBase - Describes the basic gallery artifact publishing profile.
+type GalleryArtifactPublishingProfileBase struct {
+ // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property
+ // is updatable.
+ EndOfLifeDate *time.Time
+
+ // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version.
+ ExcludeFromLatest *bool
+
+ // The number of replicas of the Image Version to be created per region. This property would take effect for a region when
+ // regionalReplicaCount is not specified. This property is updatable.
+ ReplicaCount *int32
+
+ // Optional parameter which specifies the mode to be used for replication. This property is not updatable.
+ ReplicationMode *ReplicationMode
+
+ // Specifies the storage account type to be used to store the image. This property is not updatable.
+ StorageAccountType *StorageAccountType
+
+ // The target extended locations where the Image Version is going to be replicated to. This property is updatable.
+ TargetExtendedLocations []*GalleryTargetExtendedLocation
+
+ // The target regions where the Image Version is going to be replicated to. This property is updatable.
+ TargetRegions []*TargetRegion
+
+ // READ-ONLY; The timestamp for when the gallery image version is published.
+ PublishedDate *time.Time
+}
+
+// GalleryArtifactSafetyProfileBase - This is the safety profile of the Gallery Artifact Version.
+type GalleryArtifactSafetyProfileBase struct {
+ // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed.
+ AllowDeletionOfReplicatedLocations *bool
+}
+
+// GalleryArtifactSource - The source image from which the Image Version is going to be created.
+type GalleryArtifactSource struct {
+ // REQUIRED; The managed artifact.
+ ManagedImage *ManagedArtifact
+}
+
+// GalleryArtifactVersionFullSource - The source of the gallery artifact version.
+type GalleryArtifactVersionFullSource struct {
+ // The resource Id of the source Community Gallery Image. Only required when using Community Gallery Image as a source.
+ CommunityGalleryImageID *string
+
+ // The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource.
+ ID *string
+}
+
+// GalleryArtifactVersionSource - The gallery artifact version source.
+type GalleryArtifactVersionSource struct {
+ // The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource.
+ ID *string
+}
+
+// GalleryDataDiskImage - This is the data disk image.
+type GalleryDataDiskImage struct {
+ // REQUIRED; This property specifies the logical unit number of the data disk. This value is used to identify data disks within
+ // the Virtual Machine and therefore must be unique for each data disk attached to the
+ // Virtual Machine.
+ Lun *int32
+
+ // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'
+ HostCaching *HostCaching
+
+ // The source for the disk image.
+ Source *GalleryDiskImageSource
+
+ // READ-ONLY; This property indicates the size of the VHD to be created.
+ SizeInGB *int32
+}
+
+// GalleryDiskImage - This is the disk image base class.
+type GalleryDiskImage struct {
+ // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'
+ HostCaching *HostCaching
+
+ // The source for the disk image.
+ Source *GalleryDiskImageSource
+
+ // READ-ONLY; This property indicates the size of the VHD to be created.
+ SizeInGB *int32
+}
+
+// GalleryDiskImageSource - The source for the disk image.
+type GalleryDiskImageSource struct {
+ // The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource.
+ ID *string
+
+ // The Storage Account Id that contains the vhd blob being used as a source for this artifact version.
+ StorageAccountID *string
+
+ // The uri of the gallery artifact version source. Currently used to specify vhd/blob source.
+ URI *string
+}
+
+// GalleryExtendedLocation - The name of the extended location.
+type GalleryExtendedLocation struct {
+ Name *string
+
+ // It is type of the extended location.
+ Type *GalleryExtendedLocationType
+}
+
+// GalleryIdentifier - Describes the gallery unique name.
+type GalleryIdentifier struct {
+ // READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure.
+ UniqueName *string
+}
+
+// GalleryImage - Specifies information about the gallery image definition that you want to create or update.
+type GalleryImage struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // Describes the properties of a gallery image definition.
+ Properties *GalleryImageProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GalleryImageFeature - A feature for gallery image.
+type GalleryImageFeature struct {
+ // The name of the gallery image feature.
+ Name *string
+
+ // The value of the gallery image feature.
+ Value *string
+}
+
+// GalleryImageIdentifier - This is the gallery image definition identifier.
+type GalleryImageIdentifier struct {
+ // REQUIRED; The name of the gallery image definition offer.
+ Offer *string
+
+ // REQUIRED; The name of the gallery image definition publisher.
+ Publisher *string
+
+ // REQUIRED; The name of the gallery image definition SKU.
+ SKU *string
+}
+
+// GalleryImageList - The List Gallery Images operation response.
+type GalleryImageList struct {
+ // REQUIRED; A list of Shared Image Gallery images.
+ Value []*GalleryImage
+
+ // The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the
+ // next page of gallery image definitions.
+ NextLink *string
+}
+
+// GalleryImageProperties - Describes the properties of a gallery image definition.
+type GalleryImageProperties struct {
+ // REQUIRED; This is the gallery image definition identifier.
+ Identifier *GalleryImageIdentifier
+
+ // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized'
+ // or 'Specialized'.
+ OSState *OperatingSystemStateTypes
+
+ // REQUIRED; This property allows you to specify the type of the OS that is included in the disk when creating a VM from a
+ // managed image.
+ // Possible values are:
+ // Windows
+ // Linux
+ OSType *OperatingSystemTypes
+
+ // The architecture of the image. Applicable to OS disks only.
+ Architecture *Architecture
+
+ // The description of this gallery image definition resource. This property is updatable.
+ Description *string
+
+ // Describes the disallowed disk types.
+ Disallowed *Disallowed
+
+ // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property
+ // is updatable.
+ EndOfLifeDate *time.Time
+
+ // The Eula agreement for the gallery image definition.
+ Eula *string
+
+ // A list of gallery image features.
+ Features []*GalleryImageFeature
+
+ // The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
+ HyperVGeneration *HyperVGeneration
+
+ // The privacy statement uri.
+ PrivacyStatementURI *string
+
+ // Describes the gallery image definition purchase plan. This is used by marketplace images.
+ PurchasePlan *ImagePurchasePlan
+
+ // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable.
+ Recommended *RecommendedMachineConfiguration
+
+ // The release note uri.
+ ReleaseNoteURI *string
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *GalleryProvisioningState
+}
+
+// GalleryImageUpdate - Specifies information about the gallery image definition that you want to update.
+type GalleryImageUpdate struct {
+ // Describes the properties of a gallery image definition.
+ Properties *GalleryImageProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GalleryImageVersion - Specifies information about the gallery image version that you want to create or update.
+type GalleryImageVersion struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // Describes the properties of a gallery image version.
+ Properties *GalleryImageVersionProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GalleryImageVersionList - The List Gallery Image version operation response.
+type GalleryImageVersionList struct {
+ // REQUIRED; A list of gallery image versions.
+ Value []*GalleryImageVersion
+
+ // The uri to fetch the next page of gallery image versions. Call ListNext() with this to fetch the next page of gallery image
+ // versions.
+ NextLink *string
+}
+
+// GalleryImageVersionProperties - Describes the properties of a gallery image version.
+type GalleryImageVersionProperties struct {
+ // REQUIRED; This is the storage profile of a Gallery Image Version.
+ StorageProfile *GalleryImageVersionStorageProfile
+
+ // The publishing profile of a gallery image Version.
+ PublishingProfile *GalleryImageVersionPublishingProfile
+
+ // This is the safety profile of the Gallery Image Version.
+ SafetyProfile *GalleryImageVersionSafetyProfile
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *GalleryProvisioningState
+
+ // READ-ONLY; This is the replication status of the gallery image version.
+ ReplicationStatus *ReplicationStatus
+}
+
+// GalleryImageVersionPublishingProfile - The publishing profile of a gallery image Version.
+type GalleryImageVersionPublishingProfile struct {
+ // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property
+ // is updatable.
+ EndOfLifeDate *time.Time
+
+ // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version.
+ ExcludeFromLatest *bool
+
+ // The number of replicas of the Image Version to be created per region. This property would take effect for a region when
+ // regionalReplicaCount is not specified. This property is updatable.
+ ReplicaCount *int32
+
+ // Optional parameter which specifies the mode to be used for replication. This property is not updatable.
+ ReplicationMode *ReplicationMode
+
+ // Specifies the storage account type to be used to store the image. This property is not updatable.
+ StorageAccountType *StorageAccountType
+
+ // The target extended locations where the Image Version is going to be replicated to. This property is updatable.
+ TargetExtendedLocations []*GalleryTargetExtendedLocation
+
+ // The target regions where the Image Version is going to be replicated to. This property is updatable.
+ TargetRegions []*TargetRegion
+
+ // READ-ONLY; The timestamp for when the gallery image version is published.
+ PublishedDate *time.Time
+}
+
+// GalleryImageVersionSafetyProfile - This is the safety profile of the Gallery Image Version.
+type GalleryImageVersionSafetyProfile struct {
+ // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed.
+ AllowDeletionOfReplicatedLocations *bool
+
+ // READ-ONLY; A list of Policy Violations that have been reported for this Gallery Image Version.
+ PolicyViolations []*PolicyViolation
+
+ // READ-ONLY; Indicates whether this image has been reported as violating Microsoft's policies.
+ ReportedForPolicyViolation *bool
+}
+
+// GalleryImageVersionStorageProfile - This is the storage profile of a Gallery Image Version.
+type GalleryImageVersionStorageProfile struct {
+ // A list of data disk images.
+ DataDiskImages []*GalleryDataDiskImage
+
+ // This is the OS disk image.
+ OSDiskImage *GalleryOSDiskImage
+
+ // The source of the gallery artifact version.
+ Source *GalleryArtifactVersionFullSource
+}
+
+// GalleryImageVersionUpdate - Specifies information about the gallery image version that you want to update.
+type GalleryImageVersionUpdate struct {
+ // Describes the properties of a gallery image version.
+ Properties *GalleryImageVersionProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GalleryList - The List Galleries operation response.
+type GalleryList struct {
+ // REQUIRED; A list of galleries.
+ Value []*Gallery
+
+ // The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries.
+ NextLink *string
+}
+
+// GalleryOSDiskImage - This is the OS disk image.
+type GalleryOSDiskImage struct {
+ // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'
+ HostCaching *HostCaching
+
+ // The source for the disk image.
+ Source *GalleryDiskImageSource
+
+ // READ-ONLY; This property indicates the size of the VHD to be created.
+ SizeInGB *int32
+}
+
+// GalleryProperties - Describes the properties of a Shared Image Gallery.
+type GalleryProperties struct {
+ // The description of this Shared Image Gallery resource. This property is updatable.
+ Description *string
+
+ // Describes the gallery unique name.
+ Identifier *GalleryIdentifier
+
+ // Profile for gallery sharing to subscription or tenant
+ SharingProfile *SharingProfile
+
+ // Contains information about the soft deletion policy of the gallery.
+ SoftDeletePolicy *SoftDeletePolicy
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *GalleryProvisioningState
+
+ // READ-ONLY; Sharing status of current gallery.
+ SharingStatus *SharingStatus
+}
+
+type GalleryTargetExtendedLocation struct {
+ // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact.
+ Encryption *EncryptionImages
+
+ // The name of the extended location.
+ ExtendedLocation *GalleryExtendedLocation
+
+ // The number of replicas of the Image Version to be created per extended location. This property is updatable.
+ ExtendedLocationReplicaCount *int32
+
+ // The name of the region.
+ Name *string
+
+ // Specifies the storage account type to be used to store the image. This property is not updatable.
+ StorageAccountType *EdgeZoneStorageAccountType
+}
+
+// GalleryUpdate - Specifies information about the Shared Image Gallery that you want to update.
+type GalleryUpdate struct {
+ // Describes the properties of a Shared Image Gallery.
+ Properties *GalleryProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GrantAccessData - Data used for requesting a SAS.
+type GrantAccessData struct {
+ // REQUIRED
+ Access *AccessLevel
+
+ // REQUIRED; Time duration in seconds until the SAS access expires.
+ DurationInSeconds *int32
+
+ // Used to specify the file format when making request for SAS on a VHDX file format snapshot
+ FileFormat *FileFormat
+
+ // Set this flag to true to get additional SAS for VM guest state
+ GetSecureVMGuestStateSAS *bool
+}
+
+// HardwareProfile - Specifies the hardware settings for the virtual machine.
+type HardwareProfile struct {
+ // Specifies the size of the virtual machine. The enum data type is currently deprecated and will be removed by December 23rd
+ // 2023. The recommended way to get the list of available sizes is using these
+ // APIs: List all available virtual machine sizes in an availability set [https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes],
+ // List all available virtual machine sizes in a
+ // region [https://docs.microsoft.com/rest/api/compute/resourceskus/list], List all available virtual machine sizes for resizing
+ // [https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes]. For more information about virtual machine
+ // sizes, see Sizes for virtual machines
+ // [https://docs.microsoft.com/azure/virtual-machines/sizes]. The available VM sizes depend on region and availability set.
+ VMSize *VirtualMachineSizeTypes
+
+ // Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01. This feature
+ // is still in preview mode and is not supported for VirtualMachineScaleSet. Please
+ // follow the instructions in VM Customization [https://aka.ms/vmcustomization] for more details.
+ VMSizeProperties *VMSizeProperties
+}
+
+// Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual
+// machine. If SourceImage is provided, the destination virtual hard drive must not
+// exist.
+type Image struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // The extended location of the Image.
+ ExtendedLocation *ExtendedLocation
+
+ // Describes the properties of an Image.
+ Properties *ImageProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// ImageDataDisk - Describes a data disk.
+type ImageDataDisk struct {
+ // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and
+ // therefore must be unique for each data disk attached to a VM.
+ Lun *int32
+
+ // The Virtual Hard Disk.
+ BlobURI *string
+
+ // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard
+ // storage. ReadOnly for Premium storage.
+ Caching *CachingTypes
+
+ // Specifies the customer managed disk encryption set resource id for the managed image disk.
+ DiskEncryptionSet *DiskEncryptionSetParameters
+
+ // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual
+ // machine image. This value cannot be larger than 1023 GB.
+ DiskSizeGB *int32
+
+ // The managedDisk.
+ ManagedDisk *SubResource
+
+ // The snapshot.
+ Snapshot *SubResource
+
+ // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot
+ // be used with OS Disk.
+ StorageAccountType *StorageAccountTypes
+}
+
+// ImageDeprecationStatus - Describes image deprecation status properties on the image.
+type ImageDeprecationStatus struct {
+ // Describes the alternative option specified by the Publisher for this image when this image is deprecated.
+ AlternativeOption *AlternativeOption
+
+ // Describes the state of the image.
+ ImageState *ImageState
+
+ // The time, in future, at which this image will be marked as deprecated. This scheduled time is chosen by the Publisher.
+ ScheduledDeprecationTime *time.Time
+}
+
+// ImageDisk - Describes a image disk.
+type ImageDisk struct {
+ // The Virtual Hard Disk.
+ BlobURI *string
+
+ // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard
+ // storage. ReadOnly for Premium storage.
+ Caching *CachingTypes
+
+ // Specifies the customer managed disk encryption set resource id for the managed image disk.
+ DiskEncryptionSet *DiskEncryptionSetParameters
+
+ // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual
+ // machine image. This value cannot be larger than 1023 GB.
+ DiskSizeGB *int32
+
+ // The managedDisk.
+ ManagedDisk *SubResource
+
+ // The snapshot.
+ Snapshot *SubResource
+
+ // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot
+ // be used with OS Disk.
+ StorageAccountType *StorageAccountTypes
+}
+
+// ImageDiskReference - The source image used for creating the disk.
+type ImageDiskReference struct {
+ // A relative uri containing a community Azure Compute Gallery image reference.
+ CommunityGalleryImageID *string
+
+ // A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference.
+ ID *string
+
+ // If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image
+ // to use. For OS disks, this field is null.
+ Lun *int32
+
+ // A relative uri containing a direct shared Azure Compute Gallery image reference.
+ SharedGalleryImageID *string
+}
+
+// ImageListResult - The List Image operation response.
+type ImageListResult struct {
+ // REQUIRED; The list of Images.
+ Value []*Image
+
+ // The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images.
+ NextLink *string
+}
+
+// ImageOSDisk - Describes an Operating System disk.
+type ImageOSDisk struct {
+ // REQUIRED; The OS State. For managed images, use Generalized.
+ OSState *OperatingSystemStateTypes
+
+ // REQUIRED; This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom
+ // image. Possible values are: Windows, Linux.
+ OSType *OperatingSystemTypes
+
+ // The Virtual Hard Disk.
+ BlobURI *string
+
+ // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard
+ // storage. ReadOnly for Premium storage.
+ Caching *CachingTypes
+
+ // Specifies the customer managed disk encryption set resource id for the managed image disk.
+ DiskEncryptionSet *DiskEncryptionSetParameters
+
+ // Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual
+ // machine image. This value cannot be larger than 1023 GB.
+ DiskSizeGB *int32
+
+ // The managedDisk.
+ ManagedDisk *SubResource
+
+ // The snapshot.
+ Snapshot *SubResource
+
+ // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot
+ // be used with OS Disk.
+ StorageAccountType *StorageAccountTypes
+}
+
+// ImageProperties - Describes the properties of an Image.
+type ImageProperties struct {
+ // Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image
+ // source is a blob, then we need the user to specify the value, if the source is
+ // managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the
+ // source managed resource.
+ HyperVGeneration *HyperVGenerationTypes
+
+ // The source virtual machine from which Image is created.
+ SourceVirtualMachine *SubResource
+
+ // Specifies the storage settings for the virtual machine disks.
+ StorageProfile *ImageStorageProfile
+
+ // READ-ONLY; The provisioning state.
+ ProvisioningState *string
+}
+
+// ImagePurchasePlan - Describes the gallery image definition purchase plan. This is used by marketplace images.
+type ImagePurchasePlan struct {
+ // The plan ID.
+ Name *string
+
+ // The product ID.
+ Product *string
+
+ // The publisher ID.
+ Publisher *string
+}
+
+// ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace
+// images, or virtual machine images. This element is required when you want to use a platform
+// image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference
+// publisher and offer can only be set when you create the scale set.
+type ImageReference struct {
+ // Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET
+ // call.
+ CommunityGalleryImageID *string
+
+ // Resource Id
+ ID *string
+
+ // Specifies the offer of the platform image or marketplace image used to create the virtual machine.
+ Offer *string
+
+ // The image publisher.
+ Publisher *string
+
+ // The image SKU.
+ SKU *string
+
+ // Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call.
+ SharedGalleryImageID *string
+
+ // Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats
+ // are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers.
+ // Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image
+ // will not automatically update after deploy time even if a new version becomes
+ // available. Please do not use field 'version' for gallery image deployment, gallery image should always use 'id' field for
+ // deployment, to use 'latest' version of gallery image, just set
+ // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}'
+ // in the 'id' field without version input.
+ Version *string
+
+ // READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual
+ // machine. This readonly field differs from 'version', only if the value specified in
+ // 'version' field is 'latest'.
+ ExactVersion *string
+}
+
+// ImageStorageProfile - Describes a storage profile.
+type ImageStorageProfile struct {
+ // Specifies the parameters that are used to add a data disk to a virtual machine.
+ // For more information about disks, see About disks and VHDs for Azure virtual machines [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview].
+ DataDisks []*ImageDataDisk
+
+ // Specifies information about the operating system disk used by the virtual machine.
+ // For more information about disks, see About disks and VHDs for Azure virtual machines [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview].
+ OSDisk *ImageOSDisk
+
+ // Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions
+ // that provide Zone Redundant Storage (ZRS).
+ ZoneResilient *bool
+}
+
+// ImageUpdate - The source user image virtual hard disk. Only tags may be updated.
+type ImageUpdate struct {
+ // Describes the properties of an Image.
+ Properties *ImageProperties
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// InnerError - Inner error details.
+type InnerError struct {
+ // The internal error message or exception dump.
+ Errordetail *string
+
+ // The exception type.
+ Exceptiontype *string
+}
+
+// InstanceSKU - The role instance SKU.
+type InstanceSKU struct {
+ // READ-ONLY; The sku name.
+ Name *string
+
+ // READ-ONLY; The tier of the cloud service role instance.
+ Tier *string
+}
+
+// InstanceViewStatus - Instance view status.
+type InstanceViewStatus struct {
+ // The status code.
+ Code *string
+
+ // The short localizable label for the status.
+ DisplayStatus *string
+
+ // The level code.
+ Level *StatusLevelTypes
+
+ // The detailed status message, including for alerts and error messages.
+ Message *string
+
+ // The time of the status.
+ Time *time.Time
+}
+
+// InstanceViewStatusesSummary - Instance view statuses.
+type InstanceViewStatusesSummary struct {
+ // READ-ONLY; The summary.
+ StatusesSummary []*StatusCodeCount
+}
+
+// KeyForDiskEncryptionSet - Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots
+type KeyForDiskEncryptionSet struct {
+ // REQUIRED; Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled
+ // value.
+ KeyURL *string
+
+ // Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the KeyVault
+ // subscription is not the same as the Disk Encryption Set subscription.
+ SourceVault *SourceVault
+}
+
+// KeyVaultAndKeyReference - Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the
+// encryptionKey
+type KeyVaultAndKeyReference struct {
+ // REQUIRED; Url pointing to a key or secret in KeyVault
+ KeyURL *string
+
+ // REQUIRED; Resource id of the KeyVault containing the key or secret
+ SourceVault *SourceVault
+}
+
+// KeyVaultAndSecretReference - Key Vault Secret Url and vault id of the encryption key
+type KeyVaultAndSecretReference struct {
+ // REQUIRED; Url pointing to a key or secret in KeyVault
+ SecretURL *string
+
+ // REQUIRED; Resource id of the KeyVault containing the key or secret
+ SourceVault *SourceVault
+}
+
+// KeyVaultKeyReference - Describes a reference to Key Vault Key
+type KeyVaultKeyReference struct {
+ // REQUIRED; The URL referencing a key encryption key in Key Vault.
+ KeyURL *string
+
+ // REQUIRED; The relative URL of the Key Vault containing the key.
+ SourceVault *SubResource
+}
+
+// KeyVaultSecretReference - Describes a reference to Key Vault Secret
+type KeyVaultSecretReference struct {
+ // REQUIRED; The URL referencing a secret in a Key Vault.
+ SecretURL *string
+
+ // REQUIRED; The relative URL of the Key Vault containing the secret.
+ SourceVault *SubResource
+}
+
+// LastPatchInstallationSummary - Describes the properties of the last installed patch summary.
+type LastPatchInstallationSummary struct {
+ // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them.
+ Error *APIError
+
+ // READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match.
+ ExcludedPatchCount *int32
+
+ // READ-ONLY; The count of patches that failed installation.
+ FailedPatchCount *int32
+
+ // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension
+ // logs.
+ InstallationActivityID *string
+
+ // READ-ONLY; The count of patches that successfully installed.
+ InstalledPatchCount *int32
+
+ // READ-ONLY; The UTC timestamp when the operation began.
+ LastModifiedTime *time.Time
+
+ // READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions
+ MaintenanceWindowExceeded *bool
+
+ // READ-ONLY; The number of all available patches but not going to be installed because it didn't match a classification or
+ // inclusion list entry.
+ NotSelectedPatchCount *int32
+
+ // READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation.
+ PendingPatchCount *int32
+
+ // READ-ONLY; The UTC timestamp when the operation began.
+ StartTime *time.Time
+
+ // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes.
+ // At that point it will become "Unknown", "Failed", "Succeeded", or
+ // "CompletedWithWarnings."
+ Status *PatchOperationStatus
+}
+
+// LatestGalleryImageVersion - The gallery image version with latest version in a particular region.
+type LatestGalleryImageVersion struct {
+ // The name of the latest version in the region.
+ LatestVersionName *string
+
+ // region of the Gallery Image Version.
+ Location *string
+}
+
+// LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux
+// distributions, see Linux on Azure-Endorsed Distributions
+// [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros].
+type LinuxConfiguration struct {
+ // Specifies whether password authentication should be disabled.
+ DisablePasswordAuthentication *bool
+
+ // Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false.
+ EnableVMAgentPlatformUpdates *bool
+
+ // [Preview Feature] Specifies settings related to VM Guest Patching on Linux.
+ PatchSettings *LinuxPatchSettings
+
+ // Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified
+ // in the request body, default behavior is to set it to true. This will ensure
+ // that VM Agent is installed on the VM so that extensions can be added to the VM later.
+ ProvisionVMAgent *bool
+
+ // Specifies the ssh key configuration for a Linux OS.
+ SSH *SSHConfiguration
+}
+
+// LinuxParameters - Input for InstallPatches on a Linux VM, as directly received by the API
+type LinuxParameters struct {
+ // The update classifications to select when installing patches for Linux.
+ ClassificationsToInclude []*VMGuestPatchClassificationLinux
+
+ // This is used as a maintenance run identifier for Auto VM Guest Patching in Linux.
+ MaintenanceRunID *string
+
+ // packages to exclude in the patch operation. Format: packageName_packageVersion
+ PackageNameMasksToExclude []*string
+
+ // packages to include in the patch operation. Format: packageName_packageVersion
+ PackageNameMasksToInclude []*string
+}
+
+// LinuxPatchSettings - Specifies settings related to VM Guest Patching on Linux.
+type LinuxPatchSettings struct {
+ // Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.
+ // Possible values are:
+ // ImageDefault - You control the timing of patch assessments on a virtual machine.
+ // AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true.
+ AssessmentMode *LinuxPatchAssessmentMode
+
+ // Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux.
+ AutomaticByPlatformSettings *LinuxVMGuestPatchAutomaticByPlatformSettings
+
+ // Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale
+ // set with OrchestrationMode as Flexible.
+ // Possible values are:
+ // ImageDefault - The virtual machine's default patching configuration is used.
+ // AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent
+ // must be true
+ PatchMode *LinuxVMGuestPatchMode
+}
+
+// LinuxVMGuestPatchAutomaticByPlatformSettings - Specifies additional settings to be applied when patch mode AutomaticByPlatform
+// is selected in Linux patch settings.
+type LinuxVMGuestPatchAutomaticByPlatformSettings struct {
+ // Enables customer to schedule patching without accidental upgrades
+ BypassPlatformSafetyChecksOnUserSchedule *bool
+
+ // Specifies the reboot setting for all AutomaticByPlatform patch installation operations.
+ RebootSetting *LinuxVMGuestPatchAutomaticByPlatformRebootSetting
+}
+
+// ListUsagesResult - The List Usages operation response.
+type ListUsagesResult struct {
+ // REQUIRED; The list of compute resource usages.
+ Value []*Usage
+
+ // The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page
+ // of compute resource usage information.
+ NextLink *string
+}
+
+// LoadBalancerConfiguration - Describes the load balancer configuration.
+type LoadBalancerConfiguration struct {
+ // REQUIRED; The name of the Load balancer
+ Name *string
+
+ // REQUIRED; Properties of the load balancer configuration.
+ Properties *LoadBalancerConfigurationProperties
+
+ // Resource Id
+ ID *string
+}
+
+// LoadBalancerConfigurationProperties - Describes the properties of the load balancer configuration.
+type LoadBalancerConfigurationProperties struct {
+ // REQUIRED; Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each
+ // load balancer configuration must have exactly one frontend IP configuration.
+ FrontendIPConfigurations []*LoadBalancerFrontendIPConfiguration
+}
+
+// LoadBalancerFrontendIPConfiguration - Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP
+// address is supported. Each load balancer configuration must have exactly one frontend IP configuration.
+type LoadBalancerFrontendIPConfiguration struct {
+ // REQUIRED; The name of the resource that is unique within the set of frontend IP configurations used by the load balancer.
+ // This name can be used to access the resource.
+ Name *string
+
+ // REQUIRED; Properties of load balancer frontend ip configuration.
+ Properties *LoadBalancerFrontendIPConfigurationProperties
+}
+
+// LoadBalancerFrontendIPConfigurationProperties - Describes a cloud service IP Configuration
+type LoadBalancerFrontendIPConfigurationProperties struct {
+ // The virtual network private IP address of the IP configuration.
+ PrivateIPAddress *string
+
+ // The reference to the public ip address resource.
+ PublicIPAddress *SubResource
+
+ // The reference to the virtual network subnet resource.
+ Subnet *SubResource
+}
+
+// LogAnalyticsInputBase - Api input base class for LogAnalytics Api.
+type LogAnalyticsInputBase struct {
+ // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to.
+ BlobContainerSasURI *string
+
+ // REQUIRED; From time of the query
+ FromTime *time.Time
+
+ // REQUIRED; To time of the query
+ ToTime *time.Time
+
+ // Group query result by Client Application ID.
+ GroupByClientApplicationID *bool
+
+ // Group query result by Operation Name.
+ GroupByOperationName *bool
+
+ // Group query result by Resource Name.
+ GroupByResourceName *bool
+
+ // Group query result by Throttle Policy applied.
+ GroupByThrottlePolicy *bool
+
+ // Group query result by User Agent.
+ GroupByUserAgent *bool
+}
+
+// LogAnalyticsOperationResult - LogAnalytics operation status response
+type LogAnalyticsOperationResult struct {
+ // READ-ONLY; LogAnalyticsOutput
+ Properties *LogAnalyticsOutput
+}
+
+// LogAnalyticsOutput - LogAnalytics output properties
+type LogAnalyticsOutput struct {
+ // READ-ONLY; Output file Uri path to blob container.
+ Output *string
+}
+
+// MaintenanceRedeployStatus - Maintenance Operation Status.
+type MaintenanceRedeployStatus struct {
+ // True, if customer is allowed to perform Maintenance.
+ IsCustomerInitiatedMaintenanceAllowed *bool
+
+ // Message returned for the last Maintenance Operation.
+ LastOperationMessage *string
+
+ // The Last Maintenance Operation Result Code.
+ LastOperationResultCode *MaintenanceOperationResultCodeTypes
+
+ // End Time for the Maintenance Window.
+ MaintenanceWindowEndTime *time.Time
+
+ // Start Time for the Maintenance Window.
+ MaintenanceWindowStartTime *time.Time
+
+ // End Time for the Pre Maintenance Window.
+ PreMaintenanceWindowEndTime *time.Time
+
+ // Start Time for the Pre Maintenance Window.
+ PreMaintenanceWindowStartTime *time.Time
+}
+
+// ManagedArtifact - The managed artifact.
+type ManagedArtifact struct {
+ // REQUIRED; The managed artifact id.
+ ID *string
+}
+
+// ManagedDiskParameters - The parameters of a managed disk.
+type ManagedDiskParameters struct {
+ // Specifies the customer managed disk encryption set resource id for the managed disk.
+ DiskEncryptionSet *DiskEncryptionSetParameters
+
+ // Resource Id
+ ID *string
+
+ // Specifies the security profile for the managed disk.
+ SecurityProfile *VMDiskSecurityProfile
+
+ // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot
+ // be used with OS Disk.
+ StorageAccountType *StorageAccountTypes
+}
+
+// NetworkInterfaceReference - Describes a network interface reference.
+type NetworkInterfaceReference struct {
+ // Resource Id
+ ID *string
+
+ // Describes a network interface reference properties.
+ Properties *NetworkInterfaceReferenceProperties
+}
+
+// NetworkInterfaceReferenceProperties - Describes a network interface reference properties.
+type NetworkInterfaceReferenceProperties struct {
+ // Specify what happens to the network interface when the VM is deleted
+ DeleteOption *DeleteOptions
+
+ // Specifies the primary network interface in case the virtual machine has more than 1 network interface.
+ Primary *bool
+}
+
+// NetworkProfile - Specifies the network interfaces or the networking configuration of the virtual machine.
+type NetworkProfile struct {
+ // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations
+ NetworkAPIVersion *NetworkAPIVersion
+
+ // Specifies the networking configurations that will be used to create the virtual machine networking resources.
+ NetworkInterfaceConfigurations []*VirtualMachineNetworkInterfaceConfiguration
+
+ // Specifies the list of resource Ids for the network interfaces associated with the virtual machine.
+ NetworkInterfaces []*NetworkInterfaceReference
+}
+
+// OSDisk - Specifies information about the operating system disk used by the virtual machine. For more information about
+// disks, see About disks and VHDs for Azure virtual machines
+// [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview].
+type OSDisk struct {
+ // REQUIRED; Specifies how the virtual machine should be created. Possible values are: Attach. This value is used when you
+ // are using a specialized disk to create the virtual machine. FromImage. This value is used
+ // when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference
+ // element described above. If you are using a marketplace image, you
+ // should also use the plan element previously described.
+ CreateOption *DiskCreateOptionTypes
+
+ // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The defaulting behavior is: None for
+ // Standard storage. ReadOnly for Premium storage.
+ Caching *CachingTypes
+
+ // Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: Delete. If this value is
+ // used, the OS disk is deleted when VM is deleted. Detach. If this value is used,
+ // the os disk is retained after VM is deleted. The default value is set to Detach. For an ephemeral OS Disk, the default
+ // value is set to Delete. The user cannot change the delete option for an ephemeral
+ // OS Disk.
+ DeleteOption *DiskDeleteOptionTypes
+
+ // Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
+ DiffDiskSettings *DiffDiskSettings
+
+ // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a
+ // virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3
+ // for the disk and the value cannot be larger than 1023.
+ DiskSizeGB *int32
+
+ // Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15.
+ EncryptionSettings *DiskEncryptionSettings
+
+ // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine.
+ // If SourceImage is provided, the destination virtual hard drive must not
+ // exist.
+ Image *VirtualHardDisk
+
+ // The managed disk parameters.
+ ManagedDisk *ManagedDiskParameters
+
+ // The disk name.
+ Name *string
+
+ // This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or
+ // a specialized VHD. Possible values are: Windows, Linux.
+ OSType *OperatingSystemTypes
+
+ // The virtual hard disk.
+ Vhd *VirtualHardDisk
+
+ // Specifies whether writeAccelerator should be enabled or disabled on the disk.
+ WriteAcceleratorEnabled *bool
+}
+
+// OSDiskImage - Contains the os disk image information.
+type OSDiskImage struct {
+ // REQUIRED; The operating system of the osDiskImage.
+ OperatingSystem *OperatingSystemTypes
+}
+
+// OSDiskImageEncryption - Contains encryption settings for an OS disk image.
+type OSDiskImageEncryption struct {
+ // A relative URI containing the resource ID of the disk encryption set.
+ DiskEncryptionSetID *string
+
+ // This property specifies the security profile of an OS disk image.
+ SecurityProfile *OSDiskImageSecurityProfile
+}
+
+// OSDiskImageSecurityProfile - Contains security profile for an OS disk image.
+type OSDiskImageSecurityProfile struct {
+ // confidential VM encryption types
+ ConfidentialVMEncryptionType *ConfidentialVMEncryptionType
+
+ // secure VM disk encryption set id
+ SecureVMDiskEncryptionSetID *string
+}
+
+// OSFamily - Describes a cloud service OS family.
+type OSFamily struct {
+ // OS family properties.
+ Properties *OSFamilyProperties
+
+ // READ-ONLY; Resource Id.
+ ID *string
+
+ // READ-ONLY; Resource location.
+ Location *string
+
+ // READ-ONLY; Resource name.
+ Name *string
+
+ // READ-ONLY; Resource type.
+ Type *string
+}
+
+// OSFamilyListResult - The list operation result.
+type OSFamilyListResult struct {
+ // REQUIRED; The list of resources.
+ Value []*OSFamily
+
+ // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null
+ // to fetch all the resources.
+ NextLink *string
+}
+
+// OSFamilyProperties - OS family properties.
+type OSFamilyProperties struct {
+ // READ-ONLY; The OS family label.
+ Label *string
+
+ // READ-ONLY; The OS family name.
+ Name *string
+
+ // READ-ONLY; List of OS versions belonging to this family.
+ Versions []*OSVersionPropertiesBase
+}
+
+type OSImageNotificationProfile struct {
+ // Specifies whether the OS Image Scheduled event is enabled or disabled.
+ Enable *bool
+
+ // Length of time a Virtual Machine being reimaged or having its OS upgraded will have to potentially approve the OS Image
+ // Scheduled Event before the event is auto approved (timed out). The configuration
+ // is specified in ISO 8601 format, and the value must be 15 minutes (PT15M)
+ NotBeforeTimeout *string
+}
+
+// OSProfile - Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once
+// VM is provisioned.
+type OSProfile struct {
+ // Specifies the password of the administrator account.
+ // Minimum-length (Windows): 8 characters
+ // Minimum-length (Linux): 6 characters
+ // Max-length (Windows): 123 characters
+ // Max-length (Linux): 72 characters
+ // Complexity requirements: 3 out of 4 conditions below need to be fulfilled
+ // Has lower characters
+ // Has upper characters
+ // Has a digit
+ // Has a special character (Regex match [\W_])
+ // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1",
+ // "Password22", "iloveyou!"
+ // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp]
+ // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension
+ // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection]
+ AdminPassword *string
+
+ // Specifies the name of the administrator account.
+ // This property cannot be updated after the VM is created.
+ // Windows-only restriction: Cannot end in "."
+ // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123",
+ // "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest",
+ // "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".
+ // Minimum-length (Linux): 1 character
+ // Max-length (Linux): 64 characters
+ // Max-length (Windows): 20 characters.
+ AdminUsername *string
+
+ // Specifies whether extension operations should be allowed on the virtual machine. This may only be set to False when no
+ // extensions are present on the virtual machine.
+ AllowExtensionOperations *bool
+
+ // Specifies the host OS name of the virtual machine. This name cannot be updated after the VM is created. Max-length (Windows):
+ // 15 characters. Max-length (Linux): 64 characters. For naming conventions
+ // and restrictions see Azure infrastructure services implementation guidelines [https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules].
+ ComputerName *string
+
+ // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved
+ // as a file on the Virtual Machine. The maximum length of the binary array is
+ // 65535 bytes. Note: Do not pass any secrets or passwords in customData property. This property cannot be updated after the
+ // VM is created. The property 'customData' is passed to the VM to be saved as a
+ // file, for more information see Custom Data on Azure VMs [https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/].
+ // For using cloud-init for your Linux VM, see Using cloud-init to
+ // customize a Linux VM during creation [https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init].
+ CustomData *string
+
+ // Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see
+ // Linux on Azure-Endorsed Distributions
+ // [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros].
+ LinuxConfiguration *LinuxConfiguration
+
+ // Optional property which must either be set to True or omitted.
+ RequireGuestProvisionSignal *bool
+
+ // Specifies set of certificates that should be installed onto the virtual machine. To install certificates on a virtual machine
+ // it is recommended to use the Azure Key Vault virtual machine extension for
+ // Linux [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine
+ // extension for Windows
+ // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows].
+ Secrets []*VaultSecretGroup
+
+ // Specifies Windows operating system settings on the virtual machine.
+ WindowsConfiguration *WindowsConfiguration
+}
+
+// OSProfileProvisioningData - Additional parameters for Reimaging Non-Ephemeral Virtual Machine.
+type OSProfileProvisioningData struct {
+ // Specifies the password of the administrator account.
+ // Minimum-length (Windows): 8 characters
+ // Minimum-length (Linux): 6 characters
+ // Max-length (Windows): 123 characters
+ // Max-length (Linux): 72 characters
+ // Complexity requirements: 3 out of 4 conditions below need to be fulfilled
+ // Has lower characters
+ // Has upper characters
+ // Has a digit
+ // Has a special character (Regex match [\W_])
+ // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1",
+ // "Password22", "iloveyou!"
+ // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp]
+ // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension
+ // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection]
+ AdminPassword *string
+
+ // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved
+ // as a file on the Virtual Machine. The maximum length of the binary array is
+ // 65535 bytes. Note: Do not pass any secrets or passwords in customData property. This property cannot be updated after the
+ // VM is created. The property customData is passed to the VM to be saved as a
+ // file, for more information see Custom Data on Azure VMs [https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/].
+ // If using cloud-init for your Linux VM, see Using cloud-init to
+ // customize a Linux VM during creation [https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init].
+ CustomData *string
+}
+
+// OSVersion - Describes a cloud service OS version.
+type OSVersion struct {
+ // OS version properties.
+ Properties *OSVersionProperties
+
+ // READ-ONLY; Resource Id.
+ ID *string
+
+ // READ-ONLY; Resource location.
+ Location *string
+
+ // READ-ONLY; Resource name.
+ Name *string
+
+ // READ-ONLY; Resource type.
+ Type *string
+}
+
+// OSVersionListResult - The list operation result.
+type OSVersionListResult struct {
+ // REQUIRED; The list of resources.
+ Value []*OSVersion
+
+ // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null
+ // to fetch all the resources.
+ NextLink *string
+}
+
+// OSVersionProperties - OS version properties.
+type OSVersionProperties struct {
+ // READ-ONLY; The family of this OS version.
+ Family *string
+
+ // READ-ONLY; The family label of this OS version.
+ FamilyLabel *string
+
+ // READ-ONLY; Specifies whether this OS version is active.
+ IsActive *bool
+
+ // READ-ONLY; Specifies whether this is the default OS version for its family.
+ IsDefault *bool
+
+ // READ-ONLY; The OS version label.
+ Label *string
+
+ // READ-ONLY; The OS version.
+ Version *string
+}
+
+// OSVersionPropertiesBase - Configuration view of an OS version.
+type OSVersionPropertiesBase struct {
+ // READ-ONLY; Specifies whether this OS version is active.
+ IsActive *bool
+
+ // READ-ONLY; Specifies whether this is the default OS version for its family.
+ IsDefault *bool
+
+ // READ-ONLY; The OS version label.
+ Label *string
+
+ // READ-ONLY; The OS version.
+ Version *string
+}
+
+// OperationListResult - The List Compute Operation operation response.
+type OperationListResult struct {
+ // READ-ONLY; The list of compute operations
+ Value []*OperationValue
+}
+
+// OperationValue - Describes the properties of a Compute Operation value.
+type OperationValue struct {
+ // Describes the properties of a Compute Operation Value Display.
+ Display *OperationValueDisplay
+
+ // READ-ONLY; The name of the compute operation.
+ Name *string
+
+ // READ-ONLY; The origin of the compute operation.
+ Origin *string
+}
+
+// OperationValueDisplay - Describes the properties of a Compute Operation Value Display.
+type OperationValueDisplay struct {
+ // READ-ONLY; The description of the operation.
+ Description *string
+
+ // READ-ONLY; The display name of the compute operation.
+ Operation *string
+
+ // READ-ONLY; The resource provider for the operation.
+ Provider *string
+
+ // READ-ONLY; The display name of the resource the operation applies to.
+ Resource *string
+}
+
+// OrchestrationServiceStateInput - The input for OrchestrationServiceState
+type OrchestrationServiceStateInput struct {
+ // REQUIRED; The action to be performed.
+ Action *OrchestrationServiceStateAction
+
+ // REQUIRED; The name of the service.
+ ServiceName *OrchestrationServiceNames
+}
+
+// OrchestrationServiceSummary - Summary for an orchestration service of a virtual machine scale set.
+type OrchestrationServiceSummary struct {
+ // READ-ONLY; The name of the service.
+ ServiceName *OrchestrationServiceNames
+
+ // READ-ONLY; The current state of the service.
+ ServiceState *OrchestrationServiceState
+}
+
+// PatchInstallationDetail - Information about a specific patch that was encountered during an installation action.
+type PatchInstallationDetail struct {
+ // READ-ONLY; The classification(s) of the patch as provided by the patch publisher.
+ Classifications []*string
+
+ // READ-ONLY; The state of the patch after the installation operation completed.
+ InstallationState *PatchInstallationState
+
+ // READ-ONLY; The KBID of the patch. Only applies to Windows patches.
+ KbID *string
+
+ // READ-ONLY; The friendly name of the patch.
+ Name *string
+
+ // READ-ONLY; A unique identifier for the patch.
+ PatchID *string
+
+ // READ-ONLY; The version string of the package. It may conform to Semantic Versioning. Only applies to Linux.
+ Version *string
+}
+
+// PatchSettings - Specifies settings related to VM Guest Patching on Windows.
+type PatchSettings struct {
+ // Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.
+ // Possible values are:
+ // ImageDefault - You control the timing of patch assessments on a virtual machine.
+ // AutomaticByPlatform - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true.
+ AssessmentMode *WindowsPatchAssessmentMode
+
+ // Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows.
+ AutomaticByPlatformSettings *WindowsVMGuestPatchAutomaticByPlatformSettings
+
+ // Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must
+ // be set to true and 'patchMode' must be set to 'AutomaticByPlatform'.
+ EnableHotpatching *bool
+
+ // Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale
+ // set with OrchestrationMode as Flexible.
+ // Possible values are:
+ // Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the
+ // VM. In this mode, automatic updates are disabled; the property
+ // WindowsConfiguration.enableAutomaticUpdates must be false
+ // AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates
+ // must be true.
+ // AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and
+ // WindowsConfiguration.enableAutomaticUpdates must be true
+ PatchMode *WindowsVMGuestPatchMode
+}
+
+// PirCommunityGalleryResource - Base information about the community gallery resource in pir.
+type PirCommunityGalleryResource struct {
+ // The identifier information of community gallery.
+ Identifier *CommunityGalleryIdentifier
+
+ // READ-ONLY; Resource location
+ Location *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// PirResource - The Resource model definition.
+type PirResource struct {
+ // READ-ONLY; Resource location
+ Location *string
+
+ // READ-ONLY; Resource name
+ Name *string
+}
+
+// PirSharedGalleryResource - Base information about the shared gallery resource in pir.
+type PirSharedGalleryResource struct {
+ // The identifier information of shared gallery.
+ Identifier *SharedGalleryIdentifier
+
+ // READ-ONLY; Resource location
+ Location *string
+
+ // READ-ONLY; Resource name
+ Name *string
+}
+
+// Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used
+// for marketplace images. Before you can use a marketplace image from an API, you must
+// enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click
+// Want to deploy programmatically, Get Started ->. Enter any required
+// information and then click Save.
+type Plan struct {
+ // The plan ID.
+ Name *string
+
+ // Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element.
+ Product *string
+
+ // The promotion code.
+ PromotionCode *string
+
+ // The publisher ID.
+ Publisher *string
+}
+
+// PolicyViolation - A policy violation reported against a gallery artifact.
+type PolicyViolation struct {
+ // Describes the nature of the policy violation.
+ Category *PolicyViolationCategory
+
+ // Describes specific details about why this policy violation was reported.
+ Details *string
+}
+
+// PriorityMixPolicy - Specifies the target splits for Spot and Regular priority VMs within a scale set with flexible orchestration
+// mode. With this property the customer is able to specify the base number of regular
+// priority VMs created as the VMSS flex instance scales out and the split between Spot and Regular priority VMs after this
+// base target has been reached.
+type PriorityMixPolicy struct {
+ // The base number of regular priority VMs that will be created in this scale set as it scales out.
+ BaseRegularPriorityCount *int32
+
+ // The percentage of VM instances, after the base regular priority count has been reached, that are expected to use regular
+ // priority.
+ RegularPriorityPercentageAboveBase *int32
+}
+
+// PrivateEndpoint - The Private Endpoint resource.
+type PrivateEndpoint struct {
+ // READ-ONLY; The ARM identifier for Private Endpoint
+ ID *string
+}
+
+// PrivateEndpointConnection - The Private Endpoint Connection resource.
+type PrivateEndpointConnection struct {
+ // Resource properties.
+ Properties *PrivateEndpointConnectionProperties
+
+ // READ-ONLY; private endpoint connection Id
+ ID *string
+
+ // READ-ONLY; private endpoint connection name
+ Name *string
+
+ // READ-ONLY; private endpoint connection type
+ Type *string
+}
+
+// PrivateEndpointConnectionListResult - A list of private link resources
+type PrivateEndpointConnectionListResult struct {
+ // The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots.
+ NextLink *string
+
+ // Array of private endpoint connections
+ Value []*PrivateEndpointConnection
+}
+
+// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties.
+type PrivateEndpointConnectionProperties struct {
+ // REQUIRED; A collection of information about the state of the connection between DiskAccess and Virtual Network.
+ PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState
+
+ // READ-ONLY; The resource of private end point.
+ PrivateEndpoint *PrivateEndpoint
+
+ // READ-ONLY; The provisioning state of the private endpoint connection resource.
+ ProvisioningState *PrivateEndpointConnectionProvisioningState
+}
+
+// PrivateLinkResource - A private link resource
+type PrivateLinkResource struct {
+ // Resource properties.
+ Properties *PrivateLinkResourceProperties
+
+ // READ-ONLY; private link resource Id
+ ID *string
+
+ // READ-ONLY; private link resource name
+ Name *string
+
+ // READ-ONLY; private link resource type
+ Type *string
+}
+
+// PrivateLinkResourceListResult - A list of private link resources
+type PrivateLinkResourceListResult struct {
+ // Array of private link resources
+ Value []*PrivateLinkResource
+}
+
+// PrivateLinkResourceProperties - Properties of a private link resource.
+type PrivateLinkResourceProperties struct {
+ // The private link resource DNS zone name.
+ RequiredZoneNames []*string
+
+ // READ-ONLY; The private link resource group id.
+ GroupID *string
+
+ // READ-ONLY; The private link resource required member names.
+ RequiredMembers []*string
+}
+
+// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer
+// and provider.
+type PrivateLinkServiceConnectionState struct {
+ // A message indicating if changes on the service provider require any updates on the consumer.
+ ActionsRequired *string
+
+ // The reason for approval/rejection of the connection.
+ Description *string
+
+ // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.
+ Status *PrivateEndpointServiceConnectionStatus
+}
+
+// PropertyUpdatesInProgress - Properties of the disk for which update is pending.
+type PropertyUpdatesInProgress struct {
+ // The target performance tier of the disk if a tier change operation is in progress.
+ TargetTier *string
+}
+
+// ProximityPlacementGroup - Specifies information about the proximity placement group.
+type ProximityPlacementGroup struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // Describes the properties of a Proximity Placement Group.
+ Properties *ProximityPlacementGroupProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // Specifies the Availability Zone where virtual machine, virtual machine scale set or availability set associated with the
+ // proximity placement group can be created.
+ Zones []*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// ProximityPlacementGroupListResult - The List Proximity Placement Group operation response.
+type ProximityPlacementGroupListResult struct {
+ // REQUIRED; The list of proximity placement groups
+ Value []*ProximityPlacementGroup
+
+ // The URI to fetch the next page of proximity placement groups.
+ NextLink *string
+}
+
+// ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group.
+type ProximityPlacementGroupProperties struct {
+ // Describes colocation status of the Proximity Placement Group.
+ ColocationStatus *InstanceViewStatus
+
+ // Specifies the user intent of the proximity placement group.
+ Intent *ProximityPlacementGroupPropertiesIntent
+
+ // Specifies the type of the proximity placement group. Possible values are: Standard : Co-locate resources within an Azure
+ // region or Availability Zone. Ultra : For future use.
+ ProximityPlacementGroupType *ProximityPlacementGroupType
+
+ // READ-ONLY; A list of references to all availability sets in the proximity placement group.
+ AvailabilitySets []*SubResourceWithColocationStatus
+
+ // READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group.
+ VirtualMachineScaleSets []*SubResourceWithColocationStatus
+
+ // READ-ONLY; A list of references to all virtual machines in the proximity placement group.
+ VirtualMachines []*SubResourceWithColocationStatus
+}
+
+// ProximityPlacementGroupPropertiesIntent - Specifies the user intent of the proximity placement group.
+type ProximityPlacementGroupPropertiesIntent struct {
+ // Specifies possible sizes of virtual machines that can be created in the proximity placement group.
+ VMSizes []*string
+}
+
+// ProximityPlacementGroupUpdate - Specifies information about the proximity placement group.
+type ProximityPlacementGroupUpdate struct {
+ // Resource tags
+ Tags map[string]*string
+}
+
+// ProxyOnlyResource - The ProxyOnly Resource model definition.
+type ProxyOnlyResource struct {
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// ProxyResource - The resource model definition for an Azure Resource Manager proxy resource. It will not have tags and a
+// location
+type ProxyResource struct {
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// PublicIPAddressSKU - Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible.
+type PublicIPAddressSKU struct {
+ // Specify public IP sku name
+ Name *PublicIPAddressSKUName
+
+ // Specify public IP sku tier
+ Tier *PublicIPAddressSKUTier
+}
+
+// PurchasePlan - Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
+type PurchasePlan struct {
+ // REQUIRED; The plan ID.
+ Name *string
+
+ // REQUIRED; Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference
+ // element.
+ Product *string
+
+ // REQUIRED; The publisher ID.
+ Publisher *string
+}
+
+// RecommendedMachineConfiguration - The properties describe the recommended machine configuration for this Image Definition.
+// These properties are updatable.
+type RecommendedMachineConfiguration struct {
+ // Describes the resource range.
+ Memory *ResourceRange
+
+ // Describes the resource range.
+ VCPUs *ResourceRange
+}
+
+// RecoveryWalkResponse - Response after calling a manual recovery walk
+type RecoveryWalkResponse struct {
+ // READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed
+ NextPlatformUpdateDomain *int32
+
+ // READ-ONLY; Whether the recovery walk was performed
+ WalkPerformed *bool
+}
+
+// RegionalReplicationStatus - This is the regional replication status.
+type RegionalReplicationStatus struct {
+ // READ-ONLY; The details of the replication status.
+ Details *string
+
+ // READ-ONLY; It indicates progress of the replication job.
+ Progress *int32
+
+ // READ-ONLY; The region to which the gallery image version is being replicated to.
+ Region *string
+
+ // READ-ONLY; This is the regional replication state.
+ State *ReplicationState
+}
+
+// RegionalSharingStatus - Gallery regional sharing status
+type RegionalSharingStatus struct {
+ // Details of gallery regional sharing failure.
+ Details *string
+
+ // Region name
+ Region *string
+
+ // READ-ONLY; Gallery sharing state in current region
+ State *SharingState
+}
+
+// ReplicationStatus - This is the replication status of the gallery image version.
+type ReplicationStatus struct {
+ // READ-ONLY; This is the aggregated replication status based on all the regional replication status flags.
+ AggregatedState *AggregatedReplicationState
+
+ // READ-ONLY; This is a summary of replication status for each region.
+ Summary []*RegionalReplicationStatus
+}
+
+// RequestRateByIntervalInput - Api request input for LogAnalytics getRequestRateByInterval Api.
+type RequestRateByIntervalInput struct {
+ // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to.
+ BlobContainerSasURI *string
+
+ // REQUIRED; From time of the query
+ FromTime *time.Time
+
+ // REQUIRED; Interval value in minutes used to create LogAnalytics call rate logs.
+ IntervalLength *IntervalInMins
+
+ // REQUIRED; To time of the query
+ ToTime *time.Time
+
+ // Group query result by Client Application ID.
+ GroupByClientApplicationID *bool
+
+ // Group query result by Operation Name.
+ GroupByOperationName *bool
+
+ // Group query result by Resource Name.
+ GroupByResourceName *bool
+
+ // Group query result by Throttle Policy applied.
+ GroupByThrottlePolicy *bool
+
+ // Group query result by User Agent.
+ GroupByUserAgent *bool
+}
+
+// Resource - The Resource model definition.
+type Resource struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// ResourceInstanceViewStatus - Instance view status.
+type ResourceInstanceViewStatus struct {
+ // The level code.
+ Level *StatusLevelTypes
+
+ // READ-ONLY; The status code.
+ Code *string
+
+ // READ-ONLY; The short localizable label for the status.
+ DisplayStatus *string
+
+ // READ-ONLY; The detailed status message, including for alerts and error messages.
+ Message *string
+
+ // READ-ONLY; The time of the status.
+ Time *time.Time
+}
+
+// ResourceRange - Describes the resource range.
+type ResourceRange struct {
+ // The maximum number of the resource.
+ Max *int32
+
+ // The minimum number of the resource.
+ Min *int32
+}
+
+// ResourceSKU - Describes an available Compute SKU.
+type ResourceSKU struct {
+ // READ-ONLY; The api versions that support this SKU.
+ APIVersions []*string
+
+ // READ-ONLY; A name value pair to describe the capability.
+ Capabilities []*ResourceSKUCapabilities
+
+ // READ-ONLY; Specifies the number of virtual machines in the scale set.
+ Capacity *ResourceSKUCapacity
+
+ // READ-ONLY; Metadata for retrieving price info.
+ Costs []*ResourceSKUCosts
+
+ // READ-ONLY; The Family of this particular SKU.
+ Family *string
+
+ // READ-ONLY; The Kind of resources that are supported in this SKU.
+ Kind *string
+
+ // READ-ONLY; A list of locations and availability zones in those locations where the SKU is available.
+ LocationInfo []*ResourceSKULocationInfo
+
+ // READ-ONLY; The set of locations that the SKU is available.
+ Locations []*string
+
+ // READ-ONLY; The name of SKU.
+ Name *string
+
+ // READ-ONLY; The type of resource the SKU applies to.
+ ResourceType *string
+
+ // READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.
+ Restrictions []*ResourceSKURestrictions
+
+ // READ-ONLY; The Size of the SKU.
+ Size *string
+
+ // READ-ONLY; Specifies the tier of virtual machines in a scale set.
+ // Possible Values:
+ // Standard
+ // Basic
+ Tier *string
+}
+
+// ResourceSKUCapabilities - Describes The SKU capabilities object.
+type ResourceSKUCapabilities struct {
+ // READ-ONLY; An invariant to describe the feature.
+ Name *string
+
+ // READ-ONLY; An invariant if the feature is measured by quantity.
+ Value *string
+}
+
+// ResourceSKUCapacity - Describes scaling information of a SKU.
+type ResourceSKUCapacity struct {
+ // READ-ONLY; The default capacity.
+ Default *int64
+
+ // READ-ONLY; The maximum capacity that can be set.
+ Maximum *int64
+
+ // READ-ONLY; The minimum capacity.
+ Minimum *int64
+
+ // READ-ONLY; The scale type applicable to the sku.
+ ScaleType *ResourceSKUCapacityScaleType
+}
+
+// ResourceSKUCosts - Describes metadata for retrieving price info.
+type ResourceSKUCosts struct {
+ // READ-ONLY; An invariant to show the extended unit.
+ ExtendedUnit *string
+
+ // READ-ONLY; Used for querying price from commerce.
+ MeterID *string
+
+ // READ-ONLY; The multiplier is needed to extend the base metered cost.
+ Quantity *int64
+}
+
+// ResourceSKULocationInfo - Describes an available Compute SKU Location Information.
+type ResourceSKULocationInfo struct {
+ // READ-ONLY; The names of extended locations.
+ ExtendedLocations []*string
+
+ // READ-ONLY; Location of the SKU
+ Location *string
+
+ // READ-ONLY; The type of the extended location.
+ Type *ExtendedLocationType
+
+ // READ-ONLY; Details of capabilities available to a SKU in specific zones.
+ ZoneDetails []*ResourceSKUZoneDetails
+
+ // READ-ONLY; List of availability zones where the SKU is supported.
+ Zones []*string
+}
+
+// ResourceSKURestrictionInfo - Describes an available Compute SKU Restriction Information.
+type ResourceSKURestrictionInfo struct {
+ // READ-ONLY; Locations where the SKU is restricted
+ Locations []*string
+
+ // READ-ONLY; List of availability zones where the SKU is restricted.
+ Zones []*string
+}
+
+// ResourceSKURestrictions - Describes scaling information of a SKU.
+type ResourceSKURestrictions struct {
+ // READ-ONLY; The reason for restriction.
+ ReasonCode *ResourceSKURestrictionsReasonCode
+
+ // READ-ONLY; The information about the restriction where the SKU cannot be used.
+ RestrictionInfo *ResourceSKURestrictionInfo
+
+ // READ-ONLY; The type of restrictions.
+ Type *ResourceSKURestrictionsType
+
+ // READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where
+ // the SKU is restricted.
+ Values []*string
+}
+
+// ResourceSKUZoneDetails - Describes The zonal capabilities of a SKU.
+type ResourceSKUZoneDetails struct {
+ // READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones.
+ Capabilities []*ResourceSKUCapabilities
+
+ // READ-ONLY; The set of zones that the SKU is available in with the specified capabilities.
+ Name []*string
+}
+
+// ResourceSKUsResult - The List Resource Skus operation response.
+type ResourceSKUsResult struct {
+ // REQUIRED; The list of skus available for the subscription.
+ Value []*ResourceSKU
+
+ // The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus
+ NextLink *string
+}
+
+// ResourceURIList - The List resources which are encrypted with the disk encryption set.
+type ResourceURIList struct {
+ // REQUIRED; A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set.
+ Value []*string
+
+ // The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources.
+ NextLink *string
+}
+
+// ResourceWithOptionalLocation - The Resource model definition with location property as optional.
+type ResourceWithOptionalLocation struct {
+ // Resource location
+ Location *string
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// RestorePoint - Restore Point details.
+type RestorePoint struct {
+ // The restore point properties.
+ Properties *RestorePointProperties
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// RestorePointCollection - Create or update Restore Point collection parameters.
+type RestorePointCollection struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // The restore point collection properties.
+ Properties *RestorePointCollectionProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// RestorePointCollectionListResult - The List restore point collection operation response.
+type RestorePointCollectionListResult struct {
+ // The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections
+ NextLink *string
+
+ // Gets the list of restore point collections.
+ Value []*RestorePointCollection
+}
+
+// RestorePointCollectionProperties - The restore point collection properties.
+type RestorePointCollectionProperties struct {
+ // The properties of the source resource that this restore point collection is created from.
+ Source *RestorePointCollectionSourceProperties
+
+ // READ-ONLY; The provisioning state of the restore point collection.
+ ProvisioningState *string
+
+ // READ-ONLY; The unique id of the restore point collection.
+ RestorePointCollectionID *string
+
+ // READ-ONLY; A list containing all restore points created under this restore point collection.
+ RestorePoints []*RestorePoint
+}
+
+// RestorePointCollectionSourceProperties - The properties of the source resource that this restore point collection is created
+// from.
+type RestorePointCollectionSourceProperties struct {
+ // Resource Id of the source resource used to create this restore point collection
+ ID *string
+
+ // READ-ONLY; Location of the source resource used to create this restore point collection.
+ Location *string
+}
+
+// RestorePointCollectionUpdate - Update Restore Point collection parameters.
+type RestorePointCollectionUpdate struct {
+ // The restore point collection properties.
+ Properties *RestorePointCollectionProperties
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// RestorePointEncryption - Encryption at rest settings for disk restore point. It is an optional property that can be specified
+// in the input while creating a restore point.
+type RestorePointEncryption struct {
+ // Describes the parameter of customer managed disk encryption set resource id that can be specified for disk. Note: The disk
+ // encryption set resource id can only be specified for managed disk. Please
+ // refer https://aka.ms/mdssewithcmkoverview for more details.
+ DiskEncryptionSet *DiskEncryptionSetParameters
+
+ // The type of key used to encrypt the data of the disk restore point.
+ Type *RestorePointEncryptionType
+}
+
+// RestorePointInstanceView - The instance view of a restore point.
+type RestorePointInstanceView struct {
+ // The disk restore points information.
+ DiskRestorePoints []*DiskRestorePointInstanceView
+
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+}
+
+// RestorePointProperties - The restore point properties.
+type RestorePointProperties struct {
+ // ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent
+ // is accepted as a valid input. Please refer to
+ // https://aka.ms/RestorePoints for more details.
+ ConsistencyMode *ConsistencyModeTypes
+
+ // List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, all disks
+ // will be included.
+ ExcludeDisks []*APIEntityReference
+
+ // Gets the details of the VM captured at the time of the restore point creation.
+ SourceMetadata *RestorePointSourceMetadata
+
+ // Resource Id of the source restore point from which a copy needs to be created.
+ SourceRestorePoint *APIEntityReference
+
+ // Gets the creation time of the restore point.
+ TimeCreated *time.Time
+
+ // READ-ONLY; The restore point instance view.
+ InstanceView *RestorePointInstanceView
+
+ // READ-ONLY; Gets the provisioning state of the restore point.
+ ProvisioningState *string
+}
+
+// RestorePointSourceMetadata - Describes the properties of the Virtual Machine for which the restore point was created. The
+// properties provided are a subset and the snapshot of the overall Virtual Machine properties captured at the
+// time of the restore point creation.
+type RestorePointSourceMetadata struct {
+ // Gets the storage profile.
+ StorageProfile *RestorePointSourceVMStorageProfile
+
+ // READ-ONLY; Gets the diagnostics profile.
+ DiagnosticsProfile *DiagnosticsProfile
+
+ // READ-ONLY; Gets the hardware profile.
+ HardwareProfile *HardwareProfile
+
+ // READ-ONLY; HyperVGeneration of the source VM for which restore point is captured.
+ HyperVGeneration *HyperVGenerationTypes
+
+ // READ-ONLY; Gets the license type, which is for bring your own license scenario.
+ LicenseType *string
+
+ // READ-ONLY; Location of the VM from which the restore point was created.
+ Location *string
+
+ // READ-ONLY; Gets the OS profile.
+ OSProfile *OSProfile
+
+ // READ-ONLY; Gets the security profile.
+ SecurityProfile *SecurityProfile
+
+ // READ-ONLY; UserData associated with the source VM for which restore point is captured, which is a base-64 encoded value.
+ UserData *string
+
+ // READ-ONLY; Gets the virtual machine unique id.
+ VMID *string
+}
+
+// RestorePointSourceVMDataDisk - Describes a data disk.
+type RestorePointSourceVMDataDisk struct {
+ // Contains Disk Restore Point properties.
+ DiskRestorePoint *DiskRestorePointAttributes
+
+ // Contains the managed disk details.
+ ManagedDisk *ManagedDiskParameters
+
+ // READ-ONLY; Gets the caching type.
+ Caching *CachingTypes
+
+ // READ-ONLY; Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks.
+ DiskSizeGB *int32
+
+ // READ-ONLY; Gets the logical unit number.
+ Lun *int32
+
+ // READ-ONLY; Gets the disk name.
+ Name *string
+
+ // READ-ONLY; Shows true if the disk is write-accelerator enabled.
+ WriteAcceleratorEnabled *bool
+}
+
+// RestorePointSourceVMOSDisk - Describes an Operating System disk.
+type RestorePointSourceVMOSDisk struct {
+ // Contains Disk Restore Point properties.
+ DiskRestorePoint *DiskRestorePointAttributes
+
+ // Gets the managed disk details
+ ManagedDisk *ManagedDiskParameters
+
+ // READ-ONLY; Gets the caching type.
+ Caching *CachingTypes
+
+ // READ-ONLY; Gets the disk size in GB.
+ DiskSizeGB *int32
+
+ // READ-ONLY; Gets the disk encryption settings.
+ EncryptionSettings *DiskEncryptionSettings
+
+ // READ-ONLY; Gets the disk name.
+ Name *string
+
+ // READ-ONLY; Gets the Operating System type.
+ OSType *OperatingSystemType
+
+ // READ-ONLY; Shows true if the disk is write-accelerator enabled.
+ WriteAcceleratorEnabled *bool
+}
+
+// RestorePointSourceVMStorageProfile - Describes the storage profile.
+type RestorePointSourceVMStorageProfile struct {
+ // Gets the data disks of the VM captured at the time of the restore point creation.
+ DataDisks []*RestorePointSourceVMDataDisk
+
+ // Gets the OS disk of the VM captured at the time of the restore point creation.
+ OSDisk *RestorePointSourceVMOSDisk
+}
+
+// RetrieveBootDiagnosticsDataResult - The SAS URIs of the console screenshot and serial log blobs.
+type RetrieveBootDiagnosticsDataResult struct {
+ // READ-ONLY; The console screenshot blob URI
+ ConsoleScreenshotBlobURI *string
+
+ // READ-ONLY; The serial console log blob URI.
+ SerialConsoleLogBlobURI *string
+}
+
+// RoleInstance - Describes the cloud service role instance.
+type RoleInstance struct {
+ // Role instance properties.
+ Properties *RoleInstanceProperties
+
+ // The role instance SKU.
+ SKU *InstanceSKU
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource Location.
+ Location *string
+
+ // READ-ONLY; Resource Name.
+ Name *string
+
+ // READ-ONLY; Resource tags.
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Type.
+ Type *string
+}
+
+// RoleInstanceListResult - The list operation result.
+type RoleInstanceListResult struct {
+ // REQUIRED; The list of resources.
+ Value []*RoleInstance
+
+ // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null
+ // to fetch all the resources.
+ NextLink *string
+}
+
+// RoleInstanceNetworkProfile - Describes the network profile for the role instance.
+type RoleInstanceNetworkProfile struct {
+ // READ-ONLY; Specifies the list of resource Ids for the network interfaces associated with the role instance.
+ NetworkInterfaces []*SubResource
+}
+
+// RoleInstanceProperties - Role instance properties.
+type RoleInstanceProperties struct {
+ // The instance view of the role instance.
+ InstanceView *RoleInstanceView
+
+ // Describes the network profile for the role instance.
+ NetworkProfile *RoleInstanceNetworkProfile
+}
+
+// RoleInstanceView - The instance view of the role instance.
+type RoleInstanceView struct {
+ // READ-ONLY; The Fault Domain.
+ PlatformFaultDomain *int32
+
+ // READ-ONLY; The Update Domain.
+ PlatformUpdateDomain *int32
+
+ // READ-ONLY; Specifies a unique identifier generated internally for the cloud service associated with this role instance.
+ // NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details.
+ PrivateID *string
+
+ // READ-ONLY
+ Statuses []*ResourceInstanceViewStatus
+}
+
+// RoleInstances - Specifies a list of role instances from the cloud service.
+type RoleInstances struct {
+ // REQUIRED; List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service.
+ RoleInstances []*string
+}
+
+// RollbackStatusInfo - Information about rollback on failed VM instances after a OS Upgrade operation.
+type RollbackStatusInfo struct {
+ // READ-ONLY; The number of instances which failed to rollback.
+ FailedRolledbackInstanceCount *int32
+
+ // READ-ONLY; Error details if OS rollback failed.
+ RollbackError *APIError
+
+ // READ-ONLY; The number of instances which have been successfully rolled back.
+ SuccessfullyRolledbackInstanceCount *int32
+}
+
+// RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade.
+type RollingUpgradePolicy struct {
+ // Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent
+ // to determine the batch size.
+ EnableCrossZoneUpgrade *bool
+
+ // The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one
+ // batch. As this is a maximum, unhealthy instances in previous or future batches
+ // can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter
+ // is 20%.
+ MaxBatchInstancePercent *int32
+
+ // Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual
+ // machines will be deleted once the new virtual machines are created for each
+ // batch.
+ MaxSurge *bool
+
+ // The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either
+ // as a result of being upgraded, or by being found in an unhealthy state by
+ // the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting
+ // any batch. The default value for this parameter is 20%.
+ MaxUnhealthyInstancePercent *int32
+
+ // The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check
+ // will happen after each batch is upgraded. If this percentage is ever exceeded,
+ // the rolling update aborts. The default value for this parameter is 20%.
+ MaxUnhealthyUpgradedInstancePercent *int32
+
+ // The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time
+ // duration should be specified in ISO 8601 format. The default value is 0 seconds
+ // (PT0S).
+ PauseTimeBetweenBatches *string
+
+ // Upgrade all unhealthy instances in a scale set before any healthy instances.
+ PrioritizeUnhealthyInstances *bool
+
+ // Rollback failed instances to previous model if the Rolling Upgrade policy is violated.
+ RollbackFailedInstancesOnPolicyBreach *bool
+}
+
+// RollingUpgradeProgressInfo - Information about the number of virtual machine instances in each upgrade state.
+type RollingUpgradeProgressInfo struct {
+ // READ-ONLY; The number of instances that have failed to be upgraded successfully.
+ FailedInstanceCount *int32
+
+ // READ-ONLY; The number of instances that are currently being upgraded.
+ InProgressInstanceCount *int32
+
+ // READ-ONLY; The number of instances that have not yet begun to be upgraded.
+ PendingInstanceCount *int32
+
+ // READ-ONLY; The number of instances that have been successfully upgraded.
+ SuccessfulInstanceCount *int32
+}
+
+// RollingUpgradeRunningStatus - Information about the current running state of the overall upgrade.
+type RollingUpgradeRunningStatus struct {
+ // READ-ONLY; Code indicating the current status of the upgrade.
+ Code *RollingUpgradeStatusCode
+
+ // READ-ONLY; The last action performed on the rolling upgrade.
+ LastAction *RollingUpgradeActionType
+
+ // READ-ONLY; Last action time of the upgrade.
+ LastActionTime *time.Time
+
+ // READ-ONLY; Start time of the upgrade.
+ StartTime *time.Time
+}
+
+// RollingUpgradeStatusInfo - The status of the latest virtual machine scale set rolling upgrade.
+type RollingUpgradeStatusInfo struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // The status of the latest virtual machine scale set rolling upgrade.
+ Properties *RollingUpgradeStatusInfoProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// RollingUpgradeStatusInfoProperties - The status of the latest virtual machine scale set rolling upgrade.
+type RollingUpgradeStatusInfoProperties struct {
+ // READ-ONLY; Error details for this upgrade, if there are any.
+ Error *APIError
+
+ // READ-ONLY; The rolling upgrade policies applied for this upgrade.
+ Policy *RollingUpgradePolicy
+
+ // READ-ONLY; Information about the number of virtual machine instances in each upgrade state.
+ Progress *RollingUpgradeProgressInfo
+
+ // READ-ONLY; Information about the current running state of the overall upgrade.
+ RunningStatus *RollingUpgradeRunningStatus
+}
+
+// RunCommandDocument - Describes the properties of a Run Command.
+type RunCommandDocument struct {
+ // REQUIRED; The VM run command description.
+ Description *string
+
+ // REQUIRED; The VM run command id.
+ ID *string
+
+ // REQUIRED; The VM run command label.
+ Label *string
+
+ // REQUIRED; The Operating System type.
+ OSType *OperatingSystemTypes
+
+ // REQUIRED; The VM run command schema.
+ Schema *string
+
+ // REQUIRED; The script to be executed.
+ Script []*string
+
+ // The parameters used by the script.
+ Parameters []*RunCommandParameterDefinition
+}
+
+// RunCommandDocumentBase - Describes the properties of a Run Command metadata.
+type RunCommandDocumentBase struct {
+ // REQUIRED; The VM run command description.
+ Description *string
+
+ // REQUIRED; The VM run command id.
+ ID *string
+
+ // REQUIRED; The VM run command label.
+ Label *string
+
+ // REQUIRED; The Operating System type.
+ OSType *OperatingSystemTypes
+
+ // REQUIRED; The VM run command schema.
+ Schema *string
+}
+
+// RunCommandInput - Capture Virtual Machine parameters.
+type RunCommandInput struct {
+ // REQUIRED; The run command id.
+ CommandID *string
+
+ // The run command parameters.
+ Parameters []*RunCommandInputParameter
+
+ // Optional. The script to be executed. When this value is given, the given script will override the default script of the
+ // command.
+ Script []*string
+}
+
+// RunCommandInputParameter - Describes the properties of a run command parameter.
+type RunCommandInputParameter struct {
+ // REQUIRED; The run command parameter name.
+ Name *string
+
+ // REQUIRED; The run command parameter value.
+ Value *string
+}
+
+// RunCommandListResult - The List Virtual Machine operation response.
+type RunCommandListResult struct {
+ // REQUIRED; The list of virtual machine run commands.
+ Value []*RunCommandDocumentBase
+
+ // The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands.
+ NextLink *string
+}
+
+// RunCommandManagedIdentity - Contains clientId or objectId (use only one, not both) of a user-assigned managed identity
+// that has access to storage blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of
+// system-assigned identity. Make sure the Azure storage blob exists in case of scriptUri, and managed identity has been given
+// access to blob's container with 'Storage Blob Data Reader' role assignment
+// with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, errorBlobUri). In case of user
+// assigned identity, make sure you add it under VM's identity. For more info on
+// managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged.
+type RunCommandManagedIdentity struct {
+ // Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided.
+ ClientID *string
+
+ // Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided.
+ ObjectID *string
+}
+
+// RunCommandParameterDefinition - Describes the properties of a run command parameter.
+type RunCommandParameterDefinition struct {
+ // REQUIRED; The run command parameter name.
+ Name *string
+
+ // REQUIRED; The run command parameter type.
+ Type *string
+
+ // The run command parameter default value.
+ DefaultValue *string
+
+ // The run command parameter required.
+ Required *bool
+}
+
+type RunCommandResult struct {
+ // Run command operation response.
+ Value []*InstanceViewStatus
+}
+
+// SKU - Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set
+// is currently on, you need to deallocate the VMs in the scale set before you modify the
+// SKU name.
+type SKU struct {
+ // Specifies the number of virtual machines in the scale set.
+ Capacity *int64
+
+ // The sku name.
+ Name *string
+
+ // Specifies the tier of virtual machines in a scale set.
+ // Possible Values:
+ // Standard
+ // Basic
+ Tier *string
+}
+
+// SSHConfiguration - SSH configuration for Linux based VMs running on Azure
+type SSHConfiguration struct {
+ // The list of SSH public keys used to authenticate with linux based VMs.
+ PublicKeys []*SSHPublicKey
+}
+
+// SSHPublicKey - Contains information about SSH certificate public key and the path on the Linux VM where the public key
+// is placed.
+type SSHPublicKey struct {
+ // SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa
+ // format. For creating ssh keys, see [Create SSH keys on Linux and Mac for
+ // Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed).
+ KeyData *string
+
+ // Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key
+ // is appended to the file. Example: /home/user/.ssh/authorized_keys
+ Path *string
+}
+
+// SSHPublicKeyGenerateKeyPairResult - Response from generation of an SSH key pair.
+type SSHPublicKeyGenerateKeyPairResult struct {
+ // REQUIRED; The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName}
+ ID *string
+
+ // REQUIRED; Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is
+ // returned in RFC3447 format and should be treated as a secret.
+ PrivateKey *string
+
+ // REQUIRED; Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in
+ // ssh-rsa format.
+ PublicKey *string
+}
+
+// SSHPublicKeyResource - Specifies information about the SSH public key.
+type SSHPublicKeyResource struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // Properties of the SSH public key.
+ Properties *SSHPublicKeyResourceProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// SSHPublicKeyResourceProperties - Properties of the SSH public key.
+type SSHPublicKeyResourceProperties struct {
+ // SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the
+ // resource is created, the publicKey property will be populated when
+ // generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at
+ // least 2048-bit and in ssh-rsa format.
+ PublicKey *string
+}
+
+// SSHPublicKeyUpdateResource - Specifies information about the SSH public key.
+type SSHPublicKeyUpdateResource struct {
+ // Properties of the SSH public key.
+ Properties *SSHPublicKeyResourceProperties
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// SSHPublicKeysGroupListResult - The list SSH public keys operation response.
+type SSHPublicKeysGroupListResult struct {
+ // REQUIRED; The list of SSH public keys
+ Value []*SSHPublicKeyResource
+
+ // The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys.
+ NextLink *string
+}
+
+// ScaleInPolicy - Describes a scale-in policy for a virtual machine scale set.
+type ScaleInPolicy struct {
+ // This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine
+ // scale set is being scaled-in.(Feature in Preview)
+ ForceDeletion *bool
+
+ // The rules to be followed when scaling-in a virtual machine scale set.
+ // Possible values are:
+ // Default When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal
+ // scale set. Then, it will be balanced across Fault Domains as far as possible.
+ // Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.
+ // OldestVM When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in
+ // will be chosen for removal. For zonal virtual machine scale sets, the
+ // scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will
+ // be chosen for removal.
+ // NewestVM When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in
+ // will be chosen for removal. For zonal virtual machine scale sets, the
+ // scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will
+ // be chosen for removal.
+ Rules []*VirtualMachineScaleSetScaleInRules
+}
+
+type ScheduledEventsProfile struct {
+ // Specifies OS Image Scheduled Event related configurations.
+ OSImageNotificationProfile *OSImageNotificationProfile
+
+ // Specifies Terminate Scheduled Event related configurations.
+ TerminateNotificationProfile *TerminateNotificationProfile
+}
+
+// SecurityPostureReference - Specifies the security posture to be used for all virtual machines in the scale set. Minimum
+// api-version: 2023-03-01
+type SecurityPostureReference struct {
+ // List of virtual machine extensions to exclude when applying the Security Posture.
+ ExcludeExtensions []*VirtualMachineExtension
+
+ // The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest
+ ID *string
+}
+
+// SecurityProfile - Specifies the Security profile settings for the virtual machine or virtual machine scale set.
+type SecurityProfile struct {
+ // This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual
+ // machine scale set. This will enable the encryption for all the disks
+ // including Resource/Temp disk at host itself. The default behavior is: The Encryption at host will be disabled unless this
+ // property is set to true for the resource.
+ EncryptionAtHost *bool
+
+ // Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. The
+ // default behavior is: UefiSettings will not be enabled unless this property is
+ // set.
+ SecurityType *SecurityTypes
+
+ // Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum api-version:
+ // 2020-12-01.
+ UefiSettings *UefiSettings
+}
+
+// ServiceArtifactReference - Specifies the service artifact reference id used to set same image version for all virtual machines
+// in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01
+type ServiceArtifactReference struct {
+ // The service artifact reference id in the form of
+ // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName}
+ ID *string
+}
+
+type ShareInfoElement struct {
+ // READ-ONLY; A relative URI containing the ID of the VM that has the disk attached.
+ VMURI *string
+}
+
+// SharedGallery - Specifies information about the Shared Gallery that you want to create or update.
+type SharedGallery struct {
+ // The identifier information of shared gallery.
+ Identifier *SharedGalleryIdentifier
+
+ // READ-ONLY; Resource location
+ Location *string
+
+ // READ-ONLY; Resource name
+ Name *string
+}
+
+// SharedGalleryDataDiskImage - This is the data disk image.
+type SharedGalleryDataDiskImage struct {
+ // REQUIRED; This property specifies the logical unit number of the data disk. This value is used to identify data disks within
+ // the Virtual Machine and therefore must be unique for each data disk attached to the
+ // Virtual Machine.
+ Lun *int32
+
+ // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'
+ HostCaching *SharedGalleryHostCaching
+
+ // READ-ONLY; This property indicates the size of the VHD to be created.
+ DiskSizeGB *int32
+}
+
+// SharedGalleryDiskImage - This is the disk image base class.
+type SharedGalleryDiskImage struct {
+ // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'
+ HostCaching *SharedGalleryHostCaching
+
+ // READ-ONLY; This property indicates the size of the VHD to be created.
+ DiskSizeGB *int32
+}
+
+// SharedGalleryIdentifier - The identifier information of shared gallery.
+type SharedGalleryIdentifier struct {
+ // The unique id of this shared gallery.
+ UniqueID *string
+}
+
+// SharedGalleryImage - Specifies information about the gallery image definition that you want to create or update.
+type SharedGalleryImage struct {
+ // The identifier information of shared gallery.
+ Identifier *SharedGalleryIdentifier
+
+ // Describes the properties of a gallery image definition.
+ Properties *SharedGalleryImageProperties
+
+ // READ-ONLY; Resource location
+ Location *string
+
+ // READ-ONLY; Resource name
+ Name *string
+}
+
+// SharedGalleryImageList - The List Shared Gallery Images operation response.
+type SharedGalleryImageList struct {
+ // REQUIRED; A list of shared gallery images.
+ Value []*SharedGalleryImage
+
+ // The uri to fetch the next page of shared gallery images. Call ListNext() with this to fetch the next page of shared gallery
+ // images.
+ NextLink *string
+}
+
+// SharedGalleryImageProperties - Describes the properties of a gallery image definition.
+type SharedGalleryImageProperties struct {
+ // REQUIRED; This is the gallery image definition identifier.
+ Identifier *GalleryImageIdentifier
+
+ // REQUIRED; This property allows the user to specify whether the virtual machines created under this image are 'Generalized'
+ // or 'Specialized'.
+ OSState *OperatingSystemStateTypes
+
+ // REQUIRED; This property allows you to specify the type of the OS that is included in the disk when creating a VM from a
+ // managed image.
+ // Possible values are:
+ // Windows
+ // Linux
+ OSType *OperatingSystemTypes
+
+ // The architecture of the image. Applicable to OS disks only.
+ Architecture *Architecture
+
+ // Describes the disallowed disk types.
+ Disallowed *Disallowed
+
+ // The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property
+ // is updatable.
+ EndOfLifeDate *time.Time
+
+ // End-user license agreement for the current community gallery image.
+ Eula *string
+
+ // A list of gallery image features.
+ Features []*GalleryImageFeature
+
+ // The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
+ HyperVGeneration *HyperVGeneration
+
+ // Privacy statement uri for the current community gallery image.
+ PrivacyStatementURI *string
+
+ // Describes the gallery image definition purchase plan. This is used by marketplace images.
+ PurchasePlan *ImagePurchasePlan
+
+ // The properties describe the recommended machine configuration for this Image Definition. These properties are updatable.
+ Recommended *RecommendedMachineConfiguration
+}
+
+// SharedGalleryImageVersion - Specifies information about the gallery image version that you want to create or update.
+type SharedGalleryImageVersion struct {
+ // The identifier information of shared gallery.
+ Identifier *SharedGalleryIdentifier
+
+ // Describes the properties of a gallery image version.
+ Properties *SharedGalleryImageVersionProperties
+
+ // READ-ONLY; Resource location
+ Location *string
+
+ // READ-ONLY; Resource name
+ Name *string
+}
+
+// SharedGalleryImageVersionList - The List Shared Gallery Image versions operation response.
+type SharedGalleryImageVersionList struct {
+ // REQUIRED; A list of shared gallery images versions.
+ Value []*SharedGalleryImageVersion
+
+ // The uri to fetch the next page of shared gallery image versions. Call ListNext() with this to fetch the next page of shared
+ // gallery image versions.
+ NextLink *string
+}
+
+// SharedGalleryImageVersionProperties - Describes the properties of a gallery image version.
+type SharedGalleryImageVersionProperties struct {
+ // The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This
+ // property is updatable.
+ EndOfLifeDate *time.Time
+
+ // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version.
+ ExcludeFromLatest *bool
+
+ // The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This
+ // property is updatable.
+ PublishedDate *time.Time
+
+ // Describes the storage profile of the image version.
+ StorageProfile *SharedGalleryImageVersionStorageProfile
+}
+
+// SharedGalleryImageVersionStorageProfile - This is the storage profile of a Gallery Image Version.
+type SharedGalleryImageVersionStorageProfile struct {
+ // A list of data disk images.
+ DataDiskImages []*SharedGalleryDataDiskImage
+
+ // This is the OS disk image.
+ OSDiskImage *SharedGalleryOSDiskImage
+}
+
+// SharedGalleryList - The List Shared Galleries operation response.
+type SharedGalleryList struct {
+ // REQUIRED; A list of shared galleries.
+ Value []*SharedGallery
+
+ // The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries.
+ NextLink *string
+}
+
+// SharedGalleryOSDiskImage - This is the OS disk image.
+type SharedGalleryOSDiskImage struct {
+ // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'
+ HostCaching *SharedGalleryHostCaching
+
+ // READ-ONLY; This property indicates the size of the VHD to be created.
+ DiskSizeGB *int32
+}
+
+// SharingProfile - Profile for gallery sharing to subscription or tenant
+type SharingProfile struct {
+ // Information of community gallery if current gallery is shared to community.
+ CommunityGalleryInfo *CommunityGalleryInfo
+
+ // This property allows you to specify the permission of sharing gallery.
+ // Possible values are:
+ // Private
+ // Groups
+ // Community
+ Permissions *GallerySharingPermissionTypes
+
+ // READ-ONLY; A list of sharing profile groups.
+ Groups []*SharingProfileGroup
+}
+
+// SharingProfileGroup - Group of the gallery sharing profile
+type SharingProfileGroup struct {
+ // A list of subscription/tenant ids the gallery is aimed to be shared to.
+ IDs []*string
+
+ // This property allows you to specify the type of sharing group.
+ // Possible values are:
+ // Subscriptions
+ // AADTenants
+ Type *SharingProfileGroupTypes
+}
+
+// SharingStatus - Sharing status of current gallery.
+type SharingStatus struct {
+ // Summary of all regional sharing status.
+ Summary []*RegionalSharingStatus
+
+ // READ-ONLY; Aggregated sharing state of current gallery.
+ AggregatedState *SharingState
+}
+
+// SharingUpdate - Specifies information about the gallery sharing profile update.
+type SharingUpdate struct {
+ // REQUIRED; This property allows you to specify the operation type of gallery sharing update.
+ // Possible values are:
+ // Add
+ // Remove
+ // Reset
+ OperationType *SharingUpdateOperationTypes
+
+ // A list of sharing profile groups.
+ Groups []*SharingProfileGroup
+}
+
+// Snapshot resource.
+type Snapshot struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // The extended location where the snapshot will be created. Extended location cannot be changed.
+ ExtendedLocation *ExtendedLocation
+
+ // Snapshot resource properties.
+ Properties *SnapshotProperties
+
+ // The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for incremental
+ // snapshot and the default behavior is the SKU will be set to the same sku as the
+ // previous snapshot
+ SKU *SnapshotSKU
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Unused. Always Null.
+ ManagedBy *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// SnapshotList - The List Snapshots operation response.
+type SnapshotList struct {
+ // REQUIRED; A list of snapshots.
+ Value []*Snapshot
+
+ // The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots.
+ NextLink *string
+}
+
+// SnapshotProperties - Snapshot resource properties.
+type SnapshotProperties struct {
+ // REQUIRED; Disk source information. CreationData information cannot be changed after the disk has been created.
+ CreationData *CreationData
+
+ // Percentage complete for the background copy when a resource is created via the CopyStart operation.
+ CompletionPercent *float32
+
+ // Indicates the error details if the background copy of a resource created via the CopyStart operation fails.
+ CopyCompletionError *CopyCompletionError
+
+ // Additional authentication requirements when exporting or uploading to a disk or snapshot.
+ DataAccessAuthMode *DataAccessAuthMode
+
+ // ARM id of the DiskAccess resource for using private endpoints on disks.
+ DiskAccessID *string
+
+ // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this
+ // field is present for updates or creation with other options, it indicates a
+ // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size.
+ DiskSizeGB *int32
+
+ // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys.
+ Encryption *Encryption
+
+ // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot.
+ EncryptionSettingsCollection *EncryptionSettingsCollection
+
+ // The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
+ HyperVGeneration *HyperVGeneration
+
+ // Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can
+ // be diffed.
+ Incremental *bool
+
+ // Policy for accessing the disk via network.
+ NetworkAccessPolicy *NetworkAccessPolicy
+
+ // The Operating System type.
+ OSType *OperatingSystemTypes
+
+ // Policy for controlling export on the disk.
+ PublicNetworkAccess *PublicNetworkAccess
+
+ // Purchase plan information for the image from which the source disk for the snapshot was originally created.
+ PurchasePlan *DiskPurchasePlan
+
+ // Contains the security related information for the resource.
+ SecurityProfile *DiskSecurityProfile
+
+ // List of supported capabilities for the image from which the source disk from the snapshot was originally created.
+ SupportedCapabilities *SupportedCapabilities
+
+ // Indicates the OS on a snapshot supports hibernation.
+ SupportsHibernation *bool
+
+ // READ-ONLY; The size of the disk in bytes. This field is read only.
+ DiskSizeBytes *int64
+
+ // READ-ONLY; The state of the snapshot.
+ DiskState *DiskState
+
+ // READ-ONLY; Incremental snapshots for a disk share an incremental snapshot family id. The Get Page Range Diff API can only
+ // be called on incremental snapshots with the same family id.
+ IncrementalSnapshotFamilyID *string
+
+ // READ-ONLY; The disk provisioning state.
+ ProvisioningState *string
+
+ // READ-ONLY; The time when the snapshot was created.
+ TimeCreated *time.Time
+
+ // READ-ONLY; Unique Guid identifying the resource.
+ UniqueID *string
+}
+
+// SnapshotSKU - The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for
+// incremental snapshot and the default behavior is the SKU will be set to the same sku as the
+// previous snapshot
+type SnapshotSKU struct {
+ // The sku name.
+ Name *SnapshotStorageAccountTypes
+
+ // READ-ONLY; The sku tier.
+ Tier *string
+}
+
+// SnapshotUpdate - Snapshot update resource.
+type SnapshotUpdate struct {
+ // Snapshot resource update properties.
+ Properties *SnapshotUpdateProperties
+
+ // The snapshots sku name. Can be StandardLRS, PremiumLRS, or Standard_ZRS. This is an optional parameter for incremental
+ // snapshot and the default behavior is the SKU will be set to the same sku as the
+ // previous snapshot
+ SKU *SnapshotSKU
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// SnapshotUpdateProperties - Snapshot resource update properties.
+type SnapshotUpdateProperties struct {
+ // Additional authentication requirements when exporting or uploading to a disk or snapshot.
+ DataAccessAuthMode *DataAccessAuthMode
+
+ // ARM id of the DiskAccess resource for using private endpoints on disks.
+ DiskAccessID *string
+
+ // If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this
+ // field is present for updates or creation with other options, it indicates a
+ // resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size.
+ DiskSizeGB *int32
+
+ // Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys.
+ Encryption *Encryption
+
+ // Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot.
+ EncryptionSettingsCollection *EncryptionSettingsCollection
+
+ // Policy for accessing the disk via network.
+ NetworkAccessPolicy *NetworkAccessPolicy
+
+ // the Operating System type.
+ OSType *OperatingSystemTypes
+
+ // Policy for controlling export on the disk.
+ PublicNetworkAccess *PublicNetworkAccess
+
+ // List of supported capabilities for the image from which the OS disk was created.
+ SupportedCapabilities *SupportedCapabilities
+
+ // Indicates the OS on a snapshot supports hibernation.
+ SupportsHibernation *bool
+}
+
+// SoftDeletePolicy - Contains information about the soft deletion policy of the gallery.
+type SoftDeletePolicy struct {
+ // Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time.
+ IsSoftDeleteEnabled *bool
+}
+
+// SourceVault - The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}
+type SourceVault struct {
+ // Resource Id
+ ID *string
+}
+
+// SpotRestorePolicy - Specifies the Spot-Try-Restore properties for the virtual machine scale set. With this property customer
+// can enable or disable automatic restore of the evicted Spot VMSS VM instances opportunistically
+// based on capacity availability and pricing constraint.
+type SpotRestorePolicy struct {
+ // Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based
+ // on capacity availability and pricing constraints
+ Enabled *bool
+
+ // Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances
+ RestoreTimeout *string
+}
+
+// StatusCodeCount - The status code and count of the cloud service instance view statuses
+type StatusCodeCount struct {
+ // READ-ONLY; The instance view status code
+ Code *string
+
+ // READ-ONLY; Number of instances having this status code
+ Count *int32
+}
+
+// StorageProfile - Specifies the storage settings for the virtual machine disks.
+type StorageProfile struct {
+ // Specifies the parameters that are used to add a data disk to a virtual machine. For more information about disks, see About
+ // disks and VHDs for Azure virtual machines
+ // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview].
+ DataDisks []*DataDisk
+
+ // Specifies the disk controller type configured for the VM. Note: This property will be set to the default disk controller
+ // type if not specified provided virtual machine is being created with
+ // 'hyperVGeneration' set to V2 based on the capabilities of the operating system disk and VM size from the the specified
+ // minimum api version. You need to deallocate the VM before updating its disk
+ // controller type unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates
+ // the VM. Minimum api-version: 2022-08-01.
+ DiskControllerType *DiskControllerTypes
+
+ // Specifies information about the image to use. You can specify information about platform images, marketplace images, or
+ // virtual machine images. This element is required when you want to use a platform
+ // image, marketplace image, or virtual machine image, but is not used in other creation operations.
+ ImageReference *ImageReference
+
+ // Specifies information about the operating system disk used by the virtual machine. For more information about disks, see
+ // About disks and VHDs for Azure virtual machines
+ // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview].
+ OSDisk *OSDisk
+}
+
+type SubResource struct {
+ // Resource Id
+ ID *string
+}
+
+type SubResourceReadOnly struct {
+ // READ-ONLY; Resource Id
+ ID *string
+}
+
+type SubResourceWithColocationStatus struct {
+ // Describes colocation status of a resource in the Proximity Placement Group.
+ ColocationStatus *InstanceViewStatus
+
+ // Resource Id
+ ID *string
+}
+
+// SupportedCapabilities - List of supported capabilities persisted on the disk resource for VM use.
+type SupportedCapabilities struct {
+ // True if the image from which the OS disk is created supports accelerated networking.
+ AcceleratedNetwork *bool
+
+ // CPU architecture supported by an OS disk.
+ Architecture *Architecture
+
+ // The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI.
+ DiskControllerTypes *string
+}
+
+// SystemData - The system meta data relating to this resource.
+type SystemData struct {
+ // READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was created.
+ // Minimum api-version: 2022-04-04.
+ CreatedAt *time.Time
+
+ // READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was last modified.
+ // Minimum api-version: 2022-04-04.
+ LastModifiedAt *time.Time
+}
+
+// TargetRegion - Describes the target region information.
+type TargetRegion struct {
+ // REQUIRED; The name of the region.
+ Name *string
+
+ // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact.
+ Encryption *EncryptionImages
+
+ // Contains the flag setting to hide an image when users specify version='latest'
+ ExcludeFromLatest *bool
+
+ // The number of replicas of the Image Version to be created per region. This property is updatable.
+ RegionalReplicaCount *int32
+
+ // Specifies the storage account type to be used to store the image. This property is not updatable.
+ StorageAccountType *StorageAccountType
+}
+
+type TerminateNotificationProfile struct {
+ // Specifies whether the Terminate Scheduled event is enabled or disabled.
+ Enable *bool
+
+ // Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event
+ // before the event is auto approved (timed out). The configuration must be
+ // specified in ISO 8601 format, the default value is 5 minutes (PT5M)
+ NotBeforeTimeout *string
+}
+
+// ThrottledRequestsInput - Api request input for LogAnalytics getThrottledRequests Api.
+type ThrottledRequestsInput struct {
+ // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to.
+ BlobContainerSasURI *string
+
+ // REQUIRED; From time of the query
+ FromTime *time.Time
+
+ // REQUIRED; To time of the query
+ ToTime *time.Time
+
+ // Group query result by Client Application ID.
+ GroupByClientApplicationID *bool
+
+ // Group query result by Operation Name.
+ GroupByOperationName *bool
+
+ // Group query result by Resource Name.
+ GroupByResourceName *bool
+
+ // Group query result by Throttle Policy applied.
+ GroupByThrottlePolicy *bool
+
+ // Group query result by User Agent.
+ GroupByUserAgent *bool
+}
+
+// UefiSettings - Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Minimum
+// api-version: 2020-12-01.
+type UefiSettings struct {
+ // Specifies whether secure boot should be enabled on the virtual machine. Minimum api-version: 2020-12-01.
+ SecureBootEnabled *bool
+
+ // Specifies whether vTPM should be enabled on the virtual machine. Minimum api-version: 2020-12-01.
+ VTpmEnabled *bool
+}
+
+// UpdateDomain - Defines an update domain for the cloud service.
+type UpdateDomain struct {
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource Name
+ Name *string
+}
+
+// UpdateDomainListResult - The list operation result.
+type UpdateDomainListResult struct {
+ // REQUIRED; The list of resources.
+ Value []*UpdateDomain
+
+ // The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null
+ // to fetch all the resources.
+ NextLink *string
+}
+
+// UpdateResource - The Update Resource model definition.
+type UpdateResource struct {
+ // Resource tags
+ Tags map[string]*string
+}
+
+// UpdateResourceDefinition - The Update Resource model definition.
+type UpdateResourceDefinition struct {
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// UpgradeOperationHistoricalStatusInfo - Virtual Machine Scale Set OS Upgrade History operation response.
+type UpgradeOperationHistoricalStatusInfo struct {
+ // READ-ONLY; Resource location
+ Location *string
+
+ // READ-ONLY; Information about the properties of the upgrade operation.
+ Properties *UpgradeOperationHistoricalStatusInfoProperties
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// UpgradeOperationHistoricalStatusInfoProperties - Describes each OS upgrade on the Virtual Machine Scale Set.
+type UpgradeOperationHistoricalStatusInfoProperties struct {
+ // READ-ONLY; Error Details for this upgrade if there are any.
+ Error *APIError
+
+ // READ-ONLY; Counts of the VMs in each state.
+ Progress *RollingUpgradeProgressInfo
+
+ // READ-ONLY; Information about OS rollback if performed
+ RollbackInfo *RollbackStatusInfo
+
+ // READ-ONLY; Information about the overall status of the upgrade operation.
+ RunningStatus *UpgradeOperationHistoryStatus
+
+ // READ-ONLY; Invoker of the Upgrade Operation
+ StartedBy *UpgradeOperationInvoker
+
+ // READ-ONLY; Image Reference details
+ TargetImageReference *ImageReference
+}
+
+// UpgradeOperationHistoryStatus - Information about the current running state of the overall upgrade.
+type UpgradeOperationHistoryStatus struct {
+ // READ-ONLY; Code indicating the current status of the upgrade.
+ Code *UpgradeState
+
+ // READ-ONLY; End time of the upgrade.
+ EndTime *time.Time
+
+ // READ-ONLY; Start time of the upgrade.
+ StartTime *time.Time
+}
+
+// UpgradePolicy - Describes an upgrade policy - automatic, manual, or rolling.
+type UpgradePolicy struct {
+ // Configuration parameters used for performing automatic OS Upgrade.
+ AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy
+
+ // Specifies the mode of an upgrade to virtual machines in the scale set.
+ // Possible values are:
+ // Manual - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade
+ // action.
+ // Automatic - All virtual machines in the scale set are automatically updated at the same time.
+ Mode *UpgradeMode
+
+ // The configuration parameters used while performing a rolling upgrade.
+ RollingUpgradePolicy *RollingUpgradePolicy
+}
+
+// Usage - Describes Compute Resource Usage.
+type Usage struct {
+ // REQUIRED; The current usage of the resource.
+ CurrentValue *int32
+
+ // REQUIRED; The maximum permitted usage of the resource.
+ Limit *int64
+
+ // REQUIRED; The name of the type of usage.
+ Name *UsageName
+
+ // REQUIRED; An enum describing the unit of usage measurement.
+ Unit *string
+}
+
+// UsageName - The Usage Names.
+type UsageName struct {
+ // The localized name of the resource.
+ LocalizedValue *string
+
+ // The name of the resource.
+ Value *string
+}
+
+type UserArtifactManage struct {
+ // REQUIRED; Required. The path and arguments to install the gallery application. This is limited to 4096 characters.
+ Install *string
+
+ // REQUIRED; Required. The path and arguments to remove the gallery application. This is limited to 4096 characters.
+ Remove *string
+
+ // Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove
+ // command on the previous version and install command on the current version
+ // of the gallery application. This is limited to 4096 characters.
+ Update *string
+}
+
+// UserArtifactSettings - Additional settings for the VM app that contains the target package and config file name when it
+// is deployed to target VM or VM scale set.
+type UserArtifactSettings struct {
+ // Optional. The name to assign the downloaded config file on the VM. This is limited to 4096 characters. If not specified,
+ // the config file will be named the Gallery Application name appended with
+ // "_config".
+ ConfigFileName *string
+
+ // Optional. The name to assign the downloaded package file on the VM. This is limited to 4096 characters. If not specified,
+ // the package file will be named the same as the Gallery Application name.
+ PackageFileName *string
+}
+
+// UserArtifactSource - The source image from which the Image Version is going to be created.
+type UserArtifactSource struct {
+ // REQUIRED; Required. The mediaLink of the artifact, must be a readable storage page blob.
+ MediaLink *string
+
+ // Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob.
+ DefaultConfigurationLink *string
+}
+
+type UserAssignedIdentitiesValue struct {
+ // READ-ONLY; The client id of user assigned identity.
+ ClientID *string
+
+ // READ-ONLY; The principal id of user assigned identity.
+ PrincipalID *string
+}
+
+// VMDiskSecurityProfile - Specifies the security profile settings for the managed disk. Note: It can only be set for Confidential
+// VMs.
+type VMDiskSecurityProfile struct {
+ // Specifies the customer managed disk encryption set resource id for the managed disk that is used for Customer Managed Key
+ // encrypted ConfidentialVM OS Disk and VMGuest blob.
+ DiskEncryptionSet *DiskEncryptionSetParameters
+
+ // Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk
+ // along with VMGuestState blob, and VMGuestStateOnly for encryption of just the
+ // VMGuestState blob. Note: It can be set for only Confidential VMs.
+ SecurityEncryptionType *SecurityEncryptionTypes
+}
+
+// VMGalleryApplication - Specifies the required information to reference a compute gallery application version
+type VMGalleryApplication struct {
+ // REQUIRED; Specifies the GalleryApplicationVersion resource id on the form of
+ // /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version}
+ PackageReferenceID *string
+
+ // Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided
+ ConfigurationReference *string
+
+ // If set to true, when a new Gallery Application version is available in PIR/SIG, it will be automatically updated for the
+ // VM/VMSS
+ EnableAutomaticUpgrade *bool
+
+ // Optional, Specifies the order in which the packages have to be installed
+ Order *int32
+
+ // Optional, Specifies a passthrough value for more generic context.
+ Tags *string
+
+ // Optional, If true, any failure for any operation in the VmApplication will fail the deployment
+ TreatFailureAsDeploymentFailure *bool
+}
+
+// VMImagesInEdgeZoneListResult - The List VmImages in EdgeZone operation response.
+type VMImagesInEdgeZoneListResult struct {
+ // The URI to fetch the next page of VMImages in EdgeZone. Call ListNext() with this URI to fetch the next page of VmImages.
+ NextLink *string
+
+ // The list of VMImages in EdgeZone
+ Value []*VirtualMachineImageResource
+}
+
+type VMScaleSetConvertToSinglePlacementGroupInput struct {
+ // Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id,
+ // please use Virtual Machine Scale Set VMs - Get API. If not provided, the
+ // platform will choose one with maximum number of virtual machine instances.
+ ActivePlacementGroupID *string
+}
+
+// VMSizeProperties - Specifies VM Size Property settings on the virtual machine.
+type VMSizeProperties struct {
+ // Specifies the number of vCPUs available for the VM. When this property is not specified in the request body the default
+ // behavior is to set it to the value of vCPUs available for that VM size exposed
+ // in api response of List all available virtual machine sizes in a region [https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list].
+ VCPUsAvailable *int32
+
+ // Specifies the vCPU to physical core ratio. When this property is not specified in the request body the default behavior
+ // is set to the value of vCPUsPerCore for the VM Size exposed in api response of
+ // List all available virtual machine sizes in a region [https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list].
+ // Setting this property to 1 also means that hyper-threading is disabled.
+ VCPUsPerCore *int32
+}
+
+// VaultCertificate - Describes a single certificate reference in a Key Vault, and where the certificate should reside on
+// the VM.
+type VaultCertificate struct {
+ // For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified
+ // certificate store is implicitly in the LocalMachine account. For Linux
+ // VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name .crt
+ // for the X509 certificate file and .prv for private key. Both
+ // of these files are .pem formatted.
+ CertificateStore *string
+
+ // This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault,
+ // see Add a key or secret to the key vault
+ // [https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add]. In this case, your certificate needs to be It
+ // is the Base64 encoding of the following JSON Object which is encoded in UTF-8:
+ // {
+ // "data":"",
+ // "dataType":"pfx",
+ // "password":""
+ // }
+ // To install certificates on a virtual machine it is recommended to use the Azure Key Vault virtual machine extension for
+ // Linux
+ // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine extension
+ // for Windows
+ // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows].
+ CertificateURL *string
+}
+
+// VaultSecretGroup - Describes a set of certificates which are all in the same Key Vault.
+type VaultSecretGroup struct {
+ // The relative URL of the Key Vault containing all of the certificates in VaultCertificates.
+ SourceVault *SubResource
+
+ // The list of key vault references in SourceVault which contain certificates.
+ VaultCertificates []*VaultCertificate
+}
+
+// VirtualHardDisk - Describes the uri of a disk.
+type VirtualHardDisk struct {
+ // Specifies the virtual hard disk's uri.
+ URI *string
+}
+
+// VirtualMachine - Describes a Virtual Machine.
+type VirtualMachine struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // The extended location of the Virtual Machine.
+ ExtendedLocation *ExtendedLocation
+
+ // The identity of the virtual machine, if configured.
+ Identity *VirtualMachineIdentity
+
+ // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace
+ // images. Before you can use a marketplace image from an API, you must
+ // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click
+ // Want to deploy programmatically, Get Started ->. Enter any required
+ // information and then click Save.
+ Plan *Plan
+
+ // Describes the properties of a Virtual Machine.
+ Properties *VirtualMachineProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // The virtual machine zones.
+ Zones []*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; The virtual machine child extension resources.
+ Resources []*VirtualMachineExtension
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// VirtualMachineAgentInstanceView - The instance view of the VM Agent running on the virtual machine.
+type VirtualMachineAgentInstanceView struct {
+ // The virtual machine extension handler instance view.
+ ExtensionHandlers []*VirtualMachineExtensionHandlerInstanceView
+
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+
+ // The VM Agent full version.
+ VMAgentVersion *string
+}
+
+// VirtualMachineAssessPatchesResult - Describes the properties of an AssessPatches result.
+type VirtualMachineAssessPatchesResult struct {
+ // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension
+ // logs.
+ AssessmentActivityID *string
+
+ // READ-ONLY; The list of patches that have been detected as available for installation.
+ AvailablePatches []*VirtualMachineSoftwarePatchProperties
+
+ // READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed.
+ CriticalAndSecurityPatchCount *int32
+
+ // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them.
+ Error *APIError
+
+ // READ-ONLY; The number of all available patches excluding critical and security.
+ OtherPatchCount *int32
+
+ // READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete
+ // installation but the reboot has not yet occurred.
+ RebootPending *bool
+
+ // READ-ONLY; The UTC timestamp when the operation began.
+ StartDateTime *time.Time
+
+ // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes.
+ // At that point it will become "Unknown", "Failed", "Succeeded", or
+ // "CompletedWithWarnings."
+ Status *PatchOperationStatus
+}
+
+// VirtualMachineCaptureParameters - Capture Virtual Machine parameters.
+type VirtualMachineCaptureParameters struct {
+ // REQUIRED; The destination container name.
+ DestinationContainerName *string
+
+ // REQUIRED; Specifies whether to overwrite the destination virtual hard disk, in case of conflict.
+ OverwriteVhds *bool
+
+ // REQUIRED; The captured virtual hard disk's name prefix.
+ VhdPrefix *string
+}
+
+// VirtualMachineCaptureResult - Output of virtual machine capture operation.
+type VirtualMachineCaptureResult struct {
+ // Resource Id
+ ID *string
+
+ // READ-ONLY; the version of the content
+ ContentVersion *string
+
+ // READ-ONLY; parameters of the captured virtual machine
+ Parameters any
+
+ // READ-ONLY; a list of resource items of the captured virtual machine
+ Resources []any
+
+ // READ-ONLY; the schema of the captured virtual machine
+ Schema *string
+}
+
+// VirtualMachineExtension - Describes a Virtual Machine Extension.
+type VirtualMachineExtension struct {
+ // Resource location
+ Location *string
+
+ // Describes the properties of a Virtual Machine Extension.
+ Properties *VirtualMachineExtensionProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// VirtualMachineExtensionHandlerInstanceView - The instance view of a virtual machine extension handler.
+type VirtualMachineExtensionHandlerInstanceView struct {
+ // The extension handler status.
+ Status *InstanceViewStatus
+
+ // Specifies the type of the extension; an example is "CustomScriptExtension".
+ Type *string
+
+ // Specifies the version of the script handler.
+ TypeHandlerVersion *string
+}
+
+// VirtualMachineExtensionImage - Describes a Virtual Machine Extension Image.
+type VirtualMachineExtensionImage struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // Describes the properties of a Virtual Machine Extension Image.
+ Properties *VirtualMachineExtensionImageProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// VirtualMachineExtensionImageProperties - Describes the properties of a Virtual Machine Extension Image.
+type VirtualMachineExtensionImageProperties struct {
+ // REQUIRED; The type of role (IaaS or PaaS) this extension supports.
+ ComputeRole *string
+
+ // REQUIRED; The schema defined by publisher, where extension consumers should provide settings in a matching schema.
+ HandlerSchema *string
+
+ // REQUIRED; The operating system this extension supports.
+ OperatingSystem *string
+
+ // Whether the handler can support multiple extensions.
+ SupportsMultipleExtensions *bool
+
+ // Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there
+ // might be cases where a publisher wants to explicitly indicate the extension is
+ // only enabled for CRP VMs but not VMSS.
+ VMScaleSetEnabled *bool
+}
+
+// VirtualMachineExtensionInstanceView - The instance view of a virtual machine extension.
+type VirtualMachineExtensionInstanceView struct {
+ // The virtual machine extension name.
+ Name *string
+
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+
+ // The resource status information.
+ Substatuses []*InstanceViewStatus
+
+ // Specifies the type of the extension; an example is "CustomScriptExtension".
+ Type *string
+
+ // Specifies the version of the script handler.
+ TypeHandlerVersion *string
+}
+
+// VirtualMachineExtensionProperties - Describes the properties of a Virtual Machine Extension.
+type VirtualMachineExtensionProperties struct {
+ // Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed,
+ // however, the extension will not upgrade minor versions unless redeployed, even
+ // with this property set to true.
+ AutoUpgradeMinorVersion *bool
+
+ // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension
+ // available.
+ EnableAutomaticUpgrade *bool
+
+ // How the extension handler should be forced to update even if the extension configuration has not changed.
+ ForceUpdateTag *string
+
+ // The virtual machine extension instance view.
+ InstanceView *VirtualMachineExtensionInstanceView
+
+ // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
+ ProtectedSettings any
+
+ // The extensions protected settings that are passed by reference, and consumed from key vault
+ ProtectedSettingsFromKeyVault *KeyVaultSecretReference
+
+ // Collection of extension names after which this extension needs to be provisioned.
+ ProvisionAfterExtensions []*string
+
+ // The name of the extension handler publisher.
+ Publisher *string
+
+ // Json formatted public settings for the extension.
+ Settings any
+
+ // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting
+ // to the VM will not be suppressed regardless of this value). The default is false.
+ SuppressFailures *bool
+
+ // Specifies the type of the extension; an example is "CustomScriptExtension".
+ Type *string
+
+ // Specifies the version of the script handler.
+ TypeHandlerVersion *string
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *string
+}
+
+// VirtualMachineExtensionUpdate - Describes a Virtual Machine Extension.
+type VirtualMachineExtensionUpdate struct {
+ // Describes the properties of a Virtual Machine Extension.
+ Properties *VirtualMachineExtensionUpdateProperties
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// VirtualMachineExtensionUpdateProperties - Describes the properties of a Virtual Machine Extension.
+type VirtualMachineExtensionUpdateProperties struct {
+ // Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed,
+ // however, the extension will not upgrade minor versions unless redeployed, even
+ // with this property set to true.
+ AutoUpgradeMinorVersion *bool
+
+ // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension
+ // available.
+ EnableAutomaticUpgrade *bool
+
+ // How the extension handler should be forced to update even if the extension configuration has not changed.
+ ForceUpdateTag *string
+
+ // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
+ ProtectedSettings any
+
+ // The extensions protected settings that are passed by reference, and consumed from key vault
+ ProtectedSettingsFromKeyVault *KeyVaultSecretReference
+
+ // The name of the extension handler publisher.
+ Publisher *string
+
+ // Json formatted public settings for the extension.
+ Settings any
+
+ // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting
+ // to the VM will not be suppressed regardless of this value). The default is false.
+ SuppressFailures *bool
+
+ // Specifies the type of the extension; an example is "CustomScriptExtension".
+ Type *string
+
+ // Specifies the version of the script handler.
+ TypeHandlerVersion *string
+}
+
+// VirtualMachineExtensionsListResult - The List Extension operation response
+type VirtualMachineExtensionsListResult struct {
+ // The list of extensions
+ Value []*VirtualMachineExtension
+}
+
+// VirtualMachineHealthStatus - The health status of the VM.
+type VirtualMachineHealthStatus struct {
+ // READ-ONLY; The health status information for the VM.
+ Status *InstanceViewStatus
+}
+
+// VirtualMachineIPTag - Contains the IP tag associated with the public IP address.
+type VirtualMachineIPTag struct {
+ // IP tag type. Example: FirstPartyUsage.
+ IPTagType *string
+
+ // IP tag associated with the public IP. Example: SQL, Storage etc.
+ Tag *string
+}
+
+// VirtualMachineIdentity - Identity for the virtual machine.
+type VirtualMachineIdentity struct {
+ // The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly
+ // created identity and a set of user assigned identities. The type 'None' will
+ // remove any identities from the virtual machine.
+ Type *ResourceIdentityType
+
+ // The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM
+ // resource ids in the form:
+ // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
+ UserAssignedIdentities map[string]*UserAssignedIdentitiesValue
+
+ // READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity.
+ PrincipalID *string
+
+ // READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned
+ // identity.
+ TenantID *string
+}
+
+// VirtualMachineImage - Describes a Virtual Machine Image.
+type VirtualMachineImage struct {
+ // REQUIRED; The supported Azure location of the resource.
+ Location *string
+
+ // REQUIRED; The name of the resource.
+ Name *string
+
+ // The extended location of the Virtual Machine.
+ ExtendedLocation *ExtendedLocation
+
+ // Resource Id
+ ID *string
+
+ // Describes the properties of a Virtual Machine Image.
+ Properties *VirtualMachineImageProperties
+
+ // Specifies the tags that are assigned to the virtual machine. For more information about using tags, see Using tags to organize
+ // your Azure resources
+ // [https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md].
+ Tags map[string]*string
+}
+
+// VirtualMachineImageFeature - Specifies additional capabilities supported by the image
+type VirtualMachineImageFeature struct {
+ // The name of the feature.
+ Name *string
+
+ // The corresponding value for the feature.
+ Value *string
+}
+
+// VirtualMachineImageProperties - Describes the properties of a Virtual Machine Image.
+type VirtualMachineImageProperties struct {
+ // Specifies the Architecture Type
+ Architecture *ArchitectureTypes
+
+ // Describes automatic OS upgrade properties on the image.
+ AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties
+ DataDiskImages []*DataDiskImage
+
+ // Specifies disallowed configuration for the VirtualMachine created from the image
+ Disallowed *DisallowedConfiguration
+ Features []*VirtualMachineImageFeature
+
+ // Specifies the HyperVGeneration Type
+ HyperVGeneration *HyperVGenerationTypes
+
+ // Describes image deprecation status properties on the image.
+ ImageDeprecationStatus *ImageDeprecationStatus
+
+ // Contains the os disk image information.
+ OSDiskImage *OSDiskImage
+
+ // Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
+ Plan *PurchasePlan
+}
+
+// VirtualMachineImageResource - Virtual machine image resource information.
+type VirtualMachineImageResource struct {
+ // REQUIRED; The supported Azure location of the resource.
+ Location *string
+
+ // REQUIRED; The name of the resource.
+ Name *string
+
+ // The extended location of the Virtual Machine.
+ ExtendedLocation *ExtendedLocation
+
+ // Resource Id
+ ID *string
+
+ // Specifies the tags that are assigned to the virtual machine. For more information about using tags, see Using tags to organize
+ // your Azure resources
+ // [https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md].
+ Tags map[string]*string
+}
+
+// VirtualMachineInstallPatchesParameters - Input for InstallPatches as directly received by the API
+type VirtualMachineInstallPatchesParameters struct {
+ // REQUIRED; Defines when it is acceptable to reboot a VM during a software update operation.
+ RebootSetting *VMGuestPatchRebootSetting
+
+ // Input for InstallPatches on a Linux VM, as directly received by the API
+ LinuxParameters *LinuxParameters
+
+ // Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such
+ // as PT4H (4 hours)
+ MaximumDuration *string
+
+ // Input for InstallPatches on a Windows VM, as directly received by the API
+ WindowsParameters *WindowsParameters
+}
+
+// VirtualMachineInstallPatchesResult - The result summary of an installation operation.
+type VirtualMachineInstallPatchesResult struct {
+ // READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them.
+ Error *APIError
+
+ // READ-ONLY; The number of patches that were not installed due to the user blocking their installation.
+ ExcludedPatchCount *int32
+
+ // READ-ONLY; The number of patches that could not be installed due to some issue. See errors for details.
+ FailedPatchCount *int32
+
+ // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension
+ // logs.
+ InstallationActivityID *string
+
+ // READ-ONLY; The number of patches successfully installed.
+ InstalledPatchCount *int32
+
+ // READ-ONLY; Whether the operation ran out of time before it completed all its intended actions.
+ MaintenanceWindowExceeded *bool
+
+ // READ-ONLY; The number of patches that were detected as available for install, but did not meet the operation's criteria.
+ NotSelectedPatchCount *int32
+
+ // READ-ONLY; The patches that were installed during the operation.
+ Patches []*PatchInstallationDetail
+
+ // READ-ONLY; The number of patches that were identified as meeting the installation criteria, but were not able to be installed.
+ // Typically this happens when maintenanceWindowExceeded == true.
+ PendingPatchCount *int32
+
+ // READ-ONLY; The reboot state of the VM following completion of the operation.
+ RebootStatus *VMGuestPatchRebootStatus
+
+ // READ-ONLY; The UTC timestamp when the operation began.
+ StartDateTime *time.Time
+
+ // READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes.
+ // At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings."
+ Status *PatchOperationStatus
+}
+
+// VirtualMachineInstanceView - The instance view of a virtual machine.
+type VirtualMachineInstanceView struct {
+ // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. You
+ // can easily view the output of your console log. Azure also enables you to see
+ // a screenshot of the VM from the hypervisor.
+ BootDiagnostics *BootDiagnosticsInstanceView
+
+ // The computer name assigned to the virtual machine.
+ ComputerName *string
+
+ // The virtual machine disk information.
+ Disks []*DiskInstanceView
+
+ // The extensions information.
+ Extensions []*VirtualMachineExtensionInstanceView
+
+ // Specifies the HyperVGeneration Type associated with a resource
+ HyperVGeneration *HyperVGenerationType
+
+ // The Maintenance Operation status on the virtual machine.
+ MaintenanceRedeployStatus *MaintenanceRedeployStatus
+
+ // The Operating System running on the virtual machine.
+ OSName *string
+
+ // The version of Operating System running on the virtual machine.
+ OSVersion *string
+
+ // [Preview Feature] The status of virtual machine patch operations.
+ PatchStatus *VirtualMachinePatchStatus
+
+ // Specifies the fault domain of the virtual machine.
+ PlatformFaultDomain *int32
+
+ // Specifies the update domain of the virtual machine.
+ PlatformUpdateDomain *int32
+
+ // The Remote desktop certificate thumbprint.
+ RdpThumbPrint *string
+
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+
+ // The VM Agent running on the virtual machine.
+ VMAgent *VirtualMachineAgentInstanceView
+
+ // READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when
+ // the virtual machine is associated with a dedicated host group that has automatic
+ // placement enabled. Minimum api-version: 2020-06-01.
+ AssignedHost *string
+
+ // READ-ONLY; The health status for the VM.
+ VMHealth *VirtualMachineHealthStatus
+}
+
+// VirtualMachineListResult - The List Virtual Machine operation response.
+type VirtualMachineListResult struct {
+ // REQUIRED; The list of virtual machines.
+ Value []*VirtualMachine
+
+ // The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines.
+ NextLink *string
+}
+
+// VirtualMachineNetworkInterfaceConfiguration - Describes a virtual machine network interface configurations.
+type VirtualMachineNetworkInterfaceConfiguration struct {
+ // REQUIRED; The network interface configuration name.
+ Name *string
+
+ // Describes a virtual machine network profile's IP configuration.
+ Properties *VirtualMachineNetworkInterfaceConfigurationProperties
+}
+
+// VirtualMachineNetworkInterfaceConfigurationProperties - Describes a virtual machine network profile's IP configuration.
+type VirtualMachineNetworkInterfaceConfigurationProperties struct {
+ // REQUIRED; Specifies the IP configurations of the network interface.
+ IPConfigurations []*VirtualMachineNetworkInterfaceIPConfiguration
+
+ // Specifies whether the Auxiliary mode is enabled for the Network Interface resource.
+ AuxiliaryMode *NetworkInterfaceAuxiliaryMode
+
+ // Specifies whether the Auxiliary sku is enabled for the Network Interface resource.
+ AuxiliarySKU *NetworkInterfaceAuxiliarySKU
+
+ // The dns settings to be applied on the network interfaces.
+ DNSSettings *VirtualMachineNetworkInterfaceDNSSettingsConfiguration
+
+ // Specify what happens to the network interface when the VM is deleted
+ DeleteOption *DeleteOptions
+
+ // Specifies whether the network interface is disabled for tcp state tracking.
+ DisableTCPStateTracking *bool
+ DscpConfiguration *SubResource
+
+ // Specifies whether the network interface is accelerated networking-enabled.
+ EnableAcceleratedNetworking *bool
+
+ // Specifies whether the network interface is FPGA networking-enabled.
+ EnableFpga *bool
+
+ // Whether IP forwarding enabled on this NIC.
+ EnableIPForwarding *bool
+
+ // The network security group.
+ NetworkSecurityGroup *SubResource
+
+ // Specifies the primary network interface in case the virtual machine has more than 1 network interface.
+ Primary *bool
+}
+
+// VirtualMachineNetworkInterfaceDNSSettingsConfiguration - Describes a virtual machines network configuration's DNS settings.
+type VirtualMachineNetworkInterfaceDNSSettingsConfiguration struct {
+ // List of DNS servers IP addresses
+ DNSServers []*string
+}
+
+// VirtualMachineNetworkInterfaceIPConfiguration - Describes a virtual machine network profile's IP configuration.
+type VirtualMachineNetworkInterfaceIPConfiguration struct {
+ // REQUIRED; The IP configuration name.
+ Name *string
+
+ // Describes a virtual machine network interface IP configuration properties.
+ Properties *VirtualMachineNetworkInterfaceIPConfigurationProperties
+}
+
+// VirtualMachineNetworkInterfaceIPConfigurationProperties - Describes a virtual machine network interface IP configuration
+// properties.
+type VirtualMachineNetworkInterfaceIPConfigurationProperties struct {
+ // Specifies an array of references to backend address pools of application gateways. A virtual machine can reference backend
+ // address pools of multiple application gateways. Multiple virtual machines
+ // cannot use the same application gateway.
+ ApplicationGatewayBackendAddressPools []*SubResource
+
+ // Specifies an array of references to application security group.
+ ApplicationSecurityGroups []*SubResource
+
+ // Specifies an array of references to backend address pools of load balancers. A virtual machine can reference backend address
+ // pools of one public and one internal load balancer. [Multiple virtual
+ // machines cannot use the same basic sku load balancer].
+ LoadBalancerBackendAddressPools []*SubResource
+
+ // Specifies the primary network interface in case the virtual machine has more than 1 network interface.
+ Primary *bool
+
+ // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default
+ // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
+ PrivateIPAddressVersion *IPVersions
+
+ // The publicIPAddressConfiguration.
+ PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration
+
+ // Specifies the identifier of the subnet.
+ Subnet *SubResource
+}
+
+// VirtualMachinePatchStatus - The status of virtual machine patch operations.
+type VirtualMachinePatchStatus struct {
+ // The available patch summary of the latest assessment operation for the virtual machine.
+ AvailablePatchSummary *AvailablePatchSummary
+
+ // The installation summary of the latest installation operation for the virtual machine.
+ LastPatchInstallationSummary *LastPatchInstallationSummary
+
+ // READ-ONLY; The enablement status of the specified patchMode
+ ConfigurationStatuses []*InstanceViewStatus
+}
+
+// VirtualMachineProperties - Describes the properties of a Virtual Machine.
+type VirtualMachineProperties struct {
+ // Specifies additional capabilities enabled or disabled on the virtual machine.
+ AdditionalCapabilities *AdditionalCapabilities
+
+ // Specifies the gallery applications that should be made available to the VM/VMSS.
+ ApplicationProfile *ApplicationProfile
+
+ // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified
+ // in the same availability set are allocated to different nodes to maximize
+ // availability. For more information about availability sets, see Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview].
+ // For more information on Azure
+ // planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates].
+ // Currently, a VM can only be added to
+ // availability set at creation time. The availability set to which the VM is being added should be under the same resource
+ // group as the availability set resource. An existing VM cannot be added to an
+ // availability set. This property cannot exist along with a non-null properties.virtualMachineScaleSet reference.
+ AvailabilitySet *SubResource
+
+ // Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01.
+ BillingProfile *BillingProfile
+
+ // Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01.
+ CapacityReservation *CapacityReservationProfile
+
+ // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.
+ DiagnosticsProfile *DiagnosticsProfile
+
+ // Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines,
+ // both 'Deallocate' and 'Delete' are supported and the minimum api-version is
+ // 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview.
+ EvictionPolicy *VirtualMachineEvictionPolicyTypes
+
+ // Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes
+ // (inclusive) and should be specified in ISO 8601 format. The default value is 90
+ // minutes (PT1H30M). Minimum api-version: 2020-06-01.
+ ExtensionsTimeBudget *string
+
+ // Specifies the hardware settings for the virtual machine.
+ HardwareProfile *HardwareProfile
+
+ // Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01.
+ Host *SubResource
+
+ // Specifies information about the dedicated host group that the virtual machine resides in. Note: User cannot specify both
+ // host and hostGroup properties. Minimum api-version: 2020-06-01.
+ HostGroup *SubResource
+
+ // Specifies that the image or disk that is being used was licensed on-premises.
+ // Possible values for Windows Server operating system are:
+ // WindowsClient
+ // WindowsServer
+ // Possible values for Linux Server operating system are:
+ // RHELBYOS (for RHEL)
+ // SLESBYOS (for SUSE)
+ // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing]
+ // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux]
+ // Minimum api-version: 2015-06-15
+ LicenseType *string
+
+ // Specifies the network interfaces of the virtual machine.
+ NetworkProfile *NetworkProfile
+
+ // Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed
+ // once VM is provisioned.
+ OSProfile *OSProfile
+
+ // Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine
+ // will by automatically assigned to a fault domain that best maintains
+ // balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual
+ // Machine is set. The Virtual Machine Scale Set that is referenced, must have
+ // 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain
+ // assignment can be viewed in the Virtual Machine Instance View. Minimum
+ // api‐version: 2020‐12‐01.
+ PlatformFaultDomain *int32
+
+ // Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01
+ Priority *VirtualMachinePriorityTypes
+
+ // Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version:
+ // 2018-04-01.
+ ProximityPlacementGroup *SubResource
+
+ // Specifies Scheduled Event related configurations.
+ ScheduledEventsProfile *ScheduledEventsProfile
+
+ // Specifies the Security related profile settings for the virtual machine.
+ SecurityProfile *SecurityProfile
+
+ // Specifies the storage settings for the virtual machine disks.
+ StorageProfile *StorageProfile
+
+ // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version:
+ // 2021-03-01.
+ UserData *string
+
+ // Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines
+ // specified in the same virtual machine scale set are allocated to different
+ // nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing
+ // VM cannot be added to a virtual machine scale set. This property cannot
+ // exist along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01.
+ VirtualMachineScaleSet *SubResource
+
+ // READ-ONLY; The virtual machine instance view.
+ InstanceView *VirtualMachineInstanceView
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *string
+
+ // READ-ONLY; Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01.
+ TimeCreated *time.Time
+
+ // READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS
+ // and can be read using platform BIOS commands.
+ VMID *string
+}
+
+// VirtualMachinePublicIPAddressConfiguration - Describes a virtual machines IP Configuration's PublicIPAddress configuration
+type VirtualMachinePublicIPAddressConfiguration struct {
+ // REQUIRED; The publicIP address configuration name.
+ Name *string
+
+ // Describes a virtual machines IP Configuration's PublicIPAddress configuration
+ Properties *VirtualMachinePublicIPAddressConfigurationProperties
+
+ // Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible.
+ SKU *PublicIPAddressSKU
+}
+
+// VirtualMachinePublicIPAddressConfigurationProperties - Describes a virtual machines IP Configuration's PublicIPAddress
+// configuration
+type VirtualMachinePublicIPAddressConfigurationProperties struct {
+ // The dns settings to be applied on the publicIP addresses .
+ DNSSettings *VirtualMachinePublicIPAddressDNSSettingsConfiguration
+
+ // Specify what happens to the public IP address when the VM is deleted
+ DeleteOption *DeleteOptions
+
+ // The list of IP tags associated with the public IP address.
+ IPTags []*VirtualMachineIPTag
+
+ // The idle timeout of the public IP address.
+ IdleTimeoutInMinutes *int32
+
+ // Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default
+ // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
+ PublicIPAddressVersion *IPVersions
+
+ // Specify the public IP allocation type
+ PublicIPAllocationMethod *PublicIPAllocationMethod
+
+ // The PublicIPPrefix from which to allocate publicIP addresses.
+ PublicIPPrefix *SubResource
+}
+
+// VirtualMachinePublicIPAddressDNSSettingsConfiguration - Describes a virtual machines network configuration's DNS settings.
+type VirtualMachinePublicIPAddressDNSSettingsConfiguration struct {
+ // REQUIRED; The Domain name label prefix of the PublicIPAddress resources that will be created. The generated name label
+ // is the concatenation of the domain name label and vm network profile unique ID.
+ DomainNameLabel *string
+
+ // The Domain name label scope of the PublicIPAddress resources that will be created. The generated name label is the concatenation
+ // of the hashed domain name label with policy according to the domain
+ // name label scope and vm network profile unique ID.
+ DomainNameLabelScope *DomainNameLabelScopeTypes
+}
+
+// VirtualMachineReimageParameters - Parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will always be
+// reimaged
+type VirtualMachineReimageParameters struct {
+ // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk
+ // is reimaged to the existing version of OS Disk.
+ ExactVersion *string
+
+ // Specifies information required for reimaging the non-ephemeral OS disk.
+ OSProfile *OSProfileProvisioningData
+
+ // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported
+ // for VM/VMSS with Ephemeral OS disk.
+ TempDisk *bool
+}
+
+// VirtualMachineRunCommand - Describes a Virtual Machine run command.
+type VirtualMachineRunCommand struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // Describes the properties of a Virtual Machine run command.
+ Properties *VirtualMachineRunCommandProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// VirtualMachineRunCommandInstanceView - The instance view of a virtual machine run command.
+type VirtualMachineRunCommandInstanceView struct {
+ // Script end time.
+ EndTime *time.Time
+
+ // Script error stream.
+ Error *string
+
+ // Communicate script configuration errors or execution messages.
+ ExecutionMessage *string
+
+ // Script execution status.
+ ExecutionState *ExecutionState
+
+ // Exit code returned from script execution.
+ ExitCode *int32
+
+ // Script output stream.
+ Output *string
+
+ // Script start time.
+ StartTime *time.Time
+
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+}
+
+// VirtualMachineRunCommandProperties - Describes the properties of a Virtual Machine run command.
+type VirtualMachineRunCommandProperties struct {
+ // Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete.
+ AsyncExecution *bool
+
+ // User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned
+ // identity. Make sure managed identity has been given access to blob's
+ // container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it
+ // under VM's identity. For more info on managed identity and Run Command, refer
+ // https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged
+ ErrorBlobManagedIdentity *RunCommandManagedIdentity
+
+ // Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write
+ // access OR use managed identity to provide the VM access to the blob. Refer
+ // errorBlobManagedIdentity parameter.
+ ErrorBlobURI *string
+
+ // User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned
+ // identity. Make sure managed identity has been given access to blob's
+ // container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it
+ // under VM's identity. For more info on managed identity and Run Command, refer
+ // https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged
+ OutputBlobManagedIdentity *RunCommandManagedIdentity
+
+ // Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create,
+ // write access OR use managed identity to provide the VM access to the blob. Refer
+ // outputBlobManagedIdentity parameter.
+ OutputBlobURI *string
+
+ // The parameters used by the script.
+ Parameters []*RunCommandInputParameter
+
+ // The parameters used by the script.
+ ProtectedParameters []*RunCommandInputParameter
+
+ // Specifies the user account password on the VM when executing the run command.
+ RunAsPassword *string
+
+ // Specifies the user account on the VM when executing the run command.
+ RunAsUser *string
+
+ // The source of the run command script.
+ Source *VirtualMachineRunCommandScriptSource
+
+ // The timeout in seconds to execute the run command.
+ TimeoutInSeconds *int32
+
+ // Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed.
+ // If set to false, ProvisioningState would only reflect whether the run
+ // command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures.
+ // See instance view of run command in case of script failures to see
+ // executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results
+ TreatFailureAsDeploymentFailure *bool
+
+ // READ-ONLY; The virtual machine run command instance view.
+ InstanceView *VirtualMachineRunCommandInstanceView
+
+ // READ-ONLY; The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true,
+ // any failure in the script will fail the deployment and ProvisioningState will be marked as
+ // Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was
+ // run or not by the extensions platform, it would not indicate whether script
+ // failed in case of script failures. See instance view of run command in case of script failures to see executionMessage,
+ // output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results
+ ProvisioningState *string
+}
+
+// VirtualMachineRunCommandScriptSource - Describes the script sources for run command. Use only one of script, scriptUri,
+// commandId.
+type VirtualMachineRunCommandScriptSource struct {
+ // Specifies a commandId of predefined built-in script.
+ CommandID *string
+
+ // Specifies the script content to be executed on the VM.
+ Script *string
+
+ // Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.
+ ScriptURI *string
+
+ // User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case
+ // of system-assigned identity. Make sure the Azure storage blob exists, and managed
+ // identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned
+ // identity, make sure you add it under VM's identity. For more info on
+ // managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged.
+ ScriptURIManagedIdentity *RunCommandManagedIdentity
+}
+
+// VirtualMachineRunCommandUpdate - Describes a Virtual Machine run command.
+type VirtualMachineRunCommandUpdate struct {
+ // Describes the properties of a Virtual Machine run command.
+ Properties *VirtualMachineRunCommandProperties
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// VirtualMachineRunCommandsListResult - The List run command operation response
+type VirtualMachineRunCommandsListResult struct {
+ // REQUIRED; The list of run commands
+ Value []*VirtualMachineRunCommand
+
+ // The uri to fetch the next page of run commands.
+ NextLink *string
+}
+
+// VirtualMachineScaleSet - Describes a Virtual Machine Scale Set.
+type VirtualMachineScaleSet struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // The extended location of the Virtual Machine Scale Set.
+ ExtendedLocation *ExtendedLocation
+
+ // The identity of the virtual machine scale set, if configured.
+ Identity *VirtualMachineScaleSetIdentity
+
+ // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace
+ // images. Before you can use a marketplace image from an API, you must
+ // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click
+ // Want to deploy programmatically, Get Started ->. Enter any required
+ // information and then click Save.
+ Plan *Plan
+
+ // Describes the properties of a Virtual Machine Scale Set.
+ Properties *VirtualMachineScaleSetProperties
+
+ // The virtual machine scale set sku.
+ SKU *SKU
+
+ // Resource tags
+ Tags map[string]*string
+
+ // The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set
+ Zones []*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// VirtualMachineScaleSetDataDisk - Describes a virtual machine scale set data disk.
+type VirtualMachineScaleSetDataDisk struct {
+ // REQUIRED; The create option.
+ CreateOption *DiskCreateOptionTypes
+
+ // REQUIRED; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and
+ // therefore must be unique for each data disk attached to a VM.
+ Lun *int32
+
+ // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard
+ // storage. ReadOnly for Premium storage.
+ Caching *CachingTypes
+
+ // Specifies whether data disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with
+ // Flexible OrchestrationMode only).
+ // Possible values:
+ // Delete If this value is used, the data disk is deleted when the VMSS Flex VM is deleted.
+ // Detach If this value is used, the data disk is retained after VMSS Flex VM is deleted.
+ // The default value is set to Delete.
+ DeleteOption *DiskDeleteOptionTypes
+
+ // Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not
+ // specified, a default value would be assigned based on diskSizeGB.
+ DiskIOPSReadWrite *int64
+
+ // Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS.
+ // If not specified, a default value would be assigned based on diskSizeGB.
+ DiskMBpsReadWrite *int64
+
+ // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a
+ // virtual machine image. The property diskSizeGB is the number of bytes x 1024^3
+ // for the disk and the value cannot be larger than 1023.
+ DiskSizeGB *int32
+
+ // The managed disk parameters.
+ ManagedDisk *VirtualMachineScaleSetManagedDiskParameters
+
+ // The disk name.
+ Name *string
+
+ // Specifies whether writeAccelerator should be enabled or disabled on the disk.
+ WriteAcceleratorEnabled *bool
+}
+
+// VirtualMachineScaleSetExtension - Describes a Virtual Machine Scale Set Extension.
+type VirtualMachineScaleSetExtension struct {
+ // The name of the extension.
+ Name *string
+
+ // Describes the properties of a Virtual Machine Scale Set Extension.
+ Properties *VirtualMachineScaleSetExtensionProperties
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// VirtualMachineScaleSetExtensionListResult - The List VM scale set extension operation response.
+type VirtualMachineScaleSetExtensionListResult struct {
+ // REQUIRED; The list of VM scale set extensions.
+ Value []*VirtualMachineScaleSetExtension
+
+ // The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale
+ // set extensions.
+ NextLink *string
+}
+
+// VirtualMachineScaleSetExtensionProfile - Describes a virtual machine scale set extension profile.
+type VirtualMachineScaleSetExtensionProfile struct {
+ // The virtual machine scale set child extension resources.
+ Extensions []*VirtualMachineScaleSetExtension
+
+ // Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes
+ // (inclusive) and should be specified in ISO 8601 format. The default value is 90
+ // minutes (PT1H30M). Minimum api-version: 2020-06-01.
+ ExtensionsTimeBudget *string
+}
+
+// VirtualMachineScaleSetExtensionProperties - Describes the properties of a Virtual Machine Scale Set Extension.
+type VirtualMachineScaleSetExtensionProperties struct {
+ // Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed,
+ // however, the extension will not upgrade minor versions unless redeployed, even
+ // with this property set to true.
+ AutoUpgradeMinorVersion *bool
+
+ // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension
+ // available.
+ EnableAutomaticUpgrade *bool
+
+ // If a value is provided and is different from the previous value, the extension handler will be forced to update even if
+ // the extension configuration has not changed.
+ ForceUpdateTag *string
+
+ // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
+ ProtectedSettings any
+
+ // The extensions protected settings that are passed by reference, and consumed from key vault
+ ProtectedSettingsFromKeyVault *KeyVaultSecretReference
+
+ // Collection of extension names after which this extension needs to be provisioned.
+ ProvisionAfterExtensions []*string
+
+ // The name of the extension handler publisher.
+ Publisher *string
+
+ // Json formatted public settings for the extension.
+ Settings any
+
+ // Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting
+ // to the VM will not be suppressed regardless of this value). The default is false.
+ SuppressFailures *bool
+
+ // Specifies the type of the extension; an example is "CustomScriptExtension".
+ Type *string
+
+ // Specifies the version of the script handler.
+ TypeHandlerVersion *string
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *string
+}
+
+// VirtualMachineScaleSetExtensionUpdate - Describes a Virtual Machine Scale Set Extension.
+type VirtualMachineScaleSetExtensionUpdate struct {
+ // Describes the properties of a Virtual Machine Scale Set Extension.
+ Properties *VirtualMachineScaleSetExtensionProperties
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; The name of the extension.
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// VirtualMachineScaleSetHardwareProfile - Specifies the hardware settings for the virtual machine scale set.
+type VirtualMachineScaleSetHardwareProfile struct {
+ // Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01. Please follow
+ // the instructions in VM Customization [https://aka.ms/vmcustomization] for more
+ // details.
+ VMSizeProperties *VMSizeProperties
+}
+
+// VirtualMachineScaleSetIPConfiguration - Describes a virtual machine scale set network profile's IP configuration.
+type VirtualMachineScaleSetIPConfiguration struct {
+ // REQUIRED; The IP configuration name.
+ Name *string
+
+ // Describes a virtual machine scale set network profile's IP configuration properties.
+ Properties *VirtualMachineScaleSetIPConfigurationProperties
+}
+
+// VirtualMachineScaleSetIPConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration
+// properties.
+type VirtualMachineScaleSetIPConfigurationProperties struct {
+ // Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address
+ // pools of multiple application gateways. Multiple scale sets cannot use the
+ // same application gateway.
+ ApplicationGatewayBackendAddressPools []*SubResource
+
+ // Specifies an array of references to application security group.
+ ApplicationSecurityGroups []*SubResource
+
+ // Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address
+ // pools of one public and one internal load balancer. Multiple scale sets cannot
+ // use the same basic sku load balancer.
+ LoadBalancerBackendAddressPools []*SubResource
+
+ // Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools
+ // of one public and one internal load balancer. Multiple scale sets cannot use
+ // the same basic sku load balancer.
+ LoadBalancerInboundNatPools []*SubResource
+
+ // Specifies the primary network interface in case the virtual machine has more than 1 network interface.
+ Primary *bool
+
+ // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default
+ // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
+ PrivateIPAddressVersion *IPVersion
+
+ // The publicIPAddressConfiguration.
+ PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration
+
+ // Specifies the identifier of the subnet.
+ Subnet *APIEntityReference
+}
+
+// VirtualMachineScaleSetIPTag - Contains the IP tag associated with the public IP address.
+type VirtualMachineScaleSetIPTag struct {
+ // IP tag type. Example: FirstPartyUsage.
+ IPTagType *string
+
+ // IP tag associated with the public IP. Example: SQL, Storage etc.
+ Tag *string
+}
+
+// VirtualMachineScaleSetIdentity - Identity for the virtual machine scale set.
+type VirtualMachineScaleSetIdentity struct {
+ // The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly
+ // created identity and a set of user assigned identities. The type 'None'
+ // will remove any identities from the virtual machine scale set.
+ Type *ResourceIdentityType
+
+ // The list of user identities associated with the virtual machine scale set. The user identity dictionary key references
+ // will be ARM resource ids in the form:
+ // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
+ UserAssignedIdentities map[string]*UserAssignedIdentitiesValue
+
+ // READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned
+ // identity.
+ PrincipalID *string
+
+ // READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system
+ // assigned identity.
+ TenantID *string
+}
+
+// VirtualMachineScaleSetInstanceView - The instance view of a virtual machine scale set.
+type VirtualMachineScaleSetInstanceView struct {
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+
+ // READ-ONLY; The extensions information.
+ Extensions []*VirtualMachineScaleSetVMExtensionsSummary
+
+ // READ-ONLY; The orchestration services information.
+ OrchestrationServices []*OrchestrationServiceSummary
+
+ // READ-ONLY; The instance view status summary for the virtual machine scale set.
+ VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary
+}
+
+// VirtualMachineScaleSetInstanceViewStatusesSummary - Instance view statuses summary for virtual machines of a virtual machine
+// scale set.
+type VirtualMachineScaleSetInstanceViewStatusesSummary struct {
+ // READ-ONLY; The extensions information.
+ StatusesSummary []*VirtualMachineStatusCodeCount
+}
+
+// VirtualMachineScaleSetListOSUpgradeHistory - List of Virtual Machine Scale Set OS Upgrade History operation response.
+type VirtualMachineScaleSetListOSUpgradeHistory struct {
+ // REQUIRED; The list of OS upgrades performed on the virtual machine scale set.
+ Value []*UpgradeOperationHistoricalStatusInfo
+
+ // The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades.
+ NextLink *string
+}
+
+// VirtualMachineScaleSetListResult - The List Virtual Machine operation response.
+type VirtualMachineScaleSetListResult struct {
+ // REQUIRED; The list of virtual machine scale sets.
+ Value []*VirtualMachineScaleSet
+
+ // The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS.
+ NextLink *string
+}
+
+// VirtualMachineScaleSetListSKUsResult - The Virtual Machine Scale Set List Skus operation response.
+type VirtualMachineScaleSetListSKUsResult struct {
+ // REQUIRED; The list of skus available for the virtual machine scale set.
+ Value []*VirtualMachineScaleSetSKU
+
+ // The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS
+ // Skus.
+ NextLink *string
+}
+
+// VirtualMachineScaleSetListWithLinkResult - The List Virtual Machine operation response.
+type VirtualMachineScaleSetListWithLinkResult struct {
+ // REQUIRED; The list of virtual machine scale sets.
+ Value []*VirtualMachineScaleSet
+
+ // The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual
+ // Machine Scale Sets.
+ NextLink *string
+}
+
+// VirtualMachineScaleSetManagedDiskParameters - Describes the parameters of a ScaleSet managed disk.
+type VirtualMachineScaleSetManagedDiskParameters struct {
+ // Specifies the customer managed disk encryption set resource id for the managed disk.
+ DiskEncryptionSet *DiskEncryptionSetParameters
+
+ // Specifies the security profile for the managed disk.
+ SecurityProfile *VMDiskSecurityProfile
+
+ // Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot
+ // be used with OS Disk.
+ StorageAccountType *StorageAccountTypes
+}
+
+// VirtualMachineScaleSetNetworkConfiguration - Describes a virtual machine scale set network profile's network configurations.
+type VirtualMachineScaleSetNetworkConfiguration struct {
+ // REQUIRED; The network configuration name.
+ Name *string
+
+ // Describes a virtual machine scale set network profile's IP configuration.
+ Properties *VirtualMachineScaleSetNetworkConfigurationProperties
+}
+
+// VirtualMachineScaleSetNetworkConfigurationDNSSettings - Describes a virtual machines scale sets network configuration's
+// DNS settings.
+type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct {
+ // List of DNS servers IP addresses
+ DNSServers []*string
+}
+
+// VirtualMachineScaleSetNetworkConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration.
+type VirtualMachineScaleSetNetworkConfigurationProperties struct {
+ // REQUIRED; Specifies the IP configurations of the network interface.
+ IPConfigurations []*VirtualMachineScaleSetIPConfiguration
+
+ // Specifies whether the Auxiliary mode is enabled for the Network Interface resource.
+ AuxiliaryMode *NetworkInterfaceAuxiliaryMode
+
+ // Specifies whether the Auxiliary sku is enabled for the Network Interface resource.
+ AuxiliarySKU *NetworkInterfaceAuxiliarySKU
+
+ // The dns settings to be applied on the network interfaces.
+ DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings
+
+ // Specify what happens to the network interface when the VM is deleted
+ DeleteOption *DeleteOptions
+
+ // Specifies whether the network interface is disabled for tcp state tracking.
+ DisableTCPStateTracking *bool
+
+ // Specifies whether the network interface is accelerated networking-enabled.
+ EnableAcceleratedNetworking *bool
+
+ // Specifies whether the network interface is FPGA networking-enabled.
+ EnableFpga *bool
+
+ // Whether IP forwarding enabled on this NIC.
+ EnableIPForwarding *bool
+
+ // The network security group.
+ NetworkSecurityGroup *SubResource
+
+ // Specifies the primary network interface in case the virtual machine has more than 1 network interface.
+ Primary *bool
+}
+
+// VirtualMachineScaleSetNetworkProfile - Describes a virtual machine scale set network profile.
+type VirtualMachineScaleSetNetworkProfile struct {
+ // A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The
+ // reference will be in the form:
+ // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'.
+ HealthProbe *APIEntityReference
+
+ // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations
+ // for Virtual Machine Scale Set with orchestration mode 'Flexible'
+ NetworkAPIVersion *NetworkAPIVersion
+
+ // The list of network configurations.
+ NetworkInterfaceConfigurations []*VirtualMachineScaleSetNetworkConfiguration
+}
+
+// VirtualMachineScaleSetOSDisk - Describes a virtual machine scale set operating system disk.
+type VirtualMachineScaleSetOSDisk struct {
+ // REQUIRED; Specifies how the virtual machines in the scale set should be created. The only allowed value is: FromImage.
+ // This value is used when you are using an image to create the virtual machine. If you are
+ // using a platform image, you also use the imageReference element described above. If you are using a marketplace image,
+ // you also use the plan element previously described.
+ CreateOption *DiskCreateOptionTypes
+
+ // Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard
+ // storage. ReadOnly for Premium storage.
+ Caching *CachingTypes
+
+ // Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with
+ // Flexible OrchestrationMode only).
+ // Possible values:
+ // Delete If this value is used, the OS disk is deleted when VMSS Flex VM is deleted.
+ // Detach If this value is used, the OS disk is retained after VMSS Flex VM is deleted.
+ // The default value is set to Delete. For an Ephemeral OS Disk, the default value is set to Delete. User cannot change the
+ // delete option for Ephemeral OS Disk.
+ DeleteOption *DiskDeleteOptionTypes
+
+ // Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set.
+ DiffDiskSettings *DiffDiskSettings
+
+ // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a
+ // virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3
+ // for the disk and the value cannot be larger than 1023.
+ DiskSizeGB *int32
+
+ // Specifies information about the unmanaged user image to base the scale set on.
+ Image *VirtualHardDisk
+
+ // The managed disk parameters.
+ ManagedDisk *VirtualMachineScaleSetManagedDiskParameters
+
+ // The disk name.
+ Name *string
+
+ // This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or
+ // a specialized VHD. Possible values are: Windows, Linux.
+ OSType *OperatingSystemTypes
+
+ // Specifies the container urls that are used to store operating system disks for the scale set.
+ VhdContainers []*string
+
+ // Specifies whether writeAccelerator should be enabled or disabled on the disk.
+ WriteAcceleratorEnabled *bool
+}
+
+// VirtualMachineScaleSetOSProfile - Describes a virtual machine scale set OS profile.
+type VirtualMachineScaleSetOSProfile struct {
+ // Specifies the password of the administrator account.
+ // Minimum-length (Windows): 8 characters
+ // Minimum-length (Linux): 6 characters
+ // Max-length (Windows): 123 characters
+ // Max-length (Linux): 72 characters
+ // Complexity requirements: 3 out of 4 conditions below need to be fulfilled
+ // Has lower characters
+ // Has upper characters
+ // Has a digit
+ // Has a special character (Regex match [\W_])
+ // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1",
+ // "Password22", "iloveyou!"
+ // For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp]
+ // For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension
+ // [https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection]
+ AdminPassword *string
+
+ // Specifies the name of the administrator account.
+ // Windows-only restriction: Cannot end in "."
+ // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123",
+ // "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest",
+ // "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".
+ // Minimum-length (Linux): 1 character
+ // Max-length (Linux): 64 characters
+ // Max-length (Windows): 20 characters
+ AdminUsername *string
+
+ // Specifies whether extension operations should be allowed on the virtual machine scale set. This may only be set to False
+ // when no extensions are present on the virtual machine scale set.
+ AllowExtensionOperations *bool
+
+ // Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to
+ // 15 characters long.
+ ComputerNamePrefix *string
+
+ // Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved
+ // as a file on the Virtual Machine. The maximum length of the binary array is
+ // 65535 bytes. For using cloud-init for your VM, see Using cloud-init to customize a Linux VM during creation [https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init]
+ CustomData *string
+
+ // Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see
+ // Linux on Azure-Endorsed Distributions
+ // [https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros].
+ LinuxConfiguration *LinuxConfiguration
+
+ // Optional property which must either be set to True or omitted.
+ RequireGuestProvisionSignal *bool
+
+ // Specifies set of certificates that should be installed onto the virtual machines in the scale set. To install certificates
+ // on a virtual machine it is recommended to use the Azure Key Vault virtual
+ // machine extension for Linux [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure
+ // Key Vault virtual machine extension for Windows
+ // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows].
+ Secrets []*VaultSecretGroup
+
+ // Specifies Windows operating system settings on the virtual machine.
+ WindowsConfiguration *WindowsConfiguration
+}
+
+// VirtualMachineScaleSetProperties - Describes the properties of a Virtual Machine Scale Set.
+type VirtualMachineScaleSetProperties struct {
+ // Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance:
+ // whether the Virtual Machines have the capability to support attaching
+ // managed data disks with UltraSSD_LRS storage account type.
+ AdditionalCapabilities *AdditionalCapabilities
+
+ // Policy for automatic repairs.
+ AutomaticRepairsPolicy *AutomaticRepairsPolicy
+
+ // Optional property which must either be set to True or omitted.
+ ConstrainedMaximumCapacity *bool
+
+ // When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This
+ // property will hence ensure that the extensions do not run on the extra
+ // overprovisioned VMs.
+ DoNotRunExtensionsOnOverprovisionedVMs *bool
+
+ // Specifies information about the dedicated host group that the virtual machine scale set resides in. Minimum api-version:
+ // 2020-06-01.
+ HostGroup *SubResource
+
+ // Specifies the orchestration mode for the virtual machine scale set.
+ OrchestrationMode *OrchestrationMode
+
+ // Specifies whether the Virtual Machine Scale Set should be overprovisioned.
+ Overprovision *bool
+
+ // Fault Domain count for each placement group.
+ PlatformFaultDomainCount *int32
+
+ // Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance.
+ PriorityMixPolicy *PriorityMixPolicy
+
+ // Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. Minimum
+ // api-version: 2018-04-01.
+ ProximityPlacementGroup *SubResource
+
+ // Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set.
+ ScaleInPolicy *ScaleInPolicy
+
+ // When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup
+ // is true, it may be modified to false. However, if singlePlacementGroup
+ // is false, it may not be modified to true.
+ SinglePlacementGroup *bool
+
+ // Specifies the Spot Restore properties for the virtual machine scale set.
+ SpotRestorePolicy *SpotRestorePolicy
+
+ // The upgrade policy.
+ UpgradePolicy *UpgradePolicy
+
+ // The virtual machine profile.
+ VirtualMachineProfile *VirtualMachineScaleSetVMProfile
+
+ // Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property
+ // can only be set if the zones property of the scale set contains more than
+ // one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set.
+ ZoneBalance *bool
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *string
+
+ // READ-ONLY; Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01.
+ TimeCreated *time.Time
+
+ // READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set.
+ UniqueID *string
+}
+
+// VirtualMachineScaleSetPublicIPAddressConfiguration - Describes a virtual machines scale set IP Configuration's PublicIPAddress
+// configuration
+type VirtualMachineScaleSetPublicIPAddressConfiguration struct {
+ // REQUIRED; The publicIP address configuration name.
+ Name *string
+
+ // Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration
+ Properties *VirtualMachineScaleSetPublicIPAddressConfigurationProperties
+
+ // Describes the public IP Sku. It can only be set with OrchestrationMode as Flexible.
+ SKU *PublicIPAddressSKU
+}
+
+// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings - Describes a virtual machines scale sets network configuration's
+// DNS settings.
+type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct {
+ // REQUIRED; The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels
+ // of the PublicIPAddress resources that will be created
+ DomainNameLabel *string
+
+ // The Domain name label scope.The concatenation of the hashed domain name label that generated according to the policy from
+ // domain name label scope and vm index will be the domain name labels of the
+ // PublicIPAddress resources that will be created
+ DomainNameLabelScope *DomainNameLabelScopeTypes
+}
+
+// VirtualMachineScaleSetPublicIPAddressConfigurationProperties - Describes a virtual machines scale set IP Configuration's
+// PublicIPAddress configuration
+type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct {
+ // The dns settings to be applied on the publicIP addresses .
+ DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings
+
+ // Specify what happens to the public IP when the VM is deleted
+ DeleteOption *DeleteOptions
+
+ // The list of IP tags associated with the public IP address.
+ IPTags []*VirtualMachineScaleSetIPTag
+
+ // The idle timeout of the public IP address.
+ IdleTimeoutInMinutes *int32
+
+ // Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default
+ // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
+ PublicIPAddressVersion *IPVersion
+
+ // The PublicIPPrefix from which to allocate publicIP addresses.
+ PublicIPPrefix *SubResource
+}
+
+// VirtualMachineScaleSetReimageParameters - Describes a Virtual Machine Scale Set VM Reimage Parameters.
+type VirtualMachineScaleSetReimageParameters struct {
+ // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk
+ // is reimaged to the existing version of OS Disk.
+ ExactVersion *string
+
+ // The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation
+ // being performed on all virtual machines in the virtual machine scale set.
+ InstanceIDs []*string
+
+ // Specifies information required for reimaging the non-ephemeral OS disk.
+ OSProfile *OSProfileProvisioningData
+
+ // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported
+ // for VM/VMSS with Ephemeral OS disk.
+ TempDisk *bool
+}
+
+// VirtualMachineScaleSetSKU - Describes an available virtual machine scale set sku.
+type VirtualMachineScaleSetSKU struct {
+ // READ-ONLY; Specifies the number of virtual machines in the scale set.
+ Capacity *VirtualMachineScaleSetSKUCapacity
+
+ // READ-ONLY; The type of resource the sku applies to.
+ ResourceType *string
+
+ // READ-ONLY; The Sku.
+ SKU *SKU
+}
+
+// VirtualMachineScaleSetSKUCapacity - Describes scaling information of a sku.
+type VirtualMachineScaleSetSKUCapacity struct {
+ // READ-ONLY; The default capacity.
+ DefaultCapacity *int64
+
+ // READ-ONLY; The maximum capacity that can be set.
+ Maximum *int64
+
+ // READ-ONLY; The minimum capacity.
+ Minimum *int64
+
+ // READ-ONLY; The scale type applicable to the sku.
+ ScaleType *VirtualMachineScaleSetSKUScaleType
+}
+
+// VirtualMachineScaleSetStorageProfile - Describes a virtual machine scale set storage profile.
+type VirtualMachineScaleSetStorageProfile struct {
+ // Specifies the parameters that are used to add data disks to the virtual machines in the scale set. For more information
+ // about disks, see About disks and VHDs for Azure virtual machines
+ // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview].
+ DataDisks []*VirtualMachineScaleSetDataDisk
+ DiskControllerType *string
+
+ // Specifies information about the image to use. You can specify information about platform images, marketplace images, or
+ // virtual machine images. This element is required when you want to use a platform
+ // image, marketplace image, or virtual machine image, but is not used in other creation operations.
+ ImageReference *ImageReference
+
+ // Specifies information about the operating system disk used by the virtual machines in the scale set. For more information
+ // about disks, see About disks and VHDs for Azure virtual machines
+ // [https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview].
+ OSDisk *VirtualMachineScaleSetOSDisk
+}
+
+// VirtualMachineScaleSetUpdate - Describes a Virtual Machine Scale Set.
+type VirtualMachineScaleSetUpdate struct {
+ // The identity of the virtual machine scale set, if configured.
+ Identity *VirtualMachineScaleSetIdentity
+
+ // The purchase plan when deploying a virtual machine scale set from VM Marketplace images.
+ Plan *Plan
+
+ // Describes the properties of a Virtual Machine Scale Set.
+ Properties *VirtualMachineScaleSetUpdateProperties
+
+ // The virtual machine scale set sku.
+ SKU *SKU
+
+ // Resource tags
+ Tags map[string]*string
+}
+
+// VirtualMachineScaleSetUpdateIPConfiguration - Describes a virtual machine scale set network profile's IP configuration.
+// NOTE: The subnet of a scale set may be modified as long as the original subnet and the new subnet are in the same virtual
+// network
+type VirtualMachineScaleSetUpdateIPConfiguration struct {
+ // The IP configuration name.
+ Name *string
+
+ // Describes a virtual machine scale set network profile's IP configuration properties.
+ Properties *VirtualMachineScaleSetUpdateIPConfigurationProperties
+}
+
+// VirtualMachineScaleSetUpdateIPConfigurationProperties - Describes a virtual machine scale set network profile's IP configuration
+// properties.
+type VirtualMachineScaleSetUpdateIPConfigurationProperties struct {
+ // The application gateway backend address pools.
+ ApplicationGatewayBackendAddressPools []*SubResource
+
+ // Specifies an array of references to application security group.
+ ApplicationSecurityGroups []*SubResource
+
+ // The load balancer backend address pools.
+ LoadBalancerBackendAddressPools []*SubResource
+
+ // The load balancer inbound nat pools.
+ LoadBalancerInboundNatPools []*SubResource
+
+ // Specifies the primary IP Configuration in case the network interface has more than one IP Configuration.
+ Primary *bool
+
+ // Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default
+ // is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.
+ PrivateIPAddressVersion *IPVersion
+
+ // The publicIPAddressConfiguration.
+ PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration
+
+ // The subnet.
+ Subnet *APIEntityReference
+}
+
+// VirtualMachineScaleSetUpdateNetworkConfiguration - Describes a virtual machine scale set network profile's network configurations.
+type VirtualMachineScaleSetUpdateNetworkConfiguration struct {
+ // The network configuration name.
+ Name *string
+
+ // Describes a virtual machine scale set updatable network profile's IP configuration.Use this object for updating network
+ // profile's IP Configuration.
+ Properties *VirtualMachineScaleSetUpdateNetworkConfigurationProperties
+}
+
+// VirtualMachineScaleSetUpdateNetworkConfigurationProperties - Describes a virtual machine scale set updatable network profile's
+// IP configuration.Use this object for updating network profile's IP Configuration.
+type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct {
+ // Specifies whether the Auxiliary mode is enabled for the Network Interface resource.
+ AuxiliaryMode *NetworkInterfaceAuxiliaryMode
+
+ // Specifies whether the Auxiliary sku is enabled for the Network Interface resource.
+ AuxiliarySKU *NetworkInterfaceAuxiliarySKU
+
+ // The dns settings to be applied on the network interfaces.
+ DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings
+
+ // Specify what happens to the network interface when the VM is deleted
+ DeleteOption *DeleteOptions
+
+ // Specifies whether the network interface is disabled for tcp state tracking.
+ DisableTCPStateTracking *bool
+
+ // Specifies whether the network interface is accelerated networking-enabled.
+ EnableAcceleratedNetworking *bool
+
+ // Specifies whether the network interface is FPGA networking-enabled.
+ EnableFpga *bool
+
+ // Whether IP forwarding enabled on this NIC.
+ EnableIPForwarding *bool
+
+ // The virtual machine scale set IP Configuration.
+ IPConfigurations []*VirtualMachineScaleSetUpdateIPConfiguration
+
+ // The network security group.
+ NetworkSecurityGroup *SubResource
+
+ // Whether this is a primary NIC on a virtual machine.
+ Primary *bool
+}
+
+// VirtualMachineScaleSetUpdateNetworkProfile - Describes a virtual machine scale set network profile.
+type VirtualMachineScaleSetUpdateNetworkProfile struct {
+ // A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The
+ // reference will be in the form:
+ // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'.
+ HealthProbe *APIEntityReference
+
+ // specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations
+ // for Virtual Machine Scale Set with orchestration mode 'Flexible'
+ NetworkAPIVersion *NetworkAPIVersion
+
+ // The list of network configurations.
+ NetworkInterfaceConfigurations []*VirtualMachineScaleSetUpdateNetworkConfiguration
+}
+
+// VirtualMachineScaleSetUpdateOSDisk - Describes virtual machine scale set operating system disk Update Object. This should
+// be used for Updating VMSS OS Disk.
+type VirtualMachineScaleSetUpdateOSDisk struct {
+ // The caching type.
+ Caching *CachingTypes
+
+ // Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion (This feature is available for VMSS with
+ // Flexible OrchestrationMode only).
+ // Possible values:
+ // Delete If this value is used, the OS disk is deleted when VMSS Flex VM is deleted.
+ // Detach If this value is used, the OS disk is retained after VMSS Flex VM is deleted.
+ // The default value is set to Delete. For an Ephemeral OS Disk, the default value is set to Delete. User cannot change the
+ // delete option for Ephemeral OS Disk.
+ DeleteOption *DiskDeleteOptionTypes
+
+ // Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a
+ // virtual machine image.
+ // diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023
+ DiskSizeGB *int32
+
+ // The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine.
+ // If SourceImage is provided, the destination VirtualHardDisk should not
+ // exist.
+ Image *VirtualHardDisk
+
+ // The managed disk parameters.
+ ManagedDisk *VirtualMachineScaleSetManagedDiskParameters
+
+ // The list of virtual hard disk container uris.
+ VhdContainers []*string
+
+ // Specifies whether writeAccelerator should be enabled or disabled on the disk.
+ WriteAcceleratorEnabled *bool
+}
+
+// VirtualMachineScaleSetUpdateOSProfile - Describes a virtual machine scale set OS profile.
+type VirtualMachineScaleSetUpdateOSProfile struct {
+ // A base-64 encoded string of custom data.
+ CustomData *string
+
+ // The Linux Configuration of the OS profile.
+ LinuxConfiguration *LinuxConfiguration
+
+ // The List of certificates for addition to the VM.
+ Secrets []*VaultSecretGroup
+
+ // The Windows Configuration of the OS profile.
+ WindowsConfiguration *WindowsConfiguration
+}
+
+// VirtualMachineScaleSetUpdateProperties - Describes the properties of a Virtual Machine Scale Set.
+type VirtualMachineScaleSetUpdateProperties struct {
+ // Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance:
+ // whether the Virtual Machines have the capability to support attaching
+ // managed data disks with UltraSSD_LRS storage account type.
+ AdditionalCapabilities *AdditionalCapabilities
+
+ // Policy for automatic repairs.
+ AutomaticRepairsPolicy *AutomaticRepairsPolicy
+
+ // When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This
+ // property will hence ensure that the extensions do not run on the extra
+ // overprovisioned VMs.
+ DoNotRunExtensionsOnOverprovisionedVMs *bool
+
+ // Specifies whether the Virtual Machine Scale Set should be overprovisioned.
+ Overprovision *bool
+
+ // Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance.
+ PriorityMixPolicy *PriorityMixPolicy
+
+ // Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.
+ // Minimum api-version: 2018-04-01.
+ ProximityPlacementGroup *SubResource
+
+ // Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set.
+ ScaleInPolicy *ScaleInPolicy
+
+ // When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup
+ // is true, it may be modified to false. However, if singlePlacementGroup
+ // is false, it may not be modified to true.
+ SinglePlacementGroup *bool
+
+ // Specifies the Spot Restore properties for the virtual machine scale set.
+ SpotRestorePolicy *SpotRestorePolicy
+
+ // The upgrade policy.
+ UpgradePolicy *UpgradePolicy
+
+ // The virtual machine profile.
+ VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile
+}
+
+// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration - Describes a virtual machines scale set IP Configuration's PublicIPAddress
+// configuration
+type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct {
+ // The publicIP address configuration name.
+ Name *string
+
+ // Describes a virtual machines scale set IP Configuration's PublicIPAddress configuration
+ Properties *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties
+}
+
+// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties - Describes a virtual machines scale set IP Configuration's
+// PublicIPAddress configuration
+type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct {
+ // The dns settings to be applied on the publicIP addresses .
+ DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings
+
+ // Specify what happens to the public IP when the VM is deleted
+ DeleteOption *DeleteOptions
+
+ // The idle timeout of the public IP address.
+ IdleTimeoutInMinutes *int32
+
+ // The PublicIPPrefix from which to allocate publicIP addresses.
+ PublicIPPrefix *SubResource
+}
+
+// VirtualMachineScaleSetUpdateStorageProfile - Describes a virtual machine scale set storage profile.
+type VirtualMachineScaleSetUpdateStorageProfile struct {
+ // The data disks.
+ DataDisks []*VirtualMachineScaleSetDataDisk
+ DiskControllerType *string
+
+ // The image reference.
+ ImageReference *ImageReference
+
+ // The OS disk.
+ OSDisk *VirtualMachineScaleSetUpdateOSDisk
+}
+
+// VirtualMachineScaleSetUpdateVMProfile - Describes a virtual machine scale set virtual machine profile.
+type VirtualMachineScaleSetUpdateVMProfile struct {
+ // Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01.
+ BillingProfile *BillingProfile
+
+ // The virtual machine scale set diagnostics profile.
+ DiagnosticsProfile *DiagnosticsProfile
+
+ // The virtual machine scale set extension profile.
+ ExtensionProfile *VirtualMachineScaleSetExtensionProfile
+
+ // Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01.
+ HardwareProfile *VirtualMachineScaleSetHardwareProfile
+
+ // The license type, which is for bring your own license scenario.
+ LicenseType *string
+
+ // The virtual machine scale set network profile.
+ NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile
+
+ // The virtual machine scale set OS profile.
+ OSProfile *VirtualMachineScaleSetUpdateOSProfile
+
+ // Specifies Scheduled Event related configurations.
+ ScheduledEventsProfile *ScheduledEventsProfile
+
+ // The virtual machine scale set Security profile
+ SecurityProfile *SecurityProfile
+
+ // The virtual machine scale set storage profile.
+ StorageProfile *VirtualMachineScaleSetUpdateStorageProfile
+
+ // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here.
+ // Minimum api-version: 2021-03-01
+ UserData *string
+}
+
+// VirtualMachineScaleSetVM - Describes a virtual machine scale set virtual machine.
+type VirtualMachineScaleSetVM struct {
+ // REQUIRED; Resource location
+ Location *string
+
+ // The identity of the virtual machine, if configured.
+ Identity *VirtualMachineIdentity
+
+ // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace
+ // images. Before you can use a marketplace image from an API, you must
+ // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click
+ // Want to deploy programmatically, Get Started ->. Enter any required
+ // information and then click Save.
+ Plan *Plan
+
+ // Describes the properties of a virtual machine scale set virtual machine.
+ Properties *VirtualMachineScaleSetVMProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; The virtual machine instance ID.
+ InstanceID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; The virtual machine child extension resources.
+ Resources []*VirtualMachineExtension
+
+ // READ-ONLY; The virtual machine SKU.
+ SKU *SKU
+
+ // READ-ONLY; Resource type
+ Type *string
+
+ // READ-ONLY; The virtual machine zones.
+ Zones []*string
+}
+
+// VirtualMachineScaleSetVMExtension - Describes a VMSS VM Extension.
+type VirtualMachineScaleSetVMExtension struct {
+ // The location of the extension.
+ Location *string
+
+ // Describes the properties of a Virtual Machine Extension.
+ Properties *VirtualMachineExtensionProperties
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; The name of the extension.
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// VirtualMachineScaleSetVMExtensionUpdate - Describes a VMSS VM Extension.
+type VirtualMachineScaleSetVMExtensionUpdate struct {
+ // Describes the properties of a Virtual Machine Extension.
+ Properties *VirtualMachineExtensionUpdateProperties
+
+ // READ-ONLY; Resource Id
+ ID *string
+
+ // READ-ONLY; The name of the extension.
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// VirtualMachineScaleSetVMExtensionsListResult - The List VMSS VM Extension operation response
+type VirtualMachineScaleSetVMExtensionsListResult struct {
+ // The list of VMSS VM extensions
+ Value []*VirtualMachineScaleSetVMExtension
+}
+
+// VirtualMachineScaleSetVMExtensionsSummary - Extensions summary for virtual machines of a virtual machine scale set.
+type VirtualMachineScaleSetVMExtensionsSummary struct {
+ // READ-ONLY; The extension name.
+ Name *string
+
+ // READ-ONLY; The extensions information.
+ StatusesSummary []*VirtualMachineStatusCodeCount
+}
+
+// VirtualMachineScaleSetVMInstanceIDs - Specifies a list of virtual machine instance IDs from the VM scale set.
+type VirtualMachineScaleSetVMInstanceIDs struct {
+ // The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation
+ // being performed on all virtual machines in the virtual machine scale set.
+ InstanceIDs []*string
+}
+
+// VirtualMachineScaleSetVMInstanceRequiredIDs - Specifies a list of virtual machine instance IDs from the VM scale set.
+type VirtualMachineScaleSetVMInstanceRequiredIDs struct {
+ // REQUIRED; The virtual machine scale set instance ids.
+ InstanceIDs []*string
+}
+
+// VirtualMachineScaleSetVMInstanceView - The instance view of a virtual machine scale set VM.
+type VirtualMachineScaleSetVMInstanceView struct {
+ // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. You
+ // can easily view the output of your console log. Azure also enables you to see
+ // a screenshot of the VM from the hypervisor.
+ BootDiagnostics *BootDiagnosticsInstanceView
+
+ // Specifies the host OS name of the virtual machine.
+ // This name cannot be updated after the VM is created.
+ // Max-length (Windows): 15 characters
+ // Max-length (Linux): 64 characters.
+ // For naming conventions and restrictions see Azure infrastructure services implementation guidelines
+ // [https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions].
+ ComputerName *string
+
+ // The disks information.
+ Disks []*DiskInstanceView
+
+ // The extensions information.
+ Extensions []*VirtualMachineExtensionInstanceView
+
+ // The hypervisor generation of the Virtual Machine [V1, V2]
+ HyperVGeneration *HyperVGeneration
+
+ // The Maintenance Operation status on the virtual machine.
+ MaintenanceRedeployStatus *MaintenanceRedeployStatus
+
+ // The Operating System running on the hybrid machine.
+ OSName *string
+
+ // The version of Operating System running on the hybrid machine.
+ OSVersion *string
+
+ // The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId.
+ PlacementGroupID *string
+
+ // The Fault Domain count.
+ PlatformFaultDomain *int32
+
+ // The Update Domain count.
+ PlatformUpdateDomain *int32
+
+ // The Remote desktop certificate thumbprint.
+ RdpThumbPrint *string
+
+ // The resource status information.
+ Statuses []*InstanceViewStatus
+
+ // The VM Agent running on the virtual machine.
+ VMAgent *VirtualMachineAgentInstanceView
+
+ // READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when
+ // the virtual machine is associated with a dedicated host group that has automatic
+ // placement enabled. Minimum api-version: 2020-06-01.
+ AssignedHost *string
+
+ // READ-ONLY; The health status for the VM.
+ VMHealth *VirtualMachineHealthStatus
+}
+
+// VirtualMachineScaleSetVMListResult - The List Virtual Machine Scale Set VMs operation response.
+type VirtualMachineScaleSetVMListResult struct {
+ // REQUIRED; The list of virtual machine scale sets VMs.
+ Value []*VirtualMachineScaleSetVM
+
+ // The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS
+ // VMs
+ NextLink *string
+}
+
+// VirtualMachineScaleSetVMNetworkProfileConfiguration - Describes a virtual machine scale set VM network profile.
+type VirtualMachineScaleSetVMNetworkProfileConfiguration struct {
+ // The list of network configurations.
+ NetworkInterfaceConfigurations []*VirtualMachineScaleSetNetworkConfiguration
+}
+
+// VirtualMachineScaleSetVMProfile - Describes a virtual machine scale set virtual machine profile.
+type VirtualMachineScaleSetVMProfile struct {
+ // Specifies the gallery applications that should be made available to the VM/VMSS
+ ApplicationProfile *ApplicationProfile
+
+ // Specifies the billing related details of a Azure Spot VMSS. Minimum api-version: 2019-03-01.
+ BillingProfile *BillingProfile
+
+ // Specifies the capacity reservation related details of a scale set. Minimum api-version: 2021-04-01.
+ CapacityReservation *CapacityReservationProfile
+
+ // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.
+ DiagnosticsProfile *DiagnosticsProfile
+
+ // Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines,
+ // both 'Deallocate' and 'Delete' are supported and the minimum api-version is
+ // 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview.
+ EvictionPolicy *VirtualMachineEvictionPolicyTypes
+
+ // Specifies a collection of settings for extensions installed on virtual machines in the scale set.
+ ExtensionProfile *VirtualMachineScaleSetExtensionProfile
+
+ // Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01.
+ HardwareProfile *VirtualMachineScaleSetHardwareProfile
+
+ // Specifies that the image or disk that is being used was licensed on-premises.
+ // Possible values for Windows Server operating system are:
+ // WindowsClient
+ // WindowsServer
+ // Possible values for Linux Server operating system are:
+ // RHELBYOS (for RHEL)
+ // SLESBYOS (for SUSE)
+ // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing]
+ // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux]
+ // Minimum api-version: 2015-06-15
+ LicenseType *string
+
+ // Specifies properties of the network interfaces of the virtual machines in the scale set.
+ NetworkProfile *VirtualMachineScaleSetNetworkProfile
+
+ // Specifies the operating system settings for the virtual machines in the scale set.
+ OSProfile *VirtualMachineScaleSetOSProfile
+
+ // Specifies the priority for the virtual machines in the scale set. Minimum api-version: 2017-10-30-preview.
+ Priority *VirtualMachinePriorityTypes
+
+ // Specifies Scheduled Event related configurations.
+ ScheduledEventsProfile *ScheduledEventsProfile
+
+ // Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01
+ SecurityPostureReference *SecurityPostureReference
+
+ // Specifies the Security related profile settings for the virtual machines in the scale set.
+ SecurityProfile *SecurityProfile
+
+ // Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when
+ // using 'latest' image version. Minimum api-version: 2022-11-01
+ ServiceArtifactReference *ServiceArtifactReference
+
+ // Specifies the storage settings for the virtual machine disks.
+ StorageProfile *VirtualMachineScaleSetStorageProfile
+
+ // UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets
+ // in here. Minimum api-version: 2021-03-01.
+ UserData *string
+}
+
+// VirtualMachineScaleSetVMProperties - Describes the properties of a virtual machine scale set virtual machine.
+type VirtualMachineScaleSetVMProperties struct {
+ // Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the
+ // virtual machine has the capability to support attaching managed data disks with
+ // UltraSSD_LRS storage account type.
+ AdditionalCapabilities *AdditionalCapabilities
+
+ // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified
+ // in the same availability set are allocated to different nodes to maximize
+ // availability. For more information about availability sets, see Availability sets overview [https://docs.microsoft.com/azure/virtual-machines/availability-set-overview].
+ // For more information on Azure
+ // planned maintenance, see Maintenance and updates for Virtual Machines in Azure [https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates].
+ // Currently, a VM can only be added to
+ // availability set at creation time. An existing VM cannot be added to an availability set.
+ AvailabilitySet *SubResource
+
+ // Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.
+ DiagnosticsProfile *DiagnosticsProfile
+
+ // Specifies the hardware settings for the virtual machine.
+ HardwareProfile *HardwareProfile
+
+ // Specifies that the image or disk that is being used was licensed on-premises.
+ // Possible values for Windows Server operating system are:
+ // WindowsClient
+ // WindowsServer
+ // Possible values for Linux Server operating system are:
+ // RHELBYOS (for RHEL)
+ // SLESBYOS (for SUSE)
+ // For more information, see Azure Hybrid Use Benefit for Windows Server [https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing]
+ // Azure Hybrid Use Benefit for Linux Server [https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux]
+ // Minimum api-version: 2015-06-15
+ LicenseType *string
+
+ // Specifies the network interfaces of the virtual machine.
+ NetworkProfile *NetworkProfile
+
+ // Specifies the network profile configuration of the virtual machine.
+ NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration
+
+ // Specifies the operating system settings for the virtual machine.
+ OSProfile *OSProfile
+
+ // Specifies the protection policy of the virtual machine.
+ ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy
+
+ // Specifies the Security related profile settings for the virtual machine.
+ SecurityProfile *SecurityProfile
+
+ // Specifies the storage settings for the virtual machine disks.
+ StorageProfile *StorageProfile
+
+ // UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here.
+ // Minimum api-version: 2021-03-01
+ UserData *string
+
+ // READ-ONLY; The virtual machine instance view.
+ InstanceView *VirtualMachineScaleSetVMInstanceView
+
+ // READ-ONLY; Specifies whether the latest model has been applied to the virtual machine.
+ LatestModelApplied *bool
+
+ // READ-ONLY; Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or
+ // the customized model for the virtual machine.
+ ModelDefinitionApplied *string
+
+ // READ-ONLY; The provisioning state, which only appears in the response.
+ ProvisioningState *string
+
+ // READ-ONLY; Specifies the time at which the Virtual Machine resource was created.
+ // Minimum api-version: 2021-11-01.
+ TimeCreated *time.Time
+
+ // READ-ONLY; Azure VM unique ID.
+ VMID *string
+}
+
+// VirtualMachineScaleSetVMProtectionPolicy - The protection policy of a virtual machine scale set VM.
+type VirtualMachineScaleSetVMProtectionPolicy struct {
+ // Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation.
+ ProtectFromScaleIn *bool
+
+ // Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied
+ // to the virtual machine scale set VM.
+ ProtectFromScaleSetActions *bool
+}
+
+// VirtualMachineScaleSetVMReimageParameters - Describes a Virtual Machine Scale Set VM Reimage Parameters.
+type VirtualMachineScaleSetVMReimageParameters struct {
+ // Specifies in decimal number, the version the OS disk should be reimaged to. If exact version is not provided, the OS disk
+ // is reimaged to the existing version of OS Disk.
+ ExactVersion *string
+
+ // Specifies information required for reimaging the non-ephemeral OS disk.
+ OSProfile *OSProfileProvisioningData
+
+ // Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported
+ // for VM/VMSS with Ephemeral OS disk.
+ TempDisk *bool
+}
+
+// VirtualMachineSize - Describes the properties of a VM size.
+type VirtualMachineSize struct {
+ // The maximum number of data disks that can be attached to the virtual machine size.
+ MaxDataDiskCount *int32
+
+ // The amount of memory, in MB, supported by the virtual machine size.
+ MemoryInMB *int32
+
+ // The name of the virtual machine size.
+ Name *string
+
+ // The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number represents
+ // the total vCPUs of quota that the VM uses. For accurate vCPU count, please
+ // refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or https://docs.microsoft.com/rest/api/compute/resourceskus/list
+ NumberOfCores *int32
+
+ // The OS disk size, in MB, allowed by the virtual machine size.
+ OSDiskSizeInMB *int32
+
+ // The resource disk size, in MB, allowed by the virtual machine size.
+ ResourceDiskSizeInMB *int32
+}
+
+// VirtualMachineSizeListResult - The List Virtual Machine operation response.
+type VirtualMachineSizeListResult struct {
+ // The list of virtual machine sizes.
+ Value []*VirtualMachineSize
+}
+
+// VirtualMachineSoftwarePatchProperties - Describes the properties of a Virtual Machine software patch.
+type VirtualMachineSoftwarePatchProperties struct {
+ // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension
+ // logs.
+ ActivityID *string
+
+ // READ-ONLY; Describes the availability of a given patch.
+ AssessmentState *PatchAssessmentState
+
+ // READ-ONLY; The classification(s) of the patch as provided by the patch publisher.
+ Classifications []*string
+
+ // READ-ONLY; The KBID of the patch. Only applies to Windows patches.
+ KbID *string
+
+ // READ-ONLY; The UTC timestamp of the last update to this patch record.
+ LastModifiedDateTime *time.Time
+
+ // READ-ONLY; The friendly name of the patch.
+ Name *string
+
+ // READ-ONLY; A unique identifier for the patch.
+ PatchID *string
+
+ // READ-ONLY; The UTC timestamp when the repository published this patch.
+ PublishedDate *time.Time
+
+ // READ-ONLY; Describes the reboot requirements of the patch.
+ RebootBehavior *VMGuestPatchRebootBehavior
+
+ // READ-ONLY; The version number of the patch. This property applies only to Linux patches.
+ Version *string
+}
+
+// VirtualMachineStatusCodeCount - The status code and count of the virtual machine scale set instance view status summary.
+type VirtualMachineStatusCodeCount struct {
+ // READ-ONLY; The instance view status code.
+ Code *string
+
+ // READ-ONLY; The number of instances having a particular status code.
+ Count *int32
+}
+
+// VirtualMachineUpdate - Describes a Virtual Machine Update.
+type VirtualMachineUpdate struct {
+ // The identity of the virtual machine, if configured.
+ Identity *VirtualMachineIdentity
+
+ // Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace
+ // images. Before you can use a marketplace image from an API, you must
+ // enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click
+ // Want to deploy programmatically, Get Started ->. Enter any required
+ // information and then click Save.
+ Plan *Plan
+
+ // Describes the properties of a Virtual Machine.
+ Properties *VirtualMachineProperties
+
+ // Resource tags
+ Tags map[string]*string
+
+ // The virtual machine zones.
+ Zones []*string
+}
+
+// WinRMConfiguration - Describes Windows Remote Management configuration of the VM
+type WinRMConfiguration struct {
+ // The list of Windows Remote Management listeners
+ Listeners []*WinRMListener
+}
+
+// WinRMListener - Describes Protocol and thumbprint of Windows Remote Management listener
+type WinRMListener struct {
+ // This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault,
+ // see Add a key or secret to the key vault
+ // [https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add]. In this case, your certificate needs to be the
+ // Base64 encoding of the following JSON Object which is encoded in UTF-8:
+ // {
+ // "data":"",
+ // "dataType":"pfx",
+ // "password":""
+ // }
+ // To install certificates on a virtual machine it is recommended to use the Azure Key Vault virtual machine extension for
+ // Linux
+ // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux] or the Azure Key Vault virtual machine extension
+ // for Windows
+ // [https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows].
+ CertificateURL *string
+
+ // Specifies the protocol of WinRM listener. Possible values are: http, https.
+ Protocol *ProtocolTypes
+}
+
+// WindowsConfiguration - Specifies Windows operating system settings on the virtual machine.
+type WindowsConfiguration struct {
+ // Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is
+ // used by Windows Setup.
+ AdditionalUnattendContent []*AdditionalUnattendContent
+
+ // Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. For virtual machine
+ // scale sets, this property can be updated and updates will take effect on OS
+ // reprovisioning.
+ EnableAutomaticUpdates *bool
+
+ // Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false.
+ EnableVMAgentPlatformUpdates *bool
+
+ // [Preview Feature] Specifies settings related to VM Guest Patching on Windows.
+ PatchSettings *PatchSettings
+
+ // Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified
+ // in the request body, it is set to true by default. This will ensure that VM
+ // Agent is installed on the VM so that extensions can be added to the VM later.
+ ProvisionVMAgent *bool
+
+ // Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible values can be TimeZoneInfo.Id
+ // [https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id] value from time zones returned by
+ // TimeZoneInfo.GetSystemTimeZones
+ // [https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones].
+ TimeZone *string
+
+ // Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell.
+ WinRM *WinRMConfiguration
+}
+
+// WindowsParameters - Input for InstallPatches on a Windows VM, as directly received by the API
+type WindowsParameters struct {
+ // The update classifications to select when installing patches for Windows.
+ ClassificationsToInclude []*VMGuestPatchClassificationWindows
+
+ // Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true.
+ ExcludeKbsRequiringReboot *bool
+
+ // Kbs to exclude in the patch operation
+ KbNumbersToExclude []*string
+
+ // Kbs to include in the patch operation
+ KbNumbersToInclude []*string
+
+ // This is used to install patches that were published on or before this given max published date.
+ MaxPatchPublishDate *time.Time
+}
+
+// WindowsVMGuestPatchAutomaticByPlatformSettings - Specifies additional settings to be applied when patch mode AutomaticByPlatform
+// is selected in Windows patch settings.
+type WindowsVMGuestPatchAutomaticByPlatformSettings struct {
+ // Enables customer to schedule patching without accidental upgrades
+ BypassPlatformSafetyChecksOnUserSchedule *bool
+
+ // Specifies the reboot setting for all AutomaticByPlatform patch installation operations.
+ RebootSetting *WindowsVMGuestPatchAutomaticByPlatformRebootSetting
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.go
new file mode 100644
index 000000000..08c5d8c40
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.go
@@ -0,0 +1,19156 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+)
+
+// MarshalJSON implements the json.Marshaller interface for type APIEntityReference.
+func (a APIEntityReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", a.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type APIEntityReference.
+func (a *APIEntityReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &a.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type APIError.
+func (a APIError) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "code", a.Code)
+ populate(objectMap, "details", a.Details)
+ populate(objectMap, "innererror", a.Innererror)
+ populate(objectMap, "message", a.Message)
+ populate(objectMap, "target", a.Target)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type APIError.
+func (a *APIError) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "code":
+ err = unpopulate(val, "Code", &a.Code)
+ delete(rawMsg, key)
+ case "details":
+ err = unpopulate(val, "Details", &a.Details)
+ delete(rawMsg, key)
+ case "innererror":
+ err = unpopulate(val, "Innererror", &a.Innererror)
+ delete(rawMsg, key)
+ case "message":
+ err = unpopulate(val, "Message", &a.Message)
+ delete(rawMsg, key)
+ case "target":
+ err = unpopulate(val, "Target", &a.Target)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type APIErrorBase.
+func (a APIErrorBase) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "code", a.Code)
+ populate(objectMap, "message", a.Message)
+ populate(objectMap, "target", a.Target)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type APIErrorBase.
+func (a *APIErrorBase) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "code":
+ err = unpopulate(val, "Code", &a.Code)
+ delete(rawMsg, key)
+ case "message":
+ err = unpopulate(val, "Message", &a.Message)
+ delete(rawMsg, key)
+ case "target":
+ err = unpopulate(val, "Target", &a.Target)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccessURI.
+func (a AccessURI) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessSAS", a.AccessSAS)
+ populate(objectMap, "securityDataAccessSAS", a.SecurityDataAccessSAS)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccessURI.
+func (a *AccessURI) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessSAS":
+ err = unpopulate(val, "AccessSAS", &a.AccessSAS)
+ delete(rawMsg, key)
+ case "securityDataAccessSAS":
+ err = unpopulate(val, "SecurityDataAccessSAS", &a.SecurityDataAccessSAS)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AdditionalCapabilities.
+func (a AdditionalCapabilities) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "hibernationEnabled", a.HibernationEnabled)
+ populate(objectMap, "ultraSSDEnabled", a.UltraSSDEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalCapabilities.
+func (a *AdditionalCapabilities) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "hibernationEnabled":
+ err = unpopulate(val, "HibernationEnabled", &a.HibernationEnabled)
+ delete(rawMsg, key)
+ case "ultraSSDEnabled":
+ err = unpopulate(val, "UltraSSDEnabled", &a.UltraSSDEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AdditionalUnattendContent.
+func (a AdditionalUnattendContent) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ objectMap["componentName"] = "Microsoft-Windows-Shell-Setup"
+ populate(objectMap, "content", a.Content)
+ objectMap["passName"] = "OobeSystem"
+ populate(objectMap, "settingName", a.SettingName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalUnattendContent.
+func (a *AdditionalUnattendContent) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "componentName":
+ err = unpopulate(val, "ComponentName", &a.ComponentName)
+ delete(rawMsg, key)
+ case "content":
+ err = unpopulate(val, "Content", &a.Content)
+ delete(rawMsg, key)
+ case "passName":
+ err = unpopulate(val, "PassName", &a.PassName)
+ delete(rawMsg, key)
+ case "settingName":
+ err = unpopulate(val, "SettingName", &a.SettingName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AlternativeOption.
+func (a AlternativeOption) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "type", a.Type)
+ populate(objectMap, "value", a.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AlternativeOption.
+func (a *AlternativeOption) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &a.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ApplicationProfile.
+func (a ApplicationProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "galleryApplications", a.GalleryApplications)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProfile.
+func (a *ApplicationProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "galleryApplications":
+ err = unpopulate(val, "GalleryApplications", &a.GalleryApplications)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AutomaticOSUpgradePolicy.
+func (a AutomaticOSUpgradePolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "disableAutomaticRollback", a.DisableAutomaticRollback)
+ populate(objectMap, "enableAutomaticOSUpgrade", a.EnableAutomaticOSUpgrade)
+ populate(objectMap, "useRollingUpgradePolicy", a.UseRollingUpgradePolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticOSUpgradePolicy.
+func (a *AutomaticOSUpgradePolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "disableAutomaticRollback":
+ err = unpopulate(val, "DisableAutomaticRollback", &a.DisableAutomaticRollback)
+ delete(rawMsg, key)
+ case "enableAutomaticOSUpgrade":
+ err = unpopulate(val, "EnableAutomaticOSUpgrade", &a.EnableAutomaticOSUpgrade)
+ delete(rawMsg, key)
+ case "useRollingUpgradePolicy":
+ err = unpopulate(val, "UseRollingUpgradePolicy", &a.UseRollingUpgradePolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AutomaticOSUpgradeProperties.
+func (a AutomaticOSUpgradeProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "automaticOSUpgradeSupported", a.AutomaticOSUpgradeSupported)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticOSUpgradeProperties.
+func (a *AutomaticOSUpgradeProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "automaticOSUpgradeSupported":
+ err = unpopulate(val, "AutomaticOSUpgradeSupported", &a.AutomaticOSUpgradeSupported)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AutomaticRepairsPolicy.
+func (a AutomaticRepairsPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", a.Enabled)
+ populate(objectMap, "gracePeriod", a.GracePeriod)
+ populate(objectMap, "repairAction", a.RepairAction)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticRepairsPolicy.
+func (a *AutomaticRepairsPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &a.Enabled)
+ delete(rawMsg, key)
+ case "gracePeriod":
+ err = unpopulate(val, "GracePeriod", &a.GracePeriod)
+ delete(rawMsg, key)
+ case "repairAction":
+ err = unpopulate(val, "RepairAction", &a.RepairAction)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AvailabilitySet.
+func (a AvailabilitySet) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", a.ID)
+ populate(objectMap, "location", a.Location)
+ populate(objectMap, "name", a.Name)
+ populate(objectMap, "properties", a.Properties)
+ populate(objectMap, "sku", a.SKU)
+ populate(objectMap, "tags", a.Tags)
+ populate(objectMap, "type", a.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySet.
+func (a *AvailabilitySet) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &a.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &a.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &a.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &a.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &a.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &a.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AvailabilitySetListResult.
+func (a AvailabilitySetListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", a.NextLink)
+ populate(objectMap, "value", a.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetListResult.
+func (a *AvailabilitySetListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &a.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &a.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AvailabilitySetProperties.
+func (a AvailabilitySetProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "platformFaultDomainCount", a.PlatformFaultDomainCount)
+ populate(objectMap, "platformUpdateDomainCount", a.PlatformUpdateDomainCount)
+ populate(objectMap, "proximityPlacementGroup", a.ProximityPlacementGroup)
+ populate(objectMap, "statuses", a.Statuses)
+ populate(objectMap, "virtualMachines", a.VirtualMachines)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetProperties.
+func (a *AvailabilitySetProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "platformFaultDomainCount":
+ err = unpopulate(val, "PlatformFaultDomainCount", &a.PlatformFaultDomainCount)
+ delete(rawMsg, key)
+ case "platformUpdateDomainCount":
+ err = unpopulate(val, "PlatformUpdateDomainCount", &a.PlatformUpdateDomainCount)
+ delete(rawMsg, key)
+ case "proximityPlacementGroup":
+ err = unpopulate(val, "ProximityPlacementGroup", &a.ProximityPlacementGroup)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &a.Statuses)
+ delete(rawMsg, key)
+ case "virtualMachines":
+ err = unpopulate(val, "VirtualMachines", &a.VirtualMachines)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AvailabilitySetUpdate.
+func (a AvailabilitySetUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", a.Properties)
+ populate(objectMap, "sku", a.SKU)
+ populate(objectMap, "tags", a.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AvailabilitySetUpdate.
+func (a *AvailabilitySetUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &a.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &a.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &a.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AvailablePatchSummary.
+func (a AvailablePatchSummary) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "assessmentActivityId", a.AssessmentActivityID)
+ populate(objectMap, "criticalAndSecurityPatchCount", a.CriticalAndSecurityPatchCount)
+ populate(objectMap, "error", a.Error)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", a.LastModifiedTime)
+ populate(objectMap, "otherPatchCount", a.OtherPatchCount)
+ populate(objectMap, "rebootPending", a.RebootPending)
+ populateDateTimeRFC3339(objectMap, "startTime", a.StartTime)
+ populate(objectMap, "status", a.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AvailablePatchSummary.
+func (a *AvailablePatchSummary) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "assessmentActivityId":
+ err = unpopulate(val, "AssessmentActivityID", &a.AssessmentActivityID)
+ delete(rawMsg, key)
+ case "criticalAndSecurityPatchCount":
+ err = unpopulate(val, "CriticalAndSecurityPatchCount", &a.CriticalAndSecurityPatchCount)
+ delete(rawMsg, key)
+ case "error":
+ err = unpopulate(val, "Error", &a.Error)
+ delete(rawMsg, key)
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &a.LastModifiedTime)
+ delete(rawMsg, key)
+ case "otherPatchCount":
+ err = unpopulate(val, "OtherPatchCount", &a.OtherPatchCount)
+ delete(rawMsg, key)
+ case "rebootPending":
+ err = unpopulate(val, "RebootPending", &a.RebootPending)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulateDateTimeRFC3339(val, "StartTime", &a.StartTime)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &a.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BillingProfile.
+func (b BillingProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "maxPrice", b.MaxPrice)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BillingProfile.
+func (b *BillingProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "maxPrice":
+ err = unpopulate(val, "MaxPrice", &b.MaxPrice)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BootDiagnostics.
+func (b BootDiagnostics) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", b.Enabled)
+ populate(objectMap, "storageUri", b.StorageURI)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BootDiagnostics.
+func (b *BootDiagnostics) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &b.Enabled)
+ delete(rawMsg, key)
+ case "storageUri":
+ err = unpopulate(val, "StorageURI", &b.StorageURI)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BootDiagnosticsInstanceView.
+func (b BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "consoleScreenshotBlobUri", b.ConsoleScreenshotBlobURI)
+ populate(objectMap, "serialConsoleLogBlobUri", b.SerialConsoleLogBlobURI)
+ populate(objectMap, "status", b.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BootDiagnosticsInstanceView.
+func (b *BootDiagnosticsInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "consoleScreenshotBlobUri":
+ err = unpopulate(val, "ConsoleScreenshotBlobURI", &b.ConsoleScreenshotBlobURI)
+ delete(rawMsg, key)
+ case "serialConsoleLogBlobUri":
+ err = unpopulate(val, "SerialConsoleLogBlobURI", &b.SerialConsoleLogBlobURI)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &b.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservation.
+func (c CapacityReservation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", c.ID)
+ populate(objectMap, "location", c.Location)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "properties", c.Properties)
+ populate(objectMap, "sku", c.SKU)
+ populate(objectMap, "tags", c.Tags)
+ populate(objectMap, "type", c.Type)
+ populate(objectMap, "zones", c.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservation.
+func (c *CapacityReservation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &c.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &c.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &c.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &c.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &c.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &c.Type)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &c.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroup.
+func (c CapacityReservationGroup) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", c.ID)
+ populate(objectMap, "location", c.Location)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "properties", c.Properties)
+ populate(objectMap, "tags", c.Tags)
+ populate(objectMap, "type", c.Type)
+ populate(objectMap, "zones", c.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroup.
+func (c *CapacityReservationGroup) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &c.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &c.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &c.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &c.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &c.Type)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &c.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupInstanceView.
+func (c CapacityReservationGroupInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capacityReservations", c.CapacityReservations)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupInstanceView.
+func (c *CapacityReservationGroupInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capacityReservations":
+ err = unpopulate(val, "CapacityReservations", &c.CapacityReservations)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupListResult.
+func (c CapacityReservationGroupListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", c.NextLink)
+ populate(objectMap, "value", c.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupListResult.
+func (c *CapacityReservationGroupListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &c.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &c.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupProperties.
+func (c CapacityReservationGroupProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capacityReservations", c.CapacityReservations)
+ populate(objectMap, "instanceView", c.InstanceView)
+ populate(objectMap, "virtualMachinesAssociated", c.VirtualMachinesAssociated)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupProperties.
+func (c *CapacityReservationGroupProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capacityReservations":
+ err = unpopulate(val, "CapacityReservations", &c.CapacityReservations)
+ delete(rawMsg, key)
+ case "instanceView":
+ err = unpopulate(val, "InstanceView", &c.InstanceView)
+ delete(rawMsg, key)
+ case "virtualMachinesAssociated":
+ err = unpopulate(val, "VirtualMachinesAssociated", &c.VirtualMachinesAssociated)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationGroupUpdate.
+func (c CapacityReservationGroupUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", c.Properties)
+ populate(objectMap, "tags", c.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationGroupUpdate.
+func (c *CapacityReservationGroupUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &c.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &c.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationInstanceView.
+func (c CapacityReservationInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "statuses", c.Statuses)
+ populate(objectMap, "utilizationInfo", c.UtilizationInfo)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationInstanceView.
+func (c *CapacityReservationInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "statuses":
+ err = unpopulate(val, "Statuses", &c.Statuses)
+ delete(rawMsg, key)
+ case "utilizationInfo":
+ err = unpopulate(val, "UtilizationInfo", &c.UtilizationInfo)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationInstanceViewWithName.
+func (c CapacityReservationInstanceViewWithName) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "statuses", c.Statuses)
+ populate(objectMap, "utilizationInfo", c.UtilizationInfo)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationInstanceViewWithName.
+func (c *CapacityReservationInstanceViewWithName) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &c.Statuses)
+ delete(rawMsg, key)
+ case "utilizationInfo":
+ err = unpopulate(val, "UtilizationInfo", &c.UtilizationInfo)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationListResult.
+func (c CapacityReservationListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", c.NextLink)
+ populate(objectMap, "value", c.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationListResult.
+func (c *CapacityReservationListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &c.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &c.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationProfile.
+func (c CapacityReservationProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capacityReservationGroup", c.CapacityReservationGroup)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationProfile.
+func (c *CapacityReservationProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capacityReservationGroup":
+ err = unpopulate(val, "CapacityReservationGroup", &c.CapacityReservationGroup)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationProperties.
+func (c CapacityReservationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "instanceView", c.InstanceView)
+ populate(objectMap, "platformFaultDomainCount", c.PlatformFaultDomainCount)
+ populate(objectMap, "provisioningState", c.ProvisioningState)
+ populateDateTimeRFC3339(objectMap, "provisioningTime", c.ProvisioningTime)
+ populate(objectMap, "reservationId", c.ReservationID)
+ populateDateTimeRFC3339(objectMap, "timeCreated", c.TimeCreated)
+ populate(objectMap, "virtualMachinesAssociated", c.VirtualMachinesAssociated)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationProperties.
+func (c *CapacityReservationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "instanceView":
+ err = unpopulate(val, "InstanceView", &c.InstanceView)
+ delete(rawMsg, key)
+ case "platformFaultDomainCount":
+ err = unpopulate(val, "PlatformFaultDomainCount", &c.PlatformFaultDomainCount)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &c.ProvisioningState)
+ delete(rawMsg, key)
+ case "provisioningTime":
+ err = unpopulateDateTimeRFC3339(val, "ProvisioningTime", &c.ProvisioningTime)
+ delete(rawMsg, key)
+ case "reservationId":
+ err = unpopulate(val, "ReservationID", &c.ReservationID)
+ delete(rawMsg, key)
+ case "timeCreated":
+ err = unpopulateDateTimeRFC3339(val, "TimeCreated", &c.TimeCreated)
+ delete(rawMsg, key)
+ case "virtualMachinesAssociated":
+ err = unpopulate(val, "VirtualMachinesAssociated", &c.VirtualMachinesAssociated)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationUpdate.
+func (c CapacityReservationUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", c.Properties)
+ populate(objectMap, "sku", c.SKU)
+ populate(objectMap, "tags", c.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationUpdate.
+func (c *CapacityReservationUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &c.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &c.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &c.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CapacityReservationUtilization.
+func (c CapacityReservationUtilization) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "currentCapacity", c.CurrentCapacity)
+ populate(objectMap, "virtualMachinesAllocated", c.VirtualMachinesAllocated)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationUtilization.
+func (c *CapacityReservationUtilization) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "currentCapacity":
+ err = unpopulate(val, "CurrentCapacity", &c.CurrentCapacity)
+ delete(rawMsg, key)
+ case "virtualMachinesAllocated":
+ err = unpopulate(val, "VirtualMachinesAllocated", &c.VirtualMachinesAllocated)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudService.
+func (c CloudService) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", c.ID)
+ populate(objectMap, "location", c.Location)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "properties", c.Properties)
+ populate(objectMap, "systemData", c.SystemData)
+ populate(objectMap, "tags", c.Tags)
+ populate(objectMap, "type", c.Type)
+ populate(objectMap, "zones", c.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudService.
+func (c *CloudService) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &c.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &c.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &c.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &c.SystemData)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &c.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &c.Type)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &c.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceExtensionProfile.
+func (c CloudServiceExtensionProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extensions", c.Extensions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceExtensionProfile.
+func (c *CloudServiceExtensionProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extensions":
+ err = unpopulate(val, "Extensions", &c.Extensions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceExtensionProperties.
+func (c CloudServiceExtensionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "autoUpgradeMinorVersion", c.AutoUpgradeMinorVersion)
+ populate(objectMap, "forceUpdateTag", c.ForceUpdateTag)
+ populateAny(objectMap, "protectedSettings", c.ProtectedSettings)
+ populate(objectMap, "protectedSettingsFromKeyVault", c.ProtectedSettingsFromKeyVault)
+ populate(objectMap, "provisioningState", c.ProvisioningState)
+ populate(objectMap, "publisher", c.Publisher)
+ populate(objectMap, "rolesAppliedTo", c.RolesAppliedTo)
+ populateAny(objectMap, "settings", c.Settings)
+ populate(objectMap, "type", c.Type)
+ populate(objectMap, "typeHandlerVersion", c.TypeHandlerVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceExtensionProperties.
+func (c *CloudServiceExtensionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "autoUpgradeMinorVersion":
+ err = unpopulate(val, "AutoUpgradeMinorVersion", &c.AutoUpgradeMinorVersion)
+ delete(rawMsg, key)
+ case "forceUpdateTag":
+ err = unpopulate(val, "ForceUpdateTag", &c.ForceUpdateTag)
+ delete(rawMsg, key)
+ case "protectedSettings":
+ err = unpopulate(val, "ProtectedSettings", &c.ProtectedSettings)
+ delete(rawMsg, key)
+ case "protectedSettingsFromKeyVault":
+ err = unpopulate(val, "ProtectedSettingsFromKeyVault", &c.ProtectedSettingsFromKeyVault)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &c.ProvisioningState)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &c.Publisher)
+ delete(rawMsg, key)
+ case "rolesAppliedTo":
+ err = unpopulate(val, "RolesAppliedTo", &c.RolesAppliedTo)
+ delete(rawMsg, key)
+ case "settings":
+ err = unpopulate(val, "Settings", &c.Settings)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &c.Type)
+ delete(rawMsg, key)
+ case "typeHandlerVersion":
+ err = unpopulate(val, "TypeHandlerVersion", &c.TypeHandlerVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceInstanceView.
+func (c CloudServiceInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "privateIds", c.PrivateIDs)
+ populate(objectMap, "roleInstance", c.RoleInstance)
+ populate(objectMap, "sdkVersion", c.SdkVersion)
+ populate(objectMap, "statuses", c.Statuses)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceInstanceView.
+func (c *CloudServiceInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "privateIds":
+ err = unpopulate(val, "PrivateIDs", &c.PrivateIDs)
+ delete(rawMsg, key)
+ case "roleInstance":
+ err = unpopulate(val, "RoleInstance", &c.RoleInstance)
+ delete(rawMsg, key)
+ case "sdkVersion":
+ err = unpopulate(val, "SdkVersion", &c.SdkVersion)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &c.Statuses)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceListResult.
+func (c CloudServiceListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", c.NextLink)
+ populate(objectMap, "value", c.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceListResult.
+func (c *CloudServiceListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &c.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &c.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceNetworkProfile.
+func (c CloudServiceNetworkProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "loadBalancerConfigurations", c.LoadBalancerConfigurations)
+ populate(objectMap, "slotType", c.SlotType)
+ populate(objectMap, "swappableCloudService", c.SwappableCloudService)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceNetworkProfile.
+func (c *CloudServiceNetworkProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "loadBalancerConfigurations":
+ err = unpopulate(val, "LoadBalancerConfigurations", &c.LoadBalancerConfigurations)
+ delete(rawMsg, key)
+ case "slotType":
+ err = unpopulate(val, "SlotType", &c.SlotType)
+ delete(rawMsg, key)
+ case "swappableCloudService":
+ err = unpopulate(val, "SwappableCloudService", &c.SwappableCloudService)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceOsProfile.
+func (c CloudServiceOsProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "secrets", c.Secrets)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceOsProfile.
+func (c *CloudServiceOsProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "secrets":
+ err = unpopulate(val, "Secrets", &c.Secrets)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceProperties.
+func (c CloudServiceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowModelOverride", c.AllowModelOverride)
+ populate(objectMap, "configuration", c.Configuration)
+ populate(objectMap, "configurationUrl", c.ConfigurationURL)
+ populate(objectMap, "extensionProfile", c.ExtensionProfile)
+ populate(objectMap, "networkProfile", c.NetworkProfile)
+ populate(objectMap, "osProfile", c.OSProfile)
+ populate(objectMap, "packageUrl", c.PackageURL)
+ populate(objectMap, "provisioningState", c.ProvisioningState)
+ populate(objectMap, "roleProfile", c.RoleProfile)
+ populate(objectMap, "startCloudService", c.StartCloudService)
+ populate(objectMap, "uniqueId", c.UniqueID)
+ populate(objectMap, "upgradeMode", c.UpgradeMode)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceProperties.
+func (c *CloudServiceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowModelOverride":
+ err = unpopulate(val, "AllowModelOverride", &c.AllowModelOverride)
+ delete(rawMsg, key)
+ case "configuration":
+ err = unpopulate(val, "Configuration", &c.Configuration)
+ delete(rawMsg, key)
+ case "configurationUrl":
+ err = unpopulate(val, "ConfigurationURL", &c.ConfigurationURL)
+ delete(rawMsg, key)
+ case "extensionProfile":
+ err = unpopulate(val, "ExtensionProfile", &c.ExtensionProfile)
+ delete(rawMsg, key)
+ case "networkProfile":
+ err = unpopulate(val, "NetworkProfile", &c.NetworkProfile)
+ delete(rawMsg, key)
+ case "osProfile":
+ err = unpopulate(val, "OSProfile", &c.OSProfile)
+ delete(rawMsg, key)
+ case "packageUrl":
+ err = unpopulate(val, "PackageURL", &c.PackageURL)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &c.ProvisioningState)
+ delete(rawMsg, key)
+ case "roleProfile":
+ err = unpopulate(val, "RoleProfile", &c.RoleProfile)
+ delete(rawMsg, key)
+ case "startCloudService":
+ err = unpopulate(val, "StartCloudService", &c.StartCloudService)
+ delete(rawMsg, key)
+ case "uniqueId":
+ err = unpopulate(val, "UniqueID", &c.UniqueID)
+ delete(rawMsg, key)
+ case "upgradeMode":
+ err = unpopulate(val, "UpgradeMode", &c.UpgradeMode)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceRole.
+func (c CloudServiceRole) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", c.ID)
+ populate(objectMap, "location", c.Location)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "properties", c.Properties)
+ populate(objectMap, "sku", c.SKU)
+ populate(objectMap, "type", c.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRole.
+func (c *CloudServiceRole) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &c.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &c.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &c.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &c.SKU)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &c.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleListResult.
+func (c CloudServiceRoleListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", c.NextLink)
+ populate(objectMap, "value", c.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleListResult.
+func (c *CloudServiceRoleListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &c.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &c.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProfile.
+func (c CloudServiceRoleProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "roles", c.Roles)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProfile.
+func (c *CloudServiceRoleProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "roles":
+ err = unpopulate(val, "Roles", &c.Roles)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProfileProperties.
+func (c CloudServiceRoleProfileProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "sku", c.SKU)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProfileProperties.
+func (c *CloudServiceRoleProfileProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &c.SKU)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleProperties.
+func (c CloudServiceRoleProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "uniqueId", c.UniqueID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleProperties.
+func (c *CloudServiceRoleProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "uniqueId":
+ err = unpopulate(val, "UniqueID", &c.UniqueID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceRoleSKU.
+func (c CloudServiceRoleSKU) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capacity", c.Capacity)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "tier", c.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceRoleSKU.
+func (c *CloudServiceRoleSKU) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capacity":
+ err = unpopulate(val, "Capacity", &c.Capacity)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &c.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceUpdate.
+func (c CloudServiceUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "tags", c.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceUpdate.
+func (c *CloudServiceUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "tags":
+ err = unpopulate(val, "Tags", &c.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultAndSecretReference.
+func (c CloudServiceVaultAndSecretReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "secretUrl", c.SecretURL)
+ populate(objectMap, "sourceVault", c.SourceVault)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultAndSecretReference.
+func (c *CloudServiceVaultAndSecretReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "secretUrl":
+ err = unpopulate(val, "SecretURL", &c.SecretURL)
+ delete(rawMsg, key)
+ case "sourceVault":
+ err = unpopulate(val, "SourceVault", &c.SourceVault)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultCertificate.
+func (c CloudServiceVaultCertificate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "certificateUrl", c.CertificateURL)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultCertificate.
+func (c *CloudServiceVaultCertificate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "certificateUrl":
+ err = unpopulate(val, "CertificateURL", &c.CertificateURL)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CloudServiceVaultSecretGroup.
+func (c CloudServiceVaultSecretGroup) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "sourceVault", c.SourceVault)
+ populate(objectMap, "vaultCertificates", c.VaultCertificates)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CloudServiceVaultSecretGroup.
+func (c *CloudServiceVaultSecretGroup) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "sourceVault":
+ err = unpopulate(val, "SourceVault", &c.SourceVault)
+ delete(rawMsg, key)
+ case "vaultCertificates":
+ err = unpopulate(val, "VaultCertificates", &c.VaultCertificates)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CommunityGallery.
+func (c CommunityGallery) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identifier", c.Identifier)
+ populate(objectMap, "location", c.Location)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "type", c.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGallery.
+func (c *CommunityGallery) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identifier":
+ err = unpopulate(val, "Identifier", &c.Identifier)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &c.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &c.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryIdentifier.
+func (c CommunityGalleryIdentifier) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "uniqueId", c.UniqueID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryIdentifier.
+func (c *CommunityGalleryIdentifier) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "uniqueId":
+ err = unpopulate(val, "UniqueID", &c.UniqueID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImage.
+func (c CommunityGalleryImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identifier", c.Identifier)
+ populate(objectMap, "location", c.Location)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "properties", c.Properties)
+ populate(objectMap, "type", c.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImage.
+func (c *CommunityGalleryImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identifier":
+ err = unpopulate(val, "Identifier", &c.Identifier)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &c.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &c.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &c.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageIdentifier.
+func (c CommunityGalleryImageIdentifier) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "offer", c.Offer)
+ populate(objectMap, "publisher", c.Publisher)
+ populate(objectMap, "sku", c.SKU)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageIdentifier.
+func (c *CommunityGalleryImageIdentifier) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "offer":
+ err = unpopulate(val, "Offer", &c.Offer)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &c.Publisher)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &c.SKU)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageList.
+func (c CommunityGalleryImageList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", c.NextLink)
+ populate(objectMap, "value", c.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageList.
+func (c *CommunityGalleryImageList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &c.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &c.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageProperties.
+func (c CommunityGalleryImageProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "architecture", c.Architecture)
+ populate(objectMap, "disallowed", c.Disallowed)
+ populateDateTimeRFC3339(objectMap, "endOfLifeDate", c.EndOfLifeDate)
+ populate(objectMap, "eula", c.Eula)
+ populate(objectMap, "features", c.Features)
+ populate(objectMap, "hyperVGeneration", c.HyperVGeneration)
+ populate(objectMap, "identifier", c.Identifier)
+ populate(objectMap, "osState", c.OSState)
+ populate(objectMap, "osType", c.OSType)
+ populate(objectMap, "privacyStatementUri", c.PrivacyStatementURI)
+ populate(objectMap, "purchasePlan", c.PurchasePlan)
+ populate(objectMap, "recommended", c.Recommended)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageProperties.
+func (c *CommunityGalleryImageProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "architecture":
+ err = unpopulate(val, "Architecture", &c.Architecture)
+ delete(rawMsg, key)
+ case "disallowed":
+ err = unpopulate(val, "Disallowed", &c.Disallowed)
+ delete(rawMsg, key)
+ case "endOfLifeDate":
+ err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &c.EndOfLifeDate)
+ delete(rawMsg, key)
+ case "eula":
+ err = unpopulate(val, "Eula", &c.Eula)
+ delete(rawMsg, key)
+ case "features":
+ err = unpopulate(val, "Features", &c.Features)
+ delete(rawMsg, key)
+ case "hyperVGeneration":
+ err = unpopulate(val, "HyperVGeneration", &c.HyperVGeneration)
+ delete(rawMsg, key)
+ case "identifier":
+ err = unpopulate(val, "Identifier", &c.Identifier)
+ delete(rawMsg, key)
+ case "osState":
+ err = unpopulate(val, "OSState", &c.OSState)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &c.OSType)
+ delete(rawMsg, key)
+ case "privacyStatementUri":
+ err = unpopulate(val, "PrivacyStatementURI", &c.PrivacyStatementURI)
+ delete(rawMsg, key)
+ case "purchasePlan":
+ err = unpopulate(val, "PurchasePlan", &c.PurchasePlan)
+ delete(rawMsg, key)
+ case "recommended":
+ err = unpopulate(val, "Recommended", &c.Recommended)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersion.
+func (c CommunityGalleryImageVersion) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identifier", c.Identifier)
+ populate(objectMap, "location", c.Location)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "properties", c.Properties)
+ populate(objectMap, "type", c.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersion.
+func (c *CommunityGalleryImageVersion) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identifier":
+ err = unpopulate(val, "Identifier", &c.Identifier)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &c.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &c.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &c.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersionList.
+func (c CommunityGalleryImageVersionList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", c.NextLink)
+ populate(objectMap, "value", c.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersionList.
+func (c *CommunityGalleryImageVersionList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &c.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &c.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryImageVersionProperties.
+func (c CommunityGalleryImageVersionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "endOfLifeDate", c.EndOfLifeDate)
+ populate(objectMap, "excludeFromLatest", c.ExcludeFromLatest)
+ populateDateTimeRFC3339(objectMap, "publishedDate", c.PublishedDate)
+ populate(objectMap, "storageProfile", c.StorageProfile)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryImageVersionProperties.
+func (c *CommunityGalleryImageVersionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endOfLifeDate":
+ err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &c.EndOfLifeDate)
+ delete(rawMsg, key)
+ case "excludeFromLatest":
+ err = unpopulate(val, "ExcludeFromLatest", &c.ExcludeFromLatest)
+ delete(rawMsg, key)
+ case "publishedDate":
+ err = unpopulateDateTimeRFC3339(val, "PublishedDate", &c.PublishedDate)
+ delete(rawMsg, key)
+ case "storageProfile":
+ err = unpopulate(val, "StorageProfile", &c.StorageProfile)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CommunityGalleryInfo.
+func (c CommunityGalleryInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "communityGalleryEnabled", c.CommunityGalleryEnabled)
+ populate(objectMap, "eula", c.Eula)
+ populate(objectMap, "publicNamePrefix", c.PublicNamePrefix)
+ populate(objectMap, "publicNames", c.PublicNames)
+ populate(objectMap, "publisherContact", c.PublisherContact)
+ populate(objectMap, "publisherUri", c.PublisherURI)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CommunityGalleryInfo.
+func (c *CommunityGalleryInfo) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "communityGalleryEnabled":
+ err = unpopulate(val, "CommunityGalleryEnabled", &c.CommunityGalleryEnabled)
+ delete(rawMsg, key)
+ case "eula":
+ err = unpopulate(val, "Eula", &c.Eula)
+ delete(rawMsg, key)
+ case "publicNamePrefix":
+ err = unpopulate(val, "PublicNamePrefix", &c.PublicNamePrefix)
+ delete(rawMsg, key)
+ case "publicNames":
+ err = unpopulate(val, "PublicNames", &c.PublicNames)
+ delete(rawMsg, key)
+ case "publisherContact":
+ err = unpopulate(val, "PublisherContact", &c.PublisherContact)
+ delete(rawMsg, key)
+ case "publisherUri":
+ err = unpopulate(val, "PublisherURI", &c.PublisherURI)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CopyCompletionError.
+func (c CopyCompletionError) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "errorCode", c.ErrorCode)
+ populate(objectMap, "errorMessage", c.ErrorMessage)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CopyCompletionError.
+func (c *CopyCompletionError) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "errorCode":
+ err = unpopulate(val, "ErrorCode", &c.ErrorCode)
+ delete(rawMsg, key)
+ case "errorMessage":
+ err = unpopulate(val, "ErrorMessage", &c.ErrorMessage)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CreationData.
+func (c CreationData) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "createOption", c.CreateOption)
+ populate(objectMap, "elasticSanResourceId", c.ElasticSanResourceID)
+ populate(objectMap, "galleryImageReference", c.GalleryImageReference)
+ populate(objectMap, "imageReference", c.ImageReference)
+ populate(objectMap, "logicalSectorSize", c.LogicalSectorSize)
+ populate(objectMap, "performancePlus", c.PerformancePlus)
+ populate(objectMap, "securityDataUri", c.SecurityDataURI)
+ populate(objectMap, "sourceResourceId", c.SourceResourceID)
+ populate(objectMap, "sourceUri", c.SourceURI)
+ populate(objectMap, "sourceUniqueId", c.SourceUniqueID)
+ populate(objectMap, "storageAccountId", c.StorageAccountID)
+ populate(objectMap, "uploadSizeBytes", c.UploadSizeBytes)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CreationData.
+func (c *CreationData) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "createOption":
+ err = unpopulate(val, "CreateOption", &c.CreateOption)
+ delete(rawMsg, key)
+ case "elasticSanResourceId":
+ err = unpopulate(val, "ElasticSanResourceID", &c.ElasticSanResourceID)
+ delete(rawMsg, key)
+ case "galleryImageReference":
+ err = unpopulate(val, "GalleryImageReference", &c.GalleryImageReference)
+ delete(rawMsg, key)
+ case "imageReference":
+ err = unpopulate(val, "ImageReference", &c.ImageReference)
+ delete(rawMsg, key)
+ case "logicalSectorSize":
+ err = unpopulate(val, "LogicalSectorSize", &c.LogicalSectorSize)
+ delete(rawMsg, key)
+ case "performancePlus":
+ err = unpopulate(val, "PerformancePlus", &c.PerformancePlus)
+ delete(rawMsg, key)
+ case "securityDataUri":
+ err = unpopulate(val, "SecurityDataURI", &c.SecurityDataURI)
+ delete(rawMsg, key)
+ case "sourceResourceId":
+ err = unpopulate(val, "SourceResourceID", &c.SourceResourceID)
+ delete(rawMsg, key)
+ case "sourceUri":
+ err = unpopulate(val, "SourceURI", &c.SourceURI)
+ delete(rawMsg, key)
+ case "sourceUniqueId":
+ err = unpopulate(val, "SourceUniqueID", &c.SourceUniqueID)
+ delete(rawMsg, key)
+ case "storageAccountId":
+ err = unpopulate(val, "StorageAccountID", &c.StorageAccountID)
+ delete(rawMsg, key)
+ case "uploadSizeBytes":
+ err = unpopulate(val, "UploadSizeBytes", &c.UploadSizeBytes)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DataDisk.
+func (d DataDisk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "caching", d.Caching)
+ populate(objectMap, "createOption", d.CreateOption)
+ populate(objectMap, "deleteOption", d.DeleteOption)
+ populate(objectMap, "detachOption", d.DetachOption)
+ populate(objectMap, "diskIOPSReadWrite", d.DiskIOPSReadWrite)
+ populate(objectMap, "diskMBpsReadWrite", d.DiskMBpsReadWrite)
+ populate(objectMap, "diskSizeGB", d.DiskSizeGB)
+ populate(objectMap, "image", d.Image)
+ populate(objectMap, "lun", d.Lun)
+ populate(objectMap, "managedDisk", d.ManagedDisk)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "toBeDetached", d.ToBeDetached)
+ populate(objectMap, "vhd", d.Vhd)
+ populate(objectMap, "writeAcceleratorEnabled", d.WriteAcceleratorEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DataDisk.
+func (d *DataDisk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "caching":
+ err = unpopulate(val, "Caching", &d.Caching)
+ delete(rawMsg, key)
+ case "createOption":
+ err = unpopulate(val, "CreateOption", &d.CreateOption)
+ delete(rawMsg, key)
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &d.DeleteOption)
+ delete(rawMsg, key)
+ case "detachOption":
+ err = unpopulate(val, "DetachOption", &d.DetachOption)
+ delete(rawMsg, key)
+ case "diskIOPSReadWrite":
+ err = unpopulate(val, "DiskIOPSReadWrite", &d.DiskIOPSReadWrite)
+ delete(rawMsg, key)
+ case "diskMBpsReadWrite":
+ err = unpopulate(val, "DiskMBpsReadWrite", &d.DiskMBpsReadWrite)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &d.DiskSizeGB)
+ delete(rawMsg, key)
+ case "image":
+ err = unpopulate(val, "Image", &d.Image)
+ delete(rawMsg, key)
+ case "lun":
+ err = unpopulate(val, "Lun", &d.Lun)
+ delete(rawMsg, key)
+ case "managedDisk":
+ err = unpopulate(val, "ManagedDisk", &d.ManagedDisk)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "toBeDetached":
+ err = unpopulate(val, "ToBeDetached", &d.ToBeDetached)
+ delete(rawMsg, key)
+ case "vhd":
+ err = unpopulate(val, "Vhd", &d.Vhd)
+ delete(rawMsg, key)
+ case "writeAcceleratorEnabled":
+ err = unpopulate(val, "WriteAcceleratorEnabled", &d.WriteAcceleratorEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DataDiskImage.
+func (d DataDiskImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "lun", d.Lun)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskImage.
+func (d *DataDiskImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "lun":
+ err = unpopulate(val, "Lun", &d.Lun)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DataDiskImageEncryption.
+func (d DataDiskImageEncryption) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskEncryptionSetId", d.DiskEncryptionSetID)
+ populate(objectMap, "lun", d.Lun)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DataDiskImageEncryption.
+func (d *DataDiskImageEncryption) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskEncryptionSetId":
+ err = unpopulate(val, "DiskEncryptionSetID", &d.DiskEncryptionSetID)
+ delete(rawMsg, key)
+ case "lun":
+ err = unpopulate(val, "Lun", &d.Lun)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHost.
+func (d DedicatedHost) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "location", d.Location)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "sku", d.SKU)
+ populate(objectMap, "tags", d.Tags)
+ populate(objectMap, "type", d.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHost.
+func (d *DedicatedHost) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &d.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &d.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &d.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostAllocatableVM.
+func (d DedicatedHostAllocatableVM) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "count", d.Count)
+ populate(objectMap, "vmSize", d.VMSize)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostAllocatableVM.
+func (d *DedicatedHostAllocatableVM) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "count":
+ err = unpopulate(val, "Count", &d.Count)
+ delete(rawMsg, key)
+ case "vmSize":
+ err = unpopulate(val, "VMSize", &d.VMSize)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostAvailableCapacity.
+func (d DedicatedHostAvailableCapacity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allocatableVMs", d.AllocatableVMs)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostAvailableCapacity.
+func (d *DedicatedHostAvailableCapacity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allocatableVMs":
+ err = unpopulate(val, "AllocatableVMs", &d.AllocatableVMs)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroup.
+func (d DedicatedHostGroup) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "location", d.Location)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "tags", d.Tags)
+ populate(objectMap, "type", d.Type)
+ populate(objectMap, "zones", d.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroup.
+func (d *DedicatedHostGroup) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &d.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &d.Type)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &d.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupInstanceView.
+func (d DedicatedHostGroupInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "hosts", d.Hosts)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupInstanceView.
+func (d *DedicatedHostGroupInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "hosts":
+ err = unpopulate(val, "Hosts", &d.Hosts)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupListResult.
+func (d DedicatedHostGroupListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", d.NextLink)
+ populate(objectMap, "value", d.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupListResult.
+func (d *DedicatedHostGroupListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &d.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &d.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupProperties.
+func (d DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "additionalCapabilities", d.AdditionalCapabilities)
+ populate(objectMap, "hosts", d.Hosts)
+ populate(objectMap, "instanceView", d.InstanceView)
+ populate(objectMap, "platformFaultDomainCount", d.PlatformFaultDomainCount)
+ populate(objectMap, "supportAutomaticPlacement", d.SupportAutomaticPlacement)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupProperties.
+func (d *DedicatedHostGroupProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "additionalCapabilities":
+ err = unpopulate(val, "AdditionalCapabilities", &d.AdditionalCapabilities)
+ delete(rawMsg, key)
+ case "hosts":
+ err = unpopulate(val, "Hosts", &d.Hosts)
+ delete(rawMsg, key)
+ case "instanceView":
+ err = unpopulate(val, "InstanceView", &d.InstanceView)
+ delete(rawMsg, key)
+ case "platformFaultDomainCount":
+ err = unpopulate(val, "PlatformFaultDomainCount", &d.PlatformFaultDomainCount)
+ delete(rawMsg, key)
+ case "supportAutomaticPlacement":
+ err = unpopulate(val, "SupportAutomaticPlacement", &d.SupportAutomaticPlacement)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupPropertiesAdditionalCapabilities.
+func (d DedicatedHostGroupPropertiesAdditionalCapabilities) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "ultraSSDEnabled", d.UltraSSDEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupPropertiesAdditionalCapabilities.
+func (d *DedicatedHostGroupPropertiesAdditionalCapabilities) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "ultraSSDEnabled":
+ err = unpopulate(val, "UltraSSDEnabled", &d.UltraSSDEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostGroupUpdate.
+func (d DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "tags", d.Tags)
+ populate(objectMap, "zones", d.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostGroupUpdate.
+func (d *DedicatedHostGroupUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &d.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostInstanceView.
+func (d DedicatedHostInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "assetId", d.AssetID)
+ populate(objectMap, "availableCapacity", d.AvailableCapacity)
+ populate(objectMap, "statuses", d.Statuses)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostInstanceView.
+func (d *DedicatedHostInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "assetId":
+ err = unpopulate(val, "AssetID", &d.AssetID)
+ delete(rawMsg, key)
+ case "availableCapacity":
+ err = unpopulate(val, "AvailableCapacity", &d.AvailableCapacity)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &d.Statuses)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostInstanceViewWithName.
+func (d DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "assetId", d.AssetID)
+ populate(objectMap, "availableCapacity", d.AvailableCapacity)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "statuses", d.Statuses)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostInstanceViewWithName.
+func (d *DedicatedHostInstanceViewWithName) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "assetId":
+ err = unpopulate(val, "AssetID", &d.AssetID)
+ delete(rawMsg, key)
+ case "availableCapacity":
+ err = unpopulate(val, "AvailableCapacity", &d.AvailableCapacity)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &d.Statuses)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostListResult.
+func (d DedicatedHostListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", d.NextLink)
+ populate(objectMap, "value", d.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostListResult.
+func (d *DedicatedHostListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &d.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &d.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostProperties.
+func (d DedicatedHostProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "autoReplaceOnFailure", d.AutoReplaceOnFailure)
+ populate(objectMap, "hostId", d.HostID)
+ populate(objectMap, "instanceView", d.InstanceView)
+ populate(objectMap, "licenseType", d.LicenseType)
+ populate(objectMap, "platformFaultDomain", d.PlatformFaultDomain)
+ populate(objectMap, "provisioningState", d.ProvisioningState)
+ populateDateTimeRFC3339(objectMap, "provisioningTime", d.ProvisioningTime)
+ populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated)
+ populate(objectMap, "virtualMachines", d.VirtualMachines)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostProperties.
+func (d *DedicatedHostProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "autoReplaceOnFailure":
+ err = unpopulate(val, "AutoReplaceOnFailure", &d.AutoReplaceOnFailure)
+ delete(rawMsg, key)
+ case "hostId":
+ err = unpopulate(val, "HostID", &d.HostID)
+ delete(rawMsg, key)
+ case "instanceView":
+ err = unpopulate(val, "InstanceView", &d.InstanceView)
+ delete(rawMsg, key)
+ case "licenseType":
+ err = unpopulate(val, "LicenseType", &d.LicenseType)
+ delete(rawMsg, key)
+ case "platformFaultDomain":
+ err = unpopulate(val, "PlatformFaultDomain", &d.PlatformFaultDomain)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &d.ProvisioningState)
+ delete(rawMsg, key)
+ case "provisioningTime":
+ err = unpopulateDateTimeRFC3339(val, "ProvisioningTime", &d.ProvisioningTime)
+ delete(rawMsg, key)
+ case "timeCreated":
+ err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated)
+ delete(rawMsg, key)
+ case "virtualMachines":
+ err = unpopulate(val, "VirtualMachines", &d.VirtualMachines)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostSizeListResult.
+func (d DedicatedHostSizeListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", d.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostSizeListResult.
+func (d *DedicatedHostSizeListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &d.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DedicatedHostUpdate.
+func (d DedicatedHostUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "sku", d.SKU)
+ populate(objectMap, "tags", d.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DedicatedHostUpdate.
+func (d *DedicatedHostUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &d.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiagnosticsProfile.
+func (d DiagnosticsProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "bootDiagnostics", d.BootDiagnostics)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsProfile.
+func (d *DiagnosticsProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "bootDiagnostics":
+ err = unpopulate(val, "BootDiagnostics", &d.BootDiagnostics)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiffDiskSettings.
+func (d DiffDiskSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "option", d.Option)
+ populate(objectMap, "placement", d.Placement)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiffDiskSettings.
+func (d *DiffDiskSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "option":
+ err = unpopulate(val, "Option", &d.Option)
+ delete(rawMsg, key)
+ case "placement":
+ err = unpopulate(val, "Placement", &d.Placement)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Disallowed.
+func (d Disallowed) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskTypes", d.DiskTypes)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Disallowed.
+func (d *Disallowed) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskTypes":
+ err = unpopulate(val, "DiskTypes", &d.DiskTypes)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DisallowedConfiguration.
+func (d DisallowedConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "vmDiskType", d.VMDiskType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DisallowedConfiguration.
+func (d *DisallowedConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "vmDiskType":
+ err = unpopulate(val, "VMDiskType", &d.VMDiskType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Disk.
+func (d Disk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", d.ExtendedLocation)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "location", d.Location)
+ populate(objectMap, "managedBy", d.ManagedBy)
+ populate(objectMap, "managedByExtended", d.ManagedByExtended)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "sku", d.SKU)
+ populate(objectMap, "tags", d.Tags)
+ populate(objectMap, "type", d.Type)
+ populate(objectMap, "zones", d.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Disk.
+func (d *Disk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &d.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &d.Location)
+ delete(rawMsg, key)
+ case "managedBy":
+ err = unpopulate(val, "ManagedBy", &d.ManagedBy)
+ delete(rawMsg, key)
+ case "managedByExtended":
+ err = unpopulate(val, "ManagedByExtended", &d.ManagedByExtended)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &d.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &d.Type)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &d.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskAccess.
+func (d DiskAccess) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", d.ExtendedLocation)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "location", d.Location)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "tags", d.Tags)
+ populate(objectMap, "type", d.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccess.
+func (d *DiskAccess) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &d.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &d.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &d.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskAccessList.
+func (d DiskAccessList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", d.NextLink)
+ populate(objectMap, "value", d.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessList.
+func (d *DiskAccessList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &d.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &d.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskAccessProperties.
+func (d DiskAccessProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "privateEndpointConnections", d.PrivateEndpointConnections)
+ populate(objectMap, "provisioningState", d.ProvisioningState)
+ populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessProperties.
+func (d *DiskAccessProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "privateEndpointConnections":
+ err = unpopulate(val, "PrivateEndpointConnections", &d.PrivateEndpointConnections)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &d.ProvisioningState)
+ delete(rawMsg, key)
+ case "timeCreated":
+ err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskAccessUpdate.
+func (d DiskAccessUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "tags", d.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskAccessUpdate.
+func (d *DiskAccessUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSet.
+func (d DiskEncryptionSet) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "identity", d.Identity)
+ populate(objectMap, "location", d.Location)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "tags", d.Tags)
+ populate(objectMap, "type", d.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSet.
+func (d *DiskEncryptionSet) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &d.Identity)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &d.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &d.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetList.
+func (d DiskEncryptionSetList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", d.NextLink)
+ populate(objectMap, "value", d.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetList.
+func (d *DiskEncryptionSetList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &d.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &d.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetParameters.
+func (d DiskEncryptionSetParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", d.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetParameters.
+func (d *DiskEncryptionSetParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetUpdate.
+func (d DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identity", d.Identity)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "tags", d.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetUpdate.
+func (d *DiskEncryptionSetUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identity":
+ err = unpopulate(val, "Identity", &d.Identity)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSetUpdateProperties.
+func (d DiskEncryptionSetUpdateProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "activeKey", d.ActiveKey)
+ populate(objectMap, "encryptionType", d.EncryptionType)
+ populate(objectMap, "federatedClientId", d.FederatedClientID)
+ populate(objectMap, "rotationToLatestKeyVersionEnabled", d.RotationToLatestKeyVersionEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSetUpdateProperties.
+func (d *DiskEncryptionSetUpdateProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "activeKey":
+ err = unpopulate(val, "ActiveKey", &d.ActiveKey)
+ delete(rawMsg, key)
+ case "encryptionType":
+ err = unpopulate(val, "EncryptionType", &d.EncryptionType)
+ delete(rawMsg, key)
+ case "federatedClientId":
+ err = unpopulate(val, "FederatedClientID", &d.FederatedClientID)
+ delete(rawMsg, key)
+ case "rotationToLatestKeyVersionEnabled":
+ err = unpopulate(val, "RotationToLatestKeyVersionEnabled", &d.RotationToLatestKeyVersionEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskEncryptionSettings.
+func (d DiskEncryptionSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskEncryptionKey", d.DiskEncryptionKey)
+ populate(objectMap, "enabled", d.Enabled)
+ populate(objectMap, "keyEncryptionKey", d.KeyEncryptionKey)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskEncryptionSettings.
+func (d *DiskEncryptionSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskEncryptionKey":
+ err = unpopulate(val, "DiskEncryptionKey", &d.DiskEncryptionKey)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &d.Enabled)
+ delete(rawMsg, key)
+ case "keyEncryptionKey":
+ err = unpopulate(val, "KeyEncryptionKey", &d.KeyEncryptionKey)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskImageEncryption.
+func (d DiskImageEncryption) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskEncryptionSetId", d.DiskEncryptionSetID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskImageEncryption.
+func (d *DiskImageEncryption) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskEncryptionSetId":
+ err = unpopulate(val, "DiskEncryptionSetID", &d.DiskEncryptionSetID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskInstanceView.
+func (d DiskInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "encryptionSettings", d.EncryptionSettings)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "statuses", d.Statuses)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskInstanceView.
+func (d *DiskInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "encryptionSettings":
+ err = unpopulate(val, "EncryptionSettings", &d.EncryptionSettings)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &d.Statuses)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskList.
+func (d DiskList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", d.NextLink)
+ populate(objectMap, "value", d.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskList.
+func (d *DiskList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &d.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &d.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskProperties.
+func (d DiskProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "burstingEnabled", d.BurstingEnabled)
+ populateDateTimeRFC3339(objectMap, "burstingEnabledTime", d.BurstingEnabledTime)
+ populate(objectMap, "completionPercent", d.CompletionPercent)
+ populate(objectMap, "creationData", d.CreationData)
+ populate(objectMap, "dataAccessAuthMode", d.DataAccessAuthMode)
+ populate(objectMap, "diskAccessId", d.DiskAccessID)
+ populate(objectMap, "diskIOPSReadOnly", d.DiskIOPSReadOnly)
+ populate(objectMap, "diskIOPSReadWrite", d.DiskIOPSReadWrite)
+ populate(objectMap, "diskMBpsReadOnly", d.DiskMBpsReadOnly)
+ populate(objectMap, "diskMBpsReadWrite", d.DiskMBpsReadWrite)
+ populate(objectMap, "diskSizeBytes", d.DiskSizeBytes)
+ populate(objectMap, "diskSizeGB", d.DiskSizeGB)
+ populate(objectMap, "diskState", d.DiskState)
+ populate(objectMap, "encryption", d.Encryption)
+ populate(objectMap, "encryptionSettingsCollection", d.EncryptionSettingsCollection)
+ populate(objectMap, "hyperVGeneration", d.HyperVGeneration)
+ populateDateTimeRFC3339(objectMap, "LastOwnershipUpdateTime", d.LastOwnershipUpdateTime)
+ populate(objectMap, "maxShares", d.MaxShares)
+ populate(objectMap, "networkAccessPolicy", d.NetworkAccessPolicy)
+ populate(objectMap, "osType", d.OSType)
+ populate(objectMap, "optimizedForFrequentAttach", d.OptimizedForFrequentAttach)
+ populate(objectMap, "propertyUpdatesInProgress", d.PropertyUpdatesInProgress)
+ populate(objectMap, "provisioningState", d.ProvisioningState)
+ populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess)
+ populate(objectMap, "purchasePlan", d.PurchasePlan)
+ populate(objectMap, "securityProfile", d.SecurityProfile)
+ populate(objectMap, "shareInfo", d.ShareInfo)
+ populate(objectMap, "supportedCapabilities", d.SupportedCapabilities)
+ populate(objectMap, "supportsHibernation", d.SupportsHibernation)
+ populate(objectMap, "tier", d.Tier)
+ populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated)
+ populate(objectMap, "uniqueId", d.UniqueID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskProperties.
+func (d *DiskProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "burstingEnabled":
+ err = unpopulate(val, "BurstingEnabled", &d.BurstingEnabled)
+ delete(rawMsg, key)
+ case "burstingEnabledTime":
+ err = unpopulateDateTimeRFC3339(val, "BurstingEnabledTime", &d.BurstingEnabledTime)
+ delete(rawMsg, key)
+ case "completionPercent":
+ err = unpopulate(val, "CompletionPercent", &d.CompletionPercent)
+ delete(rawMsg, key)
+ case "creationData":
+ err = unpopulate(val, "CreationData", &d.CreationData)
+ delete(rawMsg, key)
+ case "dataAccessAuthMode":
+ err = unpopulate(val, "DataAccessAuthMode", &d.DataAccessAuthMode)
+ delete(rawMsg, key)
+ case "diskAccessId":
+ err = unpopulate(val, "DiskAccessID", &d.DiskAccessID)
+ delete(rawMsg, key)
+ case "diskIOPSReadOnly":
+ err = unpopulate(val, "DiskIOPSReadOnly", &d.DiskIOPSReadOnly)
+ delete(rawMsg, key)
+ case "diskIOPSReadWrite":
+ err = unpopulate(val, "DiskIOPSReadWrite", &d.DiskIOPSReadWrite)
+ delete(rawMsg, key)
+ case "diskMBpsReadOnly":
+ err = unpopulate(val, "DiskMBpsReadOnly", &d.DiskMBpsReadOnly)
+ delete(rawMsg, key)
+ case "diskMBpsReadWrite":
+ err = unpopulate(val, "DiskMBpsReadWrite", &d.DiskMBpsReadWrite)
+ delete(rawMsg, key)
+ case "diskSizeBytes":
+ err = unpopulate(val, "DiskSizeBytes", &d.DiskSizeBytes)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &d.DiskSizeGB)
+ delete(rawMsg, key)
+ case "diskState":
+ err = unpopulate(val, "DiskState", &d.DiskState)
+ delete(rawMsg, key)
+ case "encryption":
+ err = unpopulate(val, "Encryption", &d.Encryption)
+ delete(rawMsg, key)
+ case "encryptionSettingsCollection":
+ err = unpopulate(val, "EncryptionSettingsCollection", &d.EncryptionSettingsCollection)
+ delete(rawMsg, key)
+ case "hyperVGeneration":
+ err = unpopulate(val, "HyperVGeneration", &d.HyperVGeneration)
+ delete(rawMsg, key)
+ case "LastOwnershipUpdateTime":
+ err = unpopulateDateTimeRFC3339(val, "LastOwnershipUpdateTime", &d.LastOwnershipUpdateTime)
+ delete(rawMsg, key)
+ case "maxShares":
+ err = unpopulate(val, "MaxShares", &d.MaxShares)
+ delete(rawMsg, key)
+ case "networkAccessPolicy":
+ err = unpopulate(val, "NetworkAccessPolicy", &d.NetworkAccessPolicy)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &d.OSType)
+ delete(rawMsg, key)
+ case "optimizedForFrequentAttach":
+ err = unpopulate(val, "OptimizedForFrequentAttach", &d.OptimizedForFrequentAttach)
+ delete(rawMsg, key)
+ case "propertyUpdatesInProgress":
+ err = unpopulate(val, "PropertyUpdatesInProgress", &d.PropertyUpdatesInProgress)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &d.ProvisioningState)
+ delete(rawMsg, key)
+ case "publicNetworkAccess":
+ err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess)
+ delete(rawMsg, key)
+ case "purchasePlan":
+ err = unpopulate(val, "PurchasePlan", &d.PurchasePlan)
+ delete(rawMsg, key)
+ case "securityProfile":
+ err = unpopulate(val, "SecurityProfile", &d.SecurityProfile)
+ delete(rawMsg, key)
+ case "shareInfo":
+ err = unpopulate(val, "ShareInfo", &d.ShareInfo)
+ delete(rawMsg, key)
+ case "supportedCapabilities":
+ err = unpopulate(val, "SupportedCapabilities", &d.SupportedCapabilities)
+ delete(rawMsg, key)
+ case "supportsHibernation":
+ err = unpopulate(val, "SupportsHibernation", &d.SupportsHibernation)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &d.Tier)
+ delete(rawMsg, key)
+ case "timeCreated":
+ err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated)
+ delete(rawMsg, key)
+ case "uniqueId":
+ err = unpopulate(val, "UniqueID", &d.UniqueID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskPurchasePlan.
+func (d DiskPurchasePlan) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "product", d.Product)
+ populate(objectMap, "promotionCode", d.PromotionCode)
+ populate(objectMap, "publisher", d.Publisher)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskPurchasePlan.
+func (d *DiskPurchasePlan) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "product":
+ err = unpopulate(val, "Product", &d.Product)
+ delete(rawMsg, key)
+ case "promotionCode":
+ err = unpopulate(val, "PromotionCode", &d.PromotionCode)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &d.Publisher)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskRestorePoint.
+func (d DiskRestorePoint) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "type", d.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePoint.
+func (d *DiskRestorePoint) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &d.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointAttributes.
+func (d DiskRestorePointAttributes) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "encryption", d.Encryption)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "sourceDiskRestorePoint", d.SourceDiskRestorePoint)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointAttributes.
+func (d *DiskRestorePointAttributes) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "encryption":
+ err = unpopulate(val, "Encryption", &d.Encryption)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "sourceDiskRestorePoint":
+ err = unpopulate(val, "SourceDiskRestorePoint", &d.SourceDiskRestorePoint)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointInstanceView.
+func (d DiskRestorePointInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "replicationStatus", d.ReplicationStatus)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointInstanceView.
+func (d *DiskRestorePointInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "replicationStatus":
+ err = unpopulate(val, "ReplicationStatus", &d.ReplicationStatus)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointList.
+func (d DiskRestorePointList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", d.NextLink)
+ populate(objectMap, "value", d.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointList.
+func (d *DiskRestorePointList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &d.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &d.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointProperties.
+func (d DiskRestorePointProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "completionPercent", d.CompletionPercent)
+ populate(objectMap, "diskAccessId", d.DiskAccessID)
+ populate(objectMap, "encryption", d.Encryption)
+ populate(objectMap, "familyId", d.FamilyID)
+ populate(objectMap, "hyperVGeneration", d.HyperVGeneration)
+ populate(objectMap, "networkAccessPolicy", d.NetworkAccessPolicy)
+ populate(objectMap, "osType", d.OSType)
+ populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess)
+ populate(objectMap, "purchasePlan", d.PurchasePlan)
+ populate(objectMap, "replicationState", d.ReplicationState)
+ populate(objectMap, "securityProfile", d.SecurityProfile)
+ populate(objectMap, "sourceResourceId", d.SourceResourceID)
+ populate(objectMap, "sourceResourceLocation", d.SourceResourceLocation)
+ populate(objectMap, "sourceUniqueId", d.SourceUniqueID)
+ populate(objectMap, "supportedCapabilities", d.SupportedCapabilities)
+ populate(objectMap, "supportsHibernation", d.SupportsHibernation)
+ populateDateTimeRFC3339(objectMap, "timeCreated", d.TimeCreated)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointProperties.
+func (d *DiskRestorePointProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "completionPercent":
+ err = unpopulate(val, "CompletionPercent", &d.CompletionPercent)
+ delete(rawMsg, key)
+ case "diskAccessId":
+ err = unpopulate(val, "DiskAccessID", &d.DiskAccessID)
+ delete(rawMsg, key)
+ case "encryption":
+ err = unpopulate(val, "Encryption", &d.Encryption)
+ delete(rawMsg, key)
+ case "familyId":
+ err = unpopulate(val, "FamilyID", &d.FamilyID)
+ delete(rawMsg, key)
+ case "hyperVGeneration":
+ err = unpopulate(val, "HyperVGeneration", &d.HyperVGeneration)
+ delete(rawMsg, key)
+ case "networkAccessPolicy":
+ err = unpopulate(val, "NetworkAccessPolicy", &d.NetworkAccessPolicy)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &d.OSType)
+ delete(rawMsg, key)
+ case "publicNetworkAccess":
+ err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess)
+ delete(rawMsg, key)
+ case "purchasePlan":
+ err = unpopulate(val, "PurchasePlan", &d.PurchasePlan)
+ delete(rawMsg, key)
+ case "replicationState":
+ err = unpopulate(val, "ReplicationState", &d.ReplicationState)
+ delete(rawMsg, key)
+ case "securityProfile":
+ err = unpopulate(val, "SecurityProfile", &d.SecurityProfile)
+ delete(rawMsg, key)
+ case "sourceResourceId":
+ err = unpopulate(val, "SourceResourceID", &d.SourceResourceID)
+ delete(rawMsg, key)
+ case "sourceResourceLocation":
+ err = unpopulate(val, "SourceResourceLocation", &d.SourceResourceLocation)
+ delete(rawMsg, key)
+ case "sourceUniqueId":
+ err = unpopulate(val, "SourceUniqueID", &d.SourceUniqueID)
+ delete(rawMsg, key)
+ case "supportedCapabilities":
+ err = unpopulate(val, "SupportedCapabilities", &d.SupportedCapabilities)
+ delete(rawMsg, key)
+ case "supportsHibernation":
+ err = unpopulate(val, "SupportsHibernation", &d.SupportsHibernation)
+ delete(rawMsg, key)
+ case "timeCreated":
+ err = unpopulateDateTimeRFC3339(val, "TimeCreated", &d.TimeCreated)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskRestorePointReplicationStatus.
+func (d DiskRestorePointReplicationStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "completionPercent", d.CompletionPercent)
+ populate(objectMap, "status", d.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskRestorePointReplicationStatus.
+func (d *DiskRestorePointReplicationStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "completionPercent":
+ err = unpopulate(val, "CompletionPercent", &d.CompletionPercent)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &d.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskSKU.
+func (d DiskSKU) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "tier", d.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskSKU.
+func (d *DiskSKU) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &d.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskSecurityProfile.
+func (d DiskSecurityProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "secureVMDiskEncryptionSetId", d.SecureVMDiskEncryptionSetID)
+ populate(objectMap, "securityType", d.SecurityType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskSecurityProfile.
+func (d *DiskSecurityProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "secureVMDiskEncryptionSetId":
+ err = unpopulate(val, "SecureVMDiskEncryptionSetID", &d.SecureVMDiskEncryptionSetID)
+ delete(rawMsg, key)
+ case "securityType":
+ err = unpopulate(val, "SecurityType", &d.SecurityType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskUpdate.
+func (d DiskUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "sku", d.SKU)
+ populate(objectMap, "tags", d.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskUpdate.
+func (d *DiskUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &d.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DiskUpdateProperties.
+func (d DiskUpdateProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "burstingEnabled", d.BurstingEnabled)
+ populate(objectMap, "dataAccessAuthMode", d.DataAccessAuthMode)
+ populate(objectMap, "diskAccessId", d.DiskAccessID)
+ populate(objectMap, "diskIOPSReadOnly", d.DiskIOPSReadOnly)
+ populate(objectMap, "diskIOPSReadWrite", d.DiskIOPSReadWrite)
+ populate(objectMap, "diskMBpsReadOnly", d.DiskMBpsReadOnly)
+ populate(objectMap, "diskMBpsReadWrite", d.DiskMBpsReadWrite)
+ populate(objectMap, "diskSizeGB", d.DiskSizeGB)
+ populate(objectMap, "encryption", d.Encryption)
+ populate(objectMap, "encryptionSettingsCollection", d.EncryptionSettingsCollection)
+ populate(objectMap, "maxShares", d.MaxShares)
+ populate(objectMap, "networkAccessPolicy", d.NetworkAccessPolicy)
+ populate(objectMap, "osType", d.OSType)
+ populate(objectMap, "optimizedForFrequentAttach", d.OptimizedForFrequentAttach)
+ populate(objectMap, "propertyUpdatesInProgress", d.PropertyUpdatesInProgress)
+ populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess)
+ populate(objectMap, "purchasePlan", d.PurchasePlan)
+ populate(objectMap, "supportedCapabilities", d.SupportedCapabilities)
+ populate(objectMap, "supportsHibernation", d.SupportsHibernation)
+ populate(objectMap, "tier", d.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DiskUpdateProperties.
+func (d *DiskUpdateProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "burstingEnabled":
+ err = unpopulate(val, "BurstingEnabled", &d.BurstingEnabled)
+ delete(rawMsg, key)
+ case "dataAccessAuthMode":
+ err = unpopulate(val, "DataAccessAuthMode", &d.DataAccessAuthMode)
+ delete(rawMsg, key)
+ case "diskAccessId":
+ err = unpopulate(val, "DiskAccessID", &d.DiskAccessID)
+ delete(rawMsg, key)
+ case "diskIOPSReadOnly":
+ err = unpopulate(val, "DiskIOPSReadOnly", &d.DiskIOPSReadOnly)
+ delete(rawMsg, key)
+ case "diskIOPSReadWrite":
+ err = unpopulate(val, "DiskIOPSReadWrite", &d.DiskIOPSReadWrite)
+ delete(rawMsg, key)
+ case "diskMBpsReadOnly":
+ err = unpopulate(val, "DiskMBpsReadOnly", &d.DiskMBpsReadOnly)
+ delete(rawMsg, key)
+ case "diskMBpsReadWrite":
+ err = unpopulate(val, "DiskMBpsReadWrite", &d.DiskMBpsReadWrite)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &d.DiskSizeGB)
+ delete(rawMsg, key)
+ case "encryption":
+ err = unpopulate(val, "Encryption", &d.Encryption)
+ delete(rawMsg, key)
+ case "encryptionSettingsCollection":
+ err = unpopulate(val, "EncryptionSettingsCollection", &d.EncryptionSettingsCollection)
+ delete(rawMsg, key)
+ case "maxShares":
+ err = unpopulate(val, "MaxShares", &d.MaxShares)
+ delete(rawMsg, key)
+ case "networkAccessPolicy":
+ err = unpopulate(val, "NetworkAccessPolicy", &d.NetworkAccessPolicy)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &d.OSType)
+ delete(rawMsg, key)
+ case "optimizedForFrequentAttach":
+ err = unpopulate(val, "OptimizedForFrequentAttach", &d.OptimizedForFrequentAttach)
+ delete(rawMsg, key)
+ case "propertyUpdatesInProgress":
+ err = unpopulate(val, "PropertyUpdatesInProgress", &d.PropertyUpdatesInProgress)
+ delete(rawMsg, key)
+ case "publicNetworkAccess":
+ err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess)
+ delete(rawMsg, key)
+ case "purchasePlan":
+ err = unpopulate(val, "PurchasePlan", &d.PurchasePlan)
+ delete(rawMsg, key)
+ case "supportedCapabilities":
+ err = unpopulate(val, "SupportedCapabilities", &d.SupportedCapabilities)
+ delete(rawMsg, key)
+ case "supportsHibernation":
+ err = unpopulate(val, "SupportsHibernation", &d.SupportsHibernation)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &d.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Encryption.
+func (e Encryption) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskEncryptionSetId", e.DiskEncryptionSetID)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Encryption.
+func (e *Encryption) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskEncryptionSetId":
+ err = unpopulate(val, "DiskEncryptionSetID", &e.DiskEncryptionSetID)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionImages.
+func (e EncryptionImages) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dataDiskImages", e.DataDiskImages)
+ populate(objectMap, "osDiskImage", e.OSDiskImage)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionImages.
+func (e *EncryptionImages) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dataDiskImages":
+ err = unpopulate(val, "DataDiskImages", &e.DataDiskImages)
+ delete(rawMsg, key)
+ case "osDiskImage":
+ err = unpopulate(val, "OSDiskImage", &e.OSDiskImage)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionSetIdentity.
+func (e EncryptionSetIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "principalId", e.PrincipalID)
+ populate(objectMap, "tenantId", e.TenantID)
+ populate(objectMap, "type", e.Type)
+ populate(objectMap, "userAssignedIdentities", e.UserAssignedIdentities)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetIdentity.
+func (e *EncryptionSetIdentity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &e.PrincipalID)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &e.TenantID)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ case "userAssignedIdentities":
+ err = unpopulate(val, "UserAssignedIdentities", &e.UserAssignedIdentities)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionSetProperties.
+func (e EncryptionSetProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "activeKey", e.ActiveKey)
+ populate(objectMap, "autoKeyRotationError", e.AutoKeyRotationError)
+ populate(objectMap, "encryptionType", e.EncryptionType)
+ populate(objectMap, "federatedClientId", e.FederatedClientID)
+ populateDateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", e.LastKeyRotationTimestamp)
+ populate(objectMap, "previousKeys", e.PreviousKeys)
+ populate(objectMap, "provisioningState", e.ProvisioningState)
+ populate(objectMap, "rotationToLatestKeyVersionEnabled", e.RotationToLatestKeyVersionEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetProperties.
+func (e *EncryptionSetProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "activeKey":
+ err = unpopulate(val, "ActiveKey", &e.ActiveKey)
+ delete(rawMsg, key)
+ case "autoKeyRotationError":
+ err = unpopulate(val, "AutoKeyRotationError", &e.AutoKeyRotationError)
+ delete(rawMsg, key)
+ case "encryptionType":
+ err = unpopulate(val, "EncryptionType", &e.EncryptionType)
+ delete(rawMsg, key)
+ case "federatedClientId":
+ err = unpopulate(val, "FederatedClientID", &e.FederatedClientID)
+ delete(rawMsg, key)
+ case "lastKeyRotationTimestamp":
+ err = unpopulateDateTimeRFC3339(val, "LastKeyRotationTimestamp", &e.LastKeyRotationTimestamp)
+ delete(rawMsg, key)
+ case "previousKeys":
+ err = unpopulate(val, "PreviousKeys", &e.PreviousKeys)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &e.ProvisioningState)
+ delete(rawMsg, key)
+ case "rotationToLatestKeyVersionEnabled":
+ err = unpopulate(val, "RotationToLatestKeyVersionEnabled", &e.RotationToLatestKeyVersionEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionSettingsCollection.
+func (e EncryptionSettingsCollection) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", e.Enabled)
+ populate(objectMap, "encryptionSettings", e.EncryptionSettings)
+ populate(objectMap, "encryptionSettingsVersion", e.EncryptionSettingsVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSettingsCollection.
+func (e *EncryptionSettingsCollection) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &e.Enabled)
+ delete(rawMsg, key)
+ case "encryptionSettings":
+ err = unpopulate(val, "EncryptionSettings", &e.EncryptionSettings)
+ delete(rawMsg, key)
+ case "encryptionSettingsVersion":
+ err = unpopulate(val, "EncryptionSettingsVersion", &e.EncryptionSettingsVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionSettingsElement.
+func (e EncryptionSettingsElement) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskEncryptionKey", e.DiskEncryptionKey)
+ populate(objectMap, "keyEncryptionKey", e.KeyEncryptionKey)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSettingsElement.
+func (e *EncryptionSettingsElement) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskEncryptionKey":
+ err = unpopulate(val, "DiskEncryptionKey", &e.DiskEncryptionKey)
+ delete(rawMsg, key)
+ case "keyEncryptionKey":
+ err = unpopulate(val, "KeyEncryptionKey", &e.KeyEncryptionKey)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation.
+func (e ExtendedLocation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", e.Name)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation.
+func (e *ExtendedLocation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &e.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Extension.
+func (e Extension) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", e.Name)
+ populate(objectMap, "properties", e.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Extension.
+func (e *Extension) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &e.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &e.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Gallery.
+func (g Gallery) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "location", g.Location)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "properties", g.Properties)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Gallery.
+func (g *Gallery) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &g.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplication.
+func (g GalleryApplication) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "location", g.Location)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "properties", g.Properties)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplication.
+func (g *GalleryApplication) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &g.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationCustomAction.
+func (g GalleryApplicationCustomAction) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", g.Description)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "parameters", g.Parameters)
+ populate(objectMap, "script", g.Script)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationCustomAction.
+func (g *GalleryApplicationCustomAction) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &g.Description)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "parameters":
+ err = unpopulate(val, "Parameters", &g.Parameters)
+ delete(rawMsg, key)
+ case "script":
+ err = unpopulate(val, "Script", &g.Script)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationCustomActionParameter.
+func (g GalleryApplicationCustomActionParameter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "defaultValue", g.DefaultValue)
+ populate(objectMap, "description", g.Description)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "required", g.Required)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationCustomActionParameter.
+func (g *GalleryApplicationCustomActionParameter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "defaultValue":
+ err = unpopulate(val, "DefaultValue", &g.DefaultValue)
+ delete(rawMsg, key)
+ case "description":
+ err = unpopulate(val, "Description", &g.Description)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "required":
+ err = unpopulate(val, "Required", &g.Required)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationList.
+func (g GalleryApplicationList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", g.NextLink)
+ populate(objectMap, "value", g.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationList.
+func (g *GalleryApplicationList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &g.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &g.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationProperties.
+func (g GalleryApplicationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "customActions", g.CustomActions)
+ populate(objectMap, "description", g.Description)
+ populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate)
+ populate(objectMap, "eula", g.Eula)
+ populate(objectMap, "privacyStatementUri", g.PrivacyStatementURI)
+ populate(objectMap, "releaseNoteUri", g.ReleaseNoteURI)
+ populate(objectMap, "supportedOSType", g.SupportedOSType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationProperties.
+func (g *GalleryApplicationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "customActions":
+ err = unpopulate(val, "CustomActions", &g.CustomActions)
+ delete(rawMsg, key)
+ case "description":
+ err = unpopulate(val, "Description", &g.Description)
+ delete(rawMsg, key)
+ case "endOfLifeDate":
+ err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate)
+ delete(rawMsg, key)
+ case "eula":
+ err = unpopulate(val, "Eula", &g.Eula)
+ delete(rawMsg, key)
+ case "privacyStatementUri":
+ err = unpopulate(val, "PrivacyStatementURI", &g.PrivacyStatementURI)
+ delete(rawMsg, key)
+ case "releaseNoteUri":
+ err = unpopulate(val, "ReleaseNoteURI", &g.ReleaseNoteURI)
+ delete(rawMsg, key)
+ case "supportedOSType":
+ err = unpopulate(val, "SupportedOSType", &g.SupportedOSType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationUpdate.
+func (g GalleryApplicationUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "properties", g.Properties)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationUpdate.
+func (g *GalleryApplicationUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersion.
+func (g GalleryApplicationVersion) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "location", g.Location)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "properties", g.Properties)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersion.
+func (g *GalleryApplicationVersion) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &g.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionList.
+func (g GalleryApplicationVersionList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", g.NextLink)
+ populate(objectMap, "value", g.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionList.
+func (g *GalleryApplicationVersionList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &g.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &g.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionProperties.
+func (g GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "provisioningState", g.ProvisioningState)
+ populate(objectMap, "publishingProfile", g.PublishingProfile)
+ populate(objectMap, "replicationStatus", g.ReplicationStatus)
+ populate(objectMap, "safetyProfile", g.SafetyProfile)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionProperties.
+func (g *GalleryApplicationVersionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &g.ProvisioningState)
+ delete(rawMsg, key)
+ case "publishingProfile":
+ err = unpopulate(val, "PublishingProfile", &g.PublishingProfile)
+ delete(rawMsg, key)
+ case "replicationStatus":
+ err = unpopulate(val, "ReplicationStatus", &g.ReplicationStatus)
+ delete(rawMsg, key)
+ case "safetyProfile":
+ err = unpopulate(val, "SafetyProfile", &g.SafetyProfile)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionPublishingProfile.
+func (g GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "advancedSettings", g.AdvancedSettings)
+ populate(objectMap, "customActions", g.CustomActions)
+ populate(objectMap, "enableHealthCheck", g.EnableHealthCheck)
+ populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate)
+ populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest)
+ populate(objectMap, "manageActions", g.ManageActions)
+ populateDateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate)
+ populate(objectMap, "replicaCount", g.ReplicaCount)
+ populate(objectMap, "replicationMode", g.ReplicationMode)
+ populate(objectMap, "settings", g.Settings)
+ populate(objectMap, "source", g.Source)
+ populate(objectMap, "storageAccountType", g.StorageAccountType)
+ populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations)
+ populate(objectMap, "targetRegions", g.TargetRegions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionPublishingProfile.
+func (g *GalleryApplicationVersionPublishingProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "advancedSettings":
+ err = unpopulate(val, "AdvancedSettings", &g.AdvancedSettings)
+ delete(rawMsg, key)
+ case "customActions":
+ err = unpopulate(val, "CustomActions", &g.CustomActions)
+ delete(rawMsg, key)
+ case "enableHealthCheck":
+ err = unpopulate(val, "EnableHealthCheck", &g.EnableHealthCheck)
+ delete(rawMsg, key)
+ case "endOfLifeDate":
+ err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate)
+ delete(rawMsg, key)
+ case "excludeFromLatest":
+ err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest)
+ delete(rawMsg, key)
+ case "manageActions":
+ err = unpopulate(val, "ManageActions", &g.ManageActions)
+ delete(rawMsg, key)
+ case "publishedDate":
+ err = unpopulateDateTimeRFC3339(val, "PublishedDate", &g.PublishedDate)
+ delete(rawMsg, key)
+ case "replicaCount":
+ err = unpopulate(val, "ReplicaCount", &g.ReplicaCount)
+ delete(rawMsg, key)
+ case "replicationMode":
+ err = unpopulate(val, "ReplicationMode", &g.ReplicationMode)
+ delete(rawMsg, key)
+ case "settings":
+ err = unpopulate(val, "Settings", &g.Settings)
+ delete(rawMsg, key)
+ case "source":
+ err = unpopulate(val, "Source", &g.Source)
+ delete(rawMsg, key)
+ case "storageAccountType":
+ err = unpopulate(val, "StorageAccountType", &g.StorageAccountType)
+ delete(rawMsg, key)
+ case "targetExtendedLocations":
+ err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations)
+ delete(rawMsg, key)
+ case "targetRegions":
+ err = unpopulate(val, "TargetRegions", &g.TargetRegions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionSafetyProfile.
+func (g GalleryApplicationVersionSafetyProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowDeletionOfReplicatedLocations", g.AllowDeletionOfReplicatedLocations)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionSafetyProfile.
+func (g *GalleryApplicationVersionSafetyProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowDeletionOfReplicatedLocations":
+ err = unpopulate(val, "AllowDeletionOfReplicatedLocations", &g.AllowDeletionOfReplicatedLocations)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionUpdate.
+func (g GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "properties", g.Properties)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryApplicationVersionUpdate.
+func (g *GalleryApplicationVersionUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactPublishingProfileBase.
+func (g GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate)
+ populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest)
+ populateDateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate)
+ populate(objectMap, "replicaCount", g.ReplicaCount)
+ populate(objectMap, "replicationMode", g.ReplicationMode)
+ populate(objectMap, "storageAccountType", g.StorageAccountType)
+ populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations)
+ populate(objectMap, "targetRegions", g.TargetRegions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactPublishingProfileBase.
+func (g *GalleryArtifactPublishingProfileBase) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endOfLifeDate":
+ err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate)
+ delete(rawMsg, key)
+ case "excludeFromLatest":
+ err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest)
+ delete(rawMsg, key)
+ case "publishedDate":
+ err = unpopulateDateTimeRFC3339(val, "PublishedDate", &g.PublishedDate)
+ delete(rawMsg, key)
+ case "replicaCount":
+ err = unpopulate(val, "ReplicaCount", &g.ReplicaCount)
+ delete(rawMsg, key)
+ case "replicationMode":
+ err = unpopulate(val, "ReplicationMode", &g.ReplicationMode)
+ delete(rawMsg, key)
+ case "storageAccountType":
+ err = unpopulate(val, "StorageAccountType", &g.StorageAccountType)
+ delete(rawMsg, key)
+ case "targetExtendedLocations":
+ err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations)
+ delete(rawMsg, key)
+ case "targetRegions":
+ err = unpopulate(val, "TargetRegions", &g.TargetRegions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactSafetyProfileBase.
+func (g GalleryArtifactSafetyProfileBase) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowDeletionOfReplicatedLocations", g.AllowDeletionOfReplicatedLocations)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactSafetyProfileBase.
+func (g *GalleryArtifactSafetyProfileBase) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowDeletionOfReplicatedLocations":
+ err = unpopulate(val, "AllowDeletionOfReplicatedLocations", &g.AllowDeletionOfReplicatedLocations)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactSource.
+func (g GalleryArtifactSource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "managedImage", g.ManagedImage)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactSource.
+func (g *GalleryArtifactSource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "managedImage":
+ err = unpopulate(val, "ManagedImage", &g.ManagedImage)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactVersionFullSource.
+func (g GalleryArtifactVersionFullSource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "communityGalleryImageId", g.CommunityGalleryImageID)
+ populate(objectMap, "id", g.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactVersionFullSource.
+func (g *GalleryArtifactVersionFullSource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "communityGalleryImageId":
+ err = unpopulate(val, "CommunityGalleryImageID", &g.CommunityGalleryImageID)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryArtifactVersionSource.
+func (g GalleryArtifactVersionSource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryArtifactVersionSource.
+func (g *GalleryArtifactVersionSource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryDataDiskImage.
+func (g GalleryDataDiskImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "hostCaching", g.HostCaching)
+ populate(objectMap, "lun", g.Lun)
+ populate(objectMap, "sizeInGB", g.SizeInGB)
+ populate(objectMap, "source", g.Source)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDataDiskImage.
+func (g *GalleryDataDiskImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "hostCaching":
+ err = unpopulate(val, "HostCaching", &g.HostCaching)
+ delete(rawMsg, key)
+ case "lun":
+ err = unpopulate(val, "Lun", &g.Lun)
+ delete(rawMsg, key)
+ case "sizeInGB":
+ err = unpopulate(val, "SizeInGB", &g.SizeInGB)
+ delete(rawMsg, key)
+ case "source":
+ err = unpopulate(val, "Source", &g.Source)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryDiskImage.
+func (g GalleryDiskImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "hostCaching", g.HostCaching)
+ populate(objectMap, "sizeInGB", g.SizeInGB)
+ populate(objectMap, "source", g.Source)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDiskImage.
+func (g *GalleryDiskImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "hostCaching":
+ err = unpopulate(val, "HostCaching", &g.HostCaching)
+ delete(rawMsg, key)
+ case "sizeInGB":
+ err = unpopulate(val, "SizeInGB", &g.SizeInGB)
+ delete(rawMsg, key)
+ case "source":
+ err = unpopulate(val, "Source", &g.Source)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryDiskImageSource.
+func (g GalleryDiskImageSource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "storageAccountId", g.StorageAccountID)
+ populate(objectMap, "uri", g.URI)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryDiskImageSource.
+func (g *GalleryDiskImageSource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "storageAccountId":
+ err = unpopulate(val, "StorageAccountID", &g.StorageAccountID)
+ delete(rawMsg, key)
+ case "uri":
+ err = unpopulate(val, "URI", &g.URI)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryExtendedLocation.
+func (g GalleryExtendedLocation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryExtendedLocation.
+func (g *GalleryExtendedLocation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryIdentifier.
+func (g GalleryIdentifier) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "uniqueName", g.UniqueName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryIdentifier.
+func (g *GalleryIdentifier) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "uniqueName":
+ err = unpopulate(val, "UniqueName", &g.UniqueName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImage.
+func (g GalleryImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "location", g.Location)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "properties", g.Properties)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImage.
+func (g *GalleryImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &g.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageFeature.
+func (g GalleryImageFeature) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "value", g.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageFeature.
+func (g *GalleryImageFeature) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &g.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageIdentifier.
+func (g GalleryImageIdentifier) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "offer", g.Offer)
+ populate(objectMap, "publisher", g.Publisher)
+ populate(objectMap, "sku", g.SKU)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageIdentifier.
+func (g *GalleryImageIdentifier) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "offer":
+ err = unpopulate(val, "Offer", &g.Offer)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &g.Publisher)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &g.SKU)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageList.
+func (g GalleryImageList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", g.NextLink)
+ populate(objectMap, "value", g.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageList.
+func (g *GalleryImageList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &g.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &g.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageProperties.
+func (g GalleryImageProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "architecture", g.Architecture)
+ populate(objectMap, "description", g.Description)
+ populate(objectMap, "disallowed", g.Disallowed)
+ populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate)
+ populate(objectMap, "eula", g.Eula)
+ populate(objectMap, "features", g.Features)
+ populate(objectMap, "hyperVGeneration", g.HyperVGeneration)
+ populate(objectMap, "identifier", g.Identifier)
+ populate(objectMap, "osState", g.OSState)
+ populate(objectMap, "osType", g.OSType)
+ populate(objectMap, "privacyStatementUri", g.PrivacyStatementURI)
+ populate(objectMap, "provisioningState", g.ProvisioningState)
+ populate(objectMap, "purchasePlan", g.PurchasePlan)
+ populate(objectMap, "recommended", g.Recommended)
+ populate(objectMap, "releaseNoteUri", g.ReleaseNoteURI)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageProperties.
+func (g *GalleryImageProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "architecture":
+ err = unpopulate(val, "Architecture", &g.Architecture)
+ delete(rawMsg, key)
+ case "description":
+ err = unpopulate(val, "Description", &g.Description)
+ delete(rawMsg, key)
+ case "disallowed":
+ err = unpopulate(val, "Disallowed", &g.Disallowed)
+ delete(rawMsg, key)
+ case "endOfLifeDate":
+ err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate)
+ delete(rawMsg, key)
+ case "eula":
+ err = unpopulate(val, "Eula", &g.Eula)
+ delete(rawMsg, key)
+ case "features":
+ err = unpopulate(val, "Features", &g.Features)
+ delete(rawMsg, key)
+ case "hyperVGeneration":
+ err = unpopulate(val, "HyperVGeneration", &g.HyperVGeneration)
+ delete(rawMsg, key)
+ case "identifier":
+ err = unpopulate(val, "Identifier", &g.Identifier)
+ delete(rawMsg, key)
+ case "osState":
+ err = unpopulate(val, "OSState", &g.OSState)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &g.OSType)
+ delete(rawMsg, key)
+ case "privacyStatementUri":
+ err = unpopulate(val, "PrivacyStatementURI", &g.PrivacyStatementURI)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &g.ProvisioningState)
+ delete(rawMsg, key)
+ case "purchasePlan":
+ err = unpopulate(val, "PurchasePlan", &g.PurchasePlan)
+ delete(rawMsg, key)
+ case "recommended":
+ err = unpopulate(val, "Recommended", &g.Recommended)
+ delete(rawMsg, key)
+ case "releaseNoteUri":
+ err = unpopulate(val, "ReleaseNoteURI", &g.ReleaseNoteURI)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageUpdate.
+func (g GalleryImageUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "properties", g.Properties)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageUpdate.
+func (g *GalleryImageUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersion.
+func (g GalleryImageVersion) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "location", g.Location)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "properties", g.Properties)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersion.
+func (g *GalleryImageVersion) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &g.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionList.
+func (g GalleryImageVersionList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", g.NextLink)
+ populate(objectMap, "value", g.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionList.
+func (g *GalleryImageVersionList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &g.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &g.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionProperties.
+func (g GalleryImageVersionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "provisioningState", g.ProvisioningState)
+ populate(objectMap, "publishingProfile", g.PublishingProfile)
+ populate(objectMap, "replicationStatus", g.ReplicationStatus)
+ populate(objectMap, "safetyProfile", g.SafetyProfile)
+ populate(objectMap, "storageProfile", g.StorageProfile)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionProperties.
+func (g *GalleryImageVersionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &g.ProvisioningState)
+ delete(rawMsg, key)
+ case "publishingProfile":
+ err = unpopulate(val, "PublishingProfile", &g.PublishingProfile)
+ delete(rawMsg, key)
+ case "replicationStatus":
+ err = unpopulate(val, "ReplicationStatus", &g.ReplicationStatus)
+ delete(rawMsg, key)
+ case "safetyProfile":
+ err = unpopulate(val, "SafetyProfile", &g.SafetyProfile)
+ delete(rawMsg, key)
+ case "storageProfile":
+ err = unpopulate(val, "StorageProfile", &g.StorageProfile)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionPublishingProfile.
+func (g GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate)
+ populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest)
+ populateDateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate)
+ populate(objectMap, "replicaCount", g.ReplicaCount)
+ populate(objectMap, "replicationMode", g.ReplicationMode)
+ populate(objectMap, "storageAccountType", g.StorageAccountType)
+ populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations)
+ populate(objectMap, "targetRegions", g.TargetRegions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionPublishingProfile.
+func (g *GalleryImageVersionPublishingProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endOfLifeDate":
+ err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &g.EndOfLifeDate)
+ delete(rawMsg, key)
+ case "excludeFromLatest":
+ err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest)
+ delete(rawMsg, key)
+ case "publishedDate":
+ err = unpopulateDateTimeRFC3339(val, "PublishedDate", &g.PublishedDate)
+ delete(rawMsg, key)
+ case "replicaCount":
+ err = unpopulate(val, "ReplicaCount", &g.ReplicaCount)
+ delete(rawMsg, key)
+ case "replicationMode":
+ err = unpopulate(val, "ReplicationMode", &g.ReplicationMode)
+ delete(rawMsg, key)
+ case "storageAccountType":
+ err = unpopulate(val, "StorageAccountType", &g.StorageAccountType)
+ delete(rawMsg, key)
+ case "targetExtendedLocations":
+ err = unpopulate(val, "TargetExtendedLocations", &g.TargetExtendedLocations)
+ delete(rawMsg, key)
+ case "targetRegions":
+ err = unpopulate(val, "TargetRegions", &g.TargetRegions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionSafetyProfile.
+func (g GalleryImageVersionSafetyProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowDeletionOfReplicatedLocations", g.AllowDeletionOfReplicatedLocations)
+ populate(objectMap, "policyViolations", g.PolicyViolations)
+ populate(objectMap, "reportedForPolicyViolation", g.ReportedForPolicyViolation)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionSafetyProfile.
+func (g *GalleryImageVersionSafetyProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowDeletionOfReplicatedLocations":
+ err = unpopulate(val, "AllowDeletionOfReplicatedLocations", &g.AllowDeletionOfReplicatedLocations)
+ delete(rawMsg, key)
+ case "policyViolations":
+ err = unpopulate(val, "PolicyViolations", &g.PolicyViolations)
+ delete(rawMsg, key)
+ case "reportedForPolicyViolation":
+ err = unpopulate(val, "ReportedForPolicyViolation", &g.ReportedForPolicyViolation)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionStorageProfile.
+func (g GalleryImageVersionStorageProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dataDiskImages", g.DataDiskImages)
+ populate(objectMap, "osDiskImage", g.OSDiskImage)
+ populate(objectMap, "source", g.Source)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionStorageProfile.
+func (g *GalleryImageVersionStorageProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dataDiskImages":
+ err = unpopulate(val, "DataDiskImages", &g.DataDiskImages)
+ delete(rawMsg, key)
+ case "osDiskImage":
+ err = unpopulate(val, "OSDiskImage", &g.OSDiskImage)
+ delete(rawMsg, key)
+ case "source":
+ err = unpopulate(val, "Source", &g.Source)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUpdate.
+func (g GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "properties", g.Properties)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionUpdate.
+func (g *GalleryImageVersionUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryList.
+func (g GalleryList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", g.NextLink)
+ populate(objectMap, "value", g.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryList.
+func (g *GalleryList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &g.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &g.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryOSDiskImage.
+func (g GalleryOSDiskImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "hostCaching", g.HostCaching)
+ populate(objectMap, "sizeInGB", g.SizeInGB)
+ populate(objectMap, "source", g.Source)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryOSDiskImage.
+func (g *GalleryOSDiskImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "hostCaching":
+ err = unpopulate(val, "HostCaching", &g.HostCaching)
+ delete(rawMsg, key)
+ case "sizeInGB":
+ err = unpopulate(val, "SizeInGB", &g.SizeInGB)
+ delete(rawMsg, key)
+ case "source":
+ err = unpopulate(val, "Source", &g.Source)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryProperties.
+func (g GalleryProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", g.Description)
+ populate(objectMap, "identifier", g.Identifier)
+ populate(objectMap, "provisioningState", g.ProvisioningState)
+ populate(objectMap, "sharingProfile", g.SharingProfile)
+ populate(objectMap, "sharingStatus", g.SharingStatus)
+ populate(objectMap, "softDeletePolicy", g.SoftDeletePolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryProperties.
+func (g *GalleryProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &g.Description)
+ delete(rawMsg, key)
+ case "identifier":
+ err = unpopulate(val, "Identifier", &g.Identifier)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &g.ProvisioningState)
+ delete(rawMsg, key)
+ case "sharingProfile":
+ err = unpopulate(val, "SharingProfile", &g.SharingProfile)
+ delete(rawMsg, key)
+ case "sharingStatus":
+ err = unpopulate(val, "SharingStatus", &g.SharingStatus)
+ delete(rawMsg, key)
+ case "softDeletePolicy":
+ err = unpopulate(val, "SoftDeletePolicy", &g.SoftDeletePolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryTargetExtendedLocation.
+func (g GalleryTargetExtendedLocation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "encryption", g.Encryption)
+ populate(objectMap, "extendedLocation", g.ExtendedLocation)
+ populate(objectMap, "extendedLocationReplicaCount", g.ExtendedLocationReplicaCount)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "storageAccountType", g.StorageAccountType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryTargetExtendedLocation.
+func (g *GalleryTargetExtendedLocation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "encryption":
+ err = unpopulate(val, "Encryption", &g.Encryption)
+ delete(rawMsg, key)
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &g.ExtendedLocation)
+ delete(rawMsg, key)
+ case "extendedLocationReplicaCount":
+ err = unpopulate(val, "ExtendedLocationReplicaCount", &g.ExtendedLocationReplicaCount)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "storageAccountType":
+ err = unpopulate(val, "StorageAccountType", &g.StorageAccountType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GalleryUpdate.
+func (g GalleryUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "properties", g.Properties)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryUpdate.
+func (g *GalleryUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GrantAccessData.
+func (g GrantAccessData) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "access", g.Access)
+ populate(objectMap, "durationInSeconds", g.DurationInSeconds)
+ populate(objectMap, "fileFormat", g.FileFormat)
+ populate(objectMap, "getSecureVMGuestStateSAS", g.GetSecureVMGuestStateSAS)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GrantAccessData.
+func (g *GrantAccessData) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "access":
+ err = unpopulate(val, "Access", &g.Access)
+ delete(rawMsg, key)
+ case "durationInSeconds":
+ err = unpopulate(val, "DurationInSeconds", &g.DurationInSeconds)
+ delete(rawMsg, key)
+ case "fileFormat":
+ err = unpopulate(val, "FileFormat", &g.FileFormat)
+ delete(rawMsg, key)
+ case "getSecureVMGuestStateSAS":
+ err = unpopulate(val, "GetSecureVMGuestStateSAS", &g.GetSecureVMGuestStateSAS)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type HardwareProfile.
+func (h HardwareProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "vmSize", h.VMSize)
+ populate(objectMap, "vmSizeProperties", h.VMSizeProperties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type HardwareProfile.
+func (h *HardwareProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", h, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "vmSize":
+ err = unpopulate(val, "VMSize", &h.VMSize)
+ delete(rawMsg, key)
+ case "vmSizeProperties":
+ err = unpopulate(val, "VMSizeProperties", &h.VMSizeProperties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", h, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Image.
+func (i Image) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", i.ExtendedLocation)
+ populate(objectMap, "id", i.ID)
+ populate(objectMap, "location", i.Location)
+ populate(objectMap, "name", i.Name)
+ populate(objectMap, "properties", i.Properties)
+ populate(objectMap, "tags", i.Tags)
+ populate(objectMap, "type", i.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Image.
+func (i *Image) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &i.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &i.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &i.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &i.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &i.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &i.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &i.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImageDataDisk.
+func (i ImageDataDisk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobUri", i.BlobURI)
+ populate(objectMap, "caching", i.Caching)
+ populate(objectMap, "diskEncryptionSet", i.DiskEncryptionSet)
+ populate(objectMap, "diskSizeGB", i.DiskSizeGB)
+ populate(objectMap, "lun", i.Lun)
+ populate(objectMap, "managedDisk", i.ManagedDisk)
+ populate(objectMap, "snapshot", i.Snapshot)
+ populate(objectMap, "storageAccountType", i.StorageAccountType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDataDisk.
+func (i *ImageDataDisk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobUri":
+ err = unpopulate(val, "BlobURI", &i.BlobURI)
+ delete(rawMsg, key)
+ case "caching":
+ err = unpopulate(val, "Caching", &i.Caching)
+ delete(rawMsg, key)
+ case "diskEncryptionSet":
+ err = unpopulate(val, "DiskEncryptionSet", &i.DiskEncryptionSet)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &i.DiskSizeGB)
+ delete(rawMsg, key)
+ case "lun":
+ err = unpopulate(val, "Lun", &i.Lun)
+ delete(rawMsg, key)
+ case "managedDisk":
+ err = unpopulate(val, "ManagedDisk", &i.ManagedDisk)
+ delete(rawMsg, key)
+ case "snapshot":
+ err = unpopulate(val, "Snapshot", &i.Snapshot)
+ delete(rawMsg, key)
+ case "storageAccountType":
+ err = unpopulate(val, "StorageAccountType", &i.StorageAccountType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImageDeprecationStatus.
+func (i ImageDeprecationStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "alternativeOption", i.AlternativeOption)
+ populate(objectMap, "imageState", i.ImageState)
+ populateDateTimeRFC3339(objectMap, "scheduledDeprecationTime", i.ScheduledDeprecationTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDeprecationStatus.
+func (i *ImageDeprecationStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "alternativeOption":
+ err = unpopulate(val, "AlternativeOption", &i.AlternativeOption)
+ delete(rawMsg, key)
+ case "imageState":
+ err = unpopulate(val, "ImageState", &i.ImageState)
+ delete(rawMsg, key)
+ case "scheduledDeprecationTime":
+ err = unpopulateDateTimeRFC3339(val, "ScheduledDeprecationTime", &i.ScheduledDeprecationTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImageDisk.
+func (i ImageDisk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobUri", i.BlobURI)
+ populate(objectMap, "caching", i.Caching)
+ populate(objectMap, "diskEncryptionSet", i.DiskEncryptionSet)
+ populate(objectMap, "diskSizeGB", i.DiskSizeGB)
+ populate(objectMap, "managedDisk", i.ManagedDisk)
+ populate(objectMap, "snapshot", i.Snapshot)
+ populate(objectMap, "storageAccountType", i.StorageAccountType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDisk.
+func (i *ImageDisk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobUri":
+ err = unpopulate(val, "BlobURI", &i.BlobURI)
+ delete(rawMsg, key)
+ case "caching":
+ err = unpopulate(val, "Caching", &i.Caching)
+ delete(rawMsg, key)
+ case "diskEncryptionSet":
+ err = unpopulate(val, "DiskEncryptionSet", &i.DiskEncryptionSet)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &i.DiskSizeGB)
+ delete(rawMsg, key)
+ case "managedDisk":
+ err = unpopulate(val, "ManagedDisk", &i.ManagedDisk)
+ delete(rawMsg, key)
+ case "snapshot":
+ err = unpopulate(val, "Snapshot", &i.Snapshot)
+ delete(rawMsg, key)
+ case "storageAccountType":
+ err = unpopulate(val, "StorageAccountType", &i.StorageAccountType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImageDiskReference.
+func (i ImageDiskReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "communityGalleryImageId", i.CommunityGalleryImageID)
+ populate(objectMap, "id", i.ID)
+ populate(objectMap, "lun", i.Lun)
+ populate(objectMap, "sharedGalleryImageId", i.SharedGalleryImageID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDiskReference.
+func (i *ImageDiskReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "communityGalleryImageId":
+ err = unpopulate(val, "CommunityGalleryImageID", &i.CommunityGalleryImageID)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &i.ID)
+ delete(rawMsg, key)
+ case "lun":
+ err = unpopulate(val, "Lun", &i.Lun)
+ delete(rawMsg, key)
+ case "sharedGalleryImageId":
+ err = unpopulate(val, "SharedGalleryImageID", &i.SharedGalleryImageID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImageListResult.
+func (i ImageListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", i.NextLink)
+ populate(objectMap, "value", i.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImageListResult.
+func (i *ImageListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &i.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &i.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImageOSDisk.
+func (i ImageOSDisk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobUri", i.BlobURI)
+ populate(objectMap, "caching", i.Caching)
+ populate(objectMap, "diskEncryptionSet", i.DiskEncryptionSet)
+ populate(objectMap, "diskSizeGB", i.DiskSizeGB)
+ populate(objectMap, "managedDisk", i.ManagedDisk)
+ populate(objectMap, "osState", i.OSState)
+ populate(objectMap, "osType", i.OSType)
+ populate(objectMap, "snapshot", i.Snapshot)
+ populate(objectMap, "storageAccountType", i.StorageAccountType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImageOSDisk.
+func (i *ImageOSDisk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobUri":
+ err = unpopulate(val, "BlobURI", &i.BlobURI)
+ delete(rawMsg, key)
+ case "caching":
+ err = unpopulate(val, "Caching", &i.Caching)
+ delete(rawMsg, key)
+ case "diskEncryptionSet":
+ err = unpopulate(val, "DiskEncryptionSet", &i.DiskEncryptionSet)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &i.DiskSizeGB)
+ delete(rawMsg, key)
+ case "managedDisk":
+ err = unpopulate(val, "ManagedDisk", &i.ManagedDisk)
+ delete(rawMsg, key)
+ case "osState":
+ err = unpopulate(val, "OSState", &i.OSState)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &i.OSType)
+ delete(rawMsg, key)
+ case "snapshot":
+ err = unpopulate(val, "Snapshot", &i.Snapshot)
+ delete(rawMsg, key)
+ case "storageAccountType":
+ err = unpopulate(val, "StorageAccountType", &i.StorageAccountType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImageProperties.
+func (i ImageProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "hyperVGeneration", i.HyperVGeneration)
+ populate(objectMap, "provisioningState", i.ProvisioningState)
+ populate(objectMap, "sourceVirtualMachine", i.SourceVirtualMachine)
+ populate(objectMap, "storageProfile", i.StorageProfile)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImageProperties.
+func (i *ImageProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "hyperVGeneration":
+ err = unpopulate(val, "HyperVGeneration", &i.HyperVGeneration)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &i.ProvisioningState)
+ delete(rawMsg, key)
+ case "sourceVirtualMachine":
+ err = unpopulate(val, "SourceVirtualMachine", &i.SourceVirtualMachine)
+ delete(rawMsg, key)
+ case "storageProfile":
+ err = unpopulate(val, "StorageProfile", &i.StorageProfile)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImagePurchasePlan.
+func (i ImagePurchasePlan) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", i.Name)
+ populate(objectMap, "product", i.Product)
+ populate(objectMap, "publisher", i.Publisher)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImagePurchasePlan.
+func (i *ImagePurchasePlan) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &i.Name)
+ delete(rawMsg, key)
+ case "product":
+ err = unpopulate(val, "Product", &i.Product)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &i.Publisher)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImageReference.
+func (i ImageReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "communityGalleryImageId", i.CommunityGalleryImageID)
+ populate(objectMap, "exactVersion", i.ExactVersion)
+ populate(objectMap, "id", i.ID)
+ populate(objectMap, "offer", i.Offer)
+ populate(objectMap, "publisher", i.Publisher)
+ populate(objectMap, "sku", i.SKU)
+ populate(objectMap, "sharedGalleryImageId", i.SharedGalleryImageID)
+ populate(objectMap, "version", i.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImageReference.
+func (i *ImageReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "communityGalleryImageId":
+ err = unpopulate(val, "CommunityGalleryImageID", &i.CommunityGalleryImageID)
+ delete(rawMsg, key)
+ case "exactVersion":
+ err = unpopulate(val, "ExactVersion", &i.ExactVersion)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &i.ID)
+ delete(rawMsg, key)
+ case "offer":
+ err = unpopulate(val, "Offer", &i.Offer)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &i.Publisher)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &i.SKU)
+ delete(rawMsg, key)
+ case "sharedGalleryImageId":
+ err = unpopulate(val, "SharedGalleryImageID", &i.SharedGalleryImageID)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &i.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImageStorageProfile.
+func (i ImageStorageProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dataDisks", i.DataDisks)
+ populate(objectMap, "osDisk", i.OSDisk)
+ populate(objectMap, "zoneResilient", i.ZoneResilient)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImageStorageProfile.
+func (i *ImageStorageProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dataDisks":
+ err = unpopulate(val, "DataDisks", &i.DataDisks)
+ delete(rawMsg, key)
+ case "osDisk":
+ err = unpopulate(val, "OSDisk", &i.OSDisk)
+ delete(rawMsg, key)
+ case "zoneResilient":
+ err = unpopulate(val, "ZoneResilient", &i.ZoneResilient)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImageUpdate.
+func (i ImageUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", i.Properties)
+ populate(objectMap, "tags", i.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImageUpdate.
+func (i *ImageUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &i.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &i.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type InnerError.
+func (i InnerError) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "errordetail", i.Errordetail)
+ populate(objectMap, "exceptiontype", i.Exceptiontype)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type InnerError.
+func (i *InnerError) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "errordetail":
+ err = unpopulate(val, "Errordetail", &i.Errordetail)
+ delete(rawMsg, key)
+ case "exceptiontype":
+ err = unpopulate(val, "Exceptiontype", &i.Exceptiontype)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type InstanceSKU.
+func (i InstanceSKU) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", i.Name)
+ populate(objectMap, "tier", i.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceSKU.
+func (i *InstanceSKU) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &i.Name)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &i.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type InstanceViewStatus.
+func (i InstanceViewStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "code", i.Code)
+ populate(objectMap, "displayStatus", i.DisplayStatus)
+ populate(objectMap, "level", i.Level)
+ populate(objectMap, "message", i.Message)
+ populateDateTimeRFC3339(objectMap, "time", i.Time)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceViewStatus.
+func (i *InstanceViewStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "code":
+ err = unpopulate(val, "Code", &i.Code)
+ delete(rawMsg, key)
+ case "displayStatus":
+ err = unpopulate(val, "DisplayStatus", &i.DisplayStatus)
+ delete(rawMsg, key)
+ case "level":
+ err = unpopulate(val, "Level", &i.Level)
+ delete(rawMsg, key)
+ case "message":
+ err = unpopulate(val, "Message", &i.Message)
+ delete(rawMsg, key)
+ case "time":
+ err = unpopulateDateTimeRFC3339(val, "Time", &i.Time)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type InstanceViewStatusesSummary.
+func (i InstanceViewStatusesSummary) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "statusesSummary", i.StatusesSummary)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceViewStatusesSummary.
+func (i *InstanceViewStatusesSummary) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "statusesSummary":
+ err = unpopulate(val, "StatusesSummary", &i.StatusesSummary)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type KeyForDiskEncryptionSet.
+func (k KeyForDiskEncryptionSet) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "keyUrl", k.KeyURL)
+ populate(objectMap, "sourceVault", k.SourceVault)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type KeyForDiskEncryptionSet.
+func (k *KeyForDiskEncryptionSet) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "keyUrl":
+ err = unpopulate(val, "KeyURL", &k.KeyURL)
+ delete(rawMsg, key)
+ case "sourceVault":
+ err = unpopulate(val, "SourceVault", &k.SourceVault)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type KeyVaultAndKeyReference.
+func (k KeyVaultAndKeyReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "keyUrl", k.KeyURL)
+ populate(objectMap, "sourceVault", k.SourceVault)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultAndKeyReference.
+func (k *KeyVaultAndKeyReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "keyUrl":
+ err = unpopulate(val, "KeyURL", &k.KeyURL)
+ delete(rawMsg, key)
+ case "sourceVault":
+ err = unpopulate(val, "SourceVault", &k.SourceVault)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type KeyVaultAndSecretReference.
+func (k KeyVaultAndSecretReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "secretUrl", k.SecretURL)
+ populate(objectMap, "sourceVault", k.SourceVault)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultAndSecretReference.
+func (k *KeyVaultAndSecretReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "secretUrl":
+ err = unpopulate(val, "SecretURL", &k.SecretURL)
+ delete(rawMsg, key)
+ case "sourceVault":
+ err = unpopulate(val, "SourceVault", &k.SourceVault)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type KeyVaultKeyReference.
+func (k KeyVaultKeyReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "keyUrl", k.KeyURL)
+ populate(objectMap, "sourceVault", k.SourceVault)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultKeyReference.
+func (k *KeyVaultKeyReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "keyUrl":
+ err = unpopulate(val, "KeyURL", &k.KeyURL)
+ delete(rawMsg, key)
+ case "sourceVault":
+ err = unpopulate(val, "SourceVault", &k.SourceVault)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type KeyVaultSecretReference.
+func (k KeyVaultSecretReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "secretUrl", k.SecretURL)
+ populate(objectMap, "sourceVault", k.SourceVault)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultSecretReference.
+func (k *KeyVaultSecretReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "secretUrl":
+ err = unpopulate(val, "SecretURL", &k.SecretURL)
+ delete(rawMsg, key)
+ case "sourceVault":
+ err = unpopulate(val, "SourceVault", &k.SourceVault)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LastPatchInstallationSummary.
+func (l LastPatchInstallationSummary) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", l.Error)
+ populate(objectMap, "excludedPatchCount", l.ExcludedPatchCount)
+ populate(objectMap, "failedPatchCount", l.FailedPatchCount)
+ populate(objectMap, "installationActivityId", l.InstallationActivityID)
+ populate(objectMap, "installedPatchCount", l.InstalledPatchCount)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", l.LastModifiedTime)
+ populate(objectMap, "maintenanceWindowExceeded", l.MaintenanceWindowExceeded)
+ populate(objectMap, "notSelectedPatchCount", l.NotSelectedPatchCount)
+ populate(objectMap, "pendingPatchCount", l.PendingPatchCount)
+ populateDateTimeRFC3339(objectMap, "startTime", l.StartTime)
+ populate(objectMap, "status", l.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LastPatchInstallationSummary.
+func (l *LastPatchInstallationSummary) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &l.Error)
+ delete(rawMsg, key)
+ case "excludedPatchCount":
+ err = unpopulate(val, "ExcludedPatchCount", &l.ExcludedPatchCount)
+ delete(rawMsg, key)
+ case "failedPatchCount":
+ err = unpopulate(val, "FailedPatchCount", &l.FailedPatchCount)
+ delete(rawMsg, key)
+ case "installationActivityId":
+ err = unpopulate(val, "InstallationActivityID", &l.InstallationActivityID)
+ delete(rawMsg, key)
+ case "installedPatchCount":
+ err = unpopulate(val, "InstalledPatchCount", &l.InstalledPatchCount)
+ delete(rawMsg, key)
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &l.LastModifiedTime)
+ delete(rawMsg, key)
+ case "maintenanceWindowExceeded":
+ err = unpopulate(val, "MaintenanceWindowExceeded", &l.MaintenanceWindowExceeded)
+ delete(rawMsg, key)
+ case "notSelectedPatchCount":
+ err = unpopulate(val, "NotSelectedPatchCount", &l.NotSelectedPatchCount)
+ delete(rawMsg, key)
+ case "pendingPatchCount":
+ err = unpopulate(val, "PendingPatchCount", &l.PendingPatchCount)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulateDateTimeRFC3339(val, "StartTime", &l.StartTime)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &l.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LatestGalleryImageVersion.
+func (l LatestGalleryImageVersion) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "latestVersionName", l.LatestVersionName)
+ populate(objectMap, "location", l.Location)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LatestGalleryImageVersion.
+func (l *LatestGalleryImageVersion) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "latestVersionName":
+ err = unpopulate(val, "LatestVersionName", &l.LatestVersionName)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &l.Location)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LinuxConfiguration.
+func (l LinuxConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "disablePasswordAuthentication", l.DisablePasswordAuthentication)
+ populate(objectMap, "enableVMAgentPlatformUpdates", l.EnableVMAgentPlatformUpdates)
+ populate(objectMap, "patchSettings", l.PatchSettings)
+ populate(objectMap, "provisionVMAgent", l.ProvisionVMAgent)
+ populate(objectMap, "ssh", l.SSH)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxConfiguration.
+func (l *LinuxConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "disablePasswordAuthentication":
+ err = unpopulate(val, "DisablePasswordAuthentication", &l.DisablePasswordAuthentication)
+ delete(rawMsg, key)
+ case "enableVMAgentPlatformUpdates":
+ err = unpopulate(val, "EnableVMAgentPlatformUpdates", &l.EnableVMAgentPlatformUpdates)
+ delete(rawMsg, key)
+ case "patchSettings":
+ err = unpopulate(val, "PatchSettings", &l.PatchSettings)
+ delete(rawMsg, key)
+ case "provisionVMAgent":
+ err = unpopulate(val, "ProvisionVMAgent", &l.ProvisionVMAgent)
+ delete(rawMsg, key)
+ case "ssh":
+ err = unpopulate(val, "SSH", &l.SSH)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LinuxParameters.
+func (l LinuxParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "classificationsToInclude", l.ClassificationsToInclude)
+ populate(objectMap, "maintenanceRunId", l.MaintenanceRunID)
+ populate(objectMap, "packageNameMasksToExclude", l.PackageNameMasksToExclude)
+ populate(objectMap, "packageNameMasksToInclude", l.PackageNameMasksToInclude)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxParameters.
+func (l *LinuxParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "classificationsToInclude":
+ err = unpopulate(val, "ClassificationsToInclude", &l.ClassificationsToInclude)
+ delete(rawMsg, key)
+ case "maintenanceRunId":
+ err = unpopulate(val, "MaintenanceRunID", &l.MaintenanceRunID)
+ delete(rawMsg, key)
+ case "packageNameMasksToExclude":
+ err = unpopulate(val, "PackageNameMasksToExclude", &l.PackageNameMasksToExclude)
+ delete(rawMsg, key)
+ case "packageNameMasksToInclude":
+ err = unpopulate(val, "PackageNameMasksToInclude", &l.PackageNameMasksToInclude)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LinuxPatchSettings.
+func (l LinuxPatchSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "assessmentMode", l.AssessmentMode)
+ populate(objectMap, "automaticByPlatformSettings", l.AutomaticByPlatformSettings)
+ populate(objectMap, "patchMode", l.PatchMode)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxPatchSettings.
+func (l *LinuxPatchSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "assessmentMode":
+ err = unpopulate(val, "AssessmentMode", &l.AssessmentMode)
+ delete(rawMsg, key)
+ case "automaticByPlatformSettings":
+ err = unpopulate(val, "AutomaticByPlatformSettings", &l.AutomaticByPlatformSettings)
+ delete(rawMsg, key)
+ case "patchMode":
+ err = unpopulate(val, "PatchMode", &l.PatchMode)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LinuxVMGuestPatchAutomaticByPlatformSettings.
+func (l LinuxVMGuestPatchAutomaticByPlatformSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "bypassPlatformSafetyChecksOnUserSchedule", l.BypassPlatformSafetyChecksOnUserSchedule)
+ populate(objectMap, "rebootSetting", l.RebootSetting)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxVMGuestPatchAutomaticByPlatformSettings.
+func (l *LinuxVMGuestPatchAutomaticByPlatformSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "bypassPlatformSafetyChecksOnUserSchedule":
+ err = unpopulate(val, "BypassPlatformSafetyChecksOnUserSchedule", &l.BypassPlatformSafetyChecksOnUserSchedule)
+ delete(rawMsg, key)
+ case "rebootSetting":
+ err = unpopulate(val, "RebootSetting", &l.RebootSetting)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListUsagesResult.
+func (l ListUsagesResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", l.NextLink)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListUsagesResult.
+func (l *ListUsagesResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &l.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfiguration.
+func (l LoadBalancerConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", l.ID)
+ populate(objectMap, "name", l.Name)
+ populate(objectMap, "properties", l.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerConfiguration.
+func (l *LoadBalancerConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &l.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &l.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &l.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LoadBalancerConfigurationProperties.
+func (l LoadBalancerConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "frontendIpConfigurations", l.FrontendIPConfigurations)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerConfigurationProperties.
+func (l *LoadBalancerConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "frontendIpConfigurations":
+ err = unpopulate(val, "FrontendIPConfigurations", &l.FrontendIPConfigurations)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LoadBalancerFrontendIPConfiguration.
+func (l LoadBalancerFrontendIPConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", l.Name)
+ populate(objectMap, "properties", l.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerFrontendIPConfiguration.
+func (l *LoadBalancerFrontendIPConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &l.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &l.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LoadBalancerFrontendIPConfigurationProperties.
+func (l LoadBalancerFrontendIPConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "privateIPAddress", l.PrivateIPAddress)
+ populate(objectMap, "publicIPAddress", l.PublicIPAddress)
+ populate(objectMap, "subnet", l.Subnet)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerFrontendIPConfigurationProperties.
+func (l *LoadBalancerFrontendIPConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "privateIPAddress":
+ err = unpopulate(val, "PrivateIPAddress", &l.PrivateIPAddress)
+ delete(rawMsg, key)
+ case "publicIPAddress":
+ err = unpopulate(val, "PublicIPAddress", &l.PublicIPAddress)
+ delete(rawMsg, key)
+ case "subnet":
+ err = unpopulate(val, "Subnet", &l.Subnet)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsInputBase.
+func (l LogAnalyticsInputBase) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobContainerSasUri", l.BlobContainerSasURI)
+ populateDateTimeRFC3339(objectMap, "fromTime", l.FromTime)
+ populate(objectMap, "groupByClientApplicationId", l.GroupByClientApplicationID)
+ populate(objectMap, "groupByOperationName", l.GroupByOperationName)
+ populate(objectMap, "groupByResourceName", l.GroupByResourceName)
+ populate(objectMap, "groupByThrottlePolicy", l.GroupByThrottlePolicy)
+ populate(objectMap, "groupByUserAgent", l.GroupByUserAgent)
+ populateDateTimeRFC3339(objectMap, "toTime", l.ToTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsInputBase.
+func (l *LogAnalyticsInputBase) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobContainerSasUri":
+ err = unpopulate(val, "BlobContainerSasURI", &l.BlobContainerSasURI)
+ delete(rawMsg, key)
+ case "fromTime":
+ err = unpopulateDateTimeRFC3339(val, "FromTime", &l.FromTime)
+ delete(rawMsg, key)
+ case "groupByClientApplicationId":
+ err = unpopulate(val, "GroupByClientApplicationID", &l.GroupByClientApplicationID)
+ delete(rawMsg, key)
+ case "groupByOperationName":
+ err = unpopulate(val, "GroupByOperationName", &l.GroupByOperationName)
+ delete(rawMsg, key)
+ case "groupByResourceName":
+ err = unpopulate(val, "GroupByResourceName", &l.GroupByResourceName)
+ delete(rawMsg, key)
+ case "groupByThrottlePolicy":
+ err = unpopulate(val, "GroupByThrottlePolicy", &l.GroupByThrottlePolicy)
+ delete(rawMsg, key)
+ case "groupByUserAgent":
+ err = unpopulate(val, "GroupByUserAgent", &l.GroupByUserAgent)
+ delete(rawMsg, key)
+ case "toTime":
+ err = unpopulateDateTimeRFC3339(val, "ToTime", &l.ToTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsOperationResult.
+func (l LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", l.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsOperationResult.
+func (l *LogAnalyticsOperationResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &l.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsOutput.
+func (l LogAnalyticsOutput) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "output", l.Output)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsOutput.
+func (l *LogAnalyticsOutput) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "output":
+ err = unpopulate(val, "Output", &l.Output)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type MaintenanceRedeployStatus.
+func (m MaintenanceRedeployStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "isCustomerInitiatedMaintenanceAllowed", m.IsCustomerInitiatedMaintenanceAllowed)
+ populate(objectMap, "lastOperationMessage", m.LastOperationMessage)
+ populate(objectMap, "lastOperationResultCode", m.LastOperationResultCode)
+ populateDateTimeRFC3339(objectMap, "maintenanceWindowEndTime", m.MaintenanceWindowEndTime)
+ populateDateTimeRFC3339(objectMap, "maintenanceWindowStartTime", m.MaintenanceWindowStartTime)
+ populateDateTimeRFC3339(objectMap, "preMaintenanceWindowEndTime", m.PreMaintenanceWindowEndTime)
+ populateDateTimeRFC3339(objectMap, "preMaintenanceWindowStartTime", m.PreMaintenanceWindowStartTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceRedeployStatus.
+func (m *MaintenanceRedeployStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "isCustomerInitiatedMaintenanceAllowed":
+ err = unpopulate(val, "IsCustomerInitiatedMaintenanceAllowed", &m.IsCustomerInitiatedMaintenanceAllowed)
+ delete(rawMsg, key)
+ case "lastOperationMessage":
+ err = unpopulate(val, "LastOperationMessage", &m.LastOperationMessage)
+ delete(rawMsg, key)
+ case "lastOperationResultCode":
+ err = unpopulate(val, "LastOperationResultCode", &m.LastOperationResultCode)
+ delete(rawMsg, key)
+ case "maintenanceWindowEndTime":
+ err = unpopulateDateTimeRFC3339(val, "MaintenanceWindowEndTime", &m.MaintenanceWindowEndTime)
+ delete(rawMsg, key)
+ case "maintenanceWindowStartTime":
+ err = unpopulateDateTimeRFC3339(val, "MaintenanceWindowStartTime", &m.MaintenanceWindowStartTime)
+ delete(rawMsg, key)
+ case "preMaintenanceWindowEndTime":
+ err = unpopulateDateTimeRFC3339(val, "PreMaintenanceWindowEndTime", &m.PreMaintenanceWindowEndTime)
+ delete(rawMsg, key)
+ case "preMaintenanceWindowStartTime":
+ err = unpopulateDateTimeRFC3339(val, "PreMaintenanceWindowStartTime", &m.PreMaintenanceWindowStartTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagedArtifact.
+func (m ManagedArtifact) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", m.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedArtifact.
+func (m *ManagedArtifact) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &m.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagedDiskParameters.
+func (m ManagedDiskParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskEncryptionSet", m.DiskEncryptionSet)
+ populate(objectMap, "id", m.ID)
+ populate(objectMap, "securityProfile", m.SecurityProfile)
+ populate(objectMap, "storageAccountType", m.StorageAccountType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDiskParameters.
+func (m *ManagedDiskParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskEncryptionSet":
+ err = unpopulate(val, "DiskEncryptionSet", &m.DiskEncryptionSet)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &m.ID)
+ delete(rawMsg, key)
+ case "securityProfile":
+ err = unpopulate(val, "SecurityProfile", &m.SecurityProfile)
+ delete(rawMsg, key)
+ case "storageAccountType":
+ err = unpopulate(val, "StorageAccountType", &m.StorageAccountType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceReference.
+func (n NetworkInterfaceReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", n.ID)
+ populate(objectMap, "properties", n.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceReference.
+func (n *NetworkInterfaceReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &n.ID)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &n.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceReferenceProperties.
+func (n NetworkInterfaceReferenceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "deleteOption", n.DeleteOption)
+ populate(objectMap, "primary", n.Primary)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceReferenceProperties.
+func (n *NetworkInterfaceReferenceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &n.DeleteOption)
+ delete(rawMsg, key)
+ case "primary":
+ err = unpopulate(val, "Primary", &n.Primary)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NetworkProfile.
+func (n NetworkProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "networkApiVersion", n.NetworkAPIVersion)
+ populate(objectMap, "networkInterfaceConfigurations", n.NetworkInterfaceConfigurations)
+ populate(objectMap, "networkInterfaces", n.NetworkInterfaces)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile.
+func (n *NetworkProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "networkApiVersion":
+ err = unpopulate(val, "NetworkAPIVersion", &n.NetworkAPIVersion)
+ delete(rawMsg, key)
+ case "networkInterfaceConfigurations":
+ err = unpopulate(val, "NetworkInterfaceConfigurations", &n.NetworkInterfaceConfigurations)
+ delete(rawMsg, key)
+ case "networkInterfaces":
+ err = unpopulate(val, "NetworkInterfaces", &n.NetworkInterfaces)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSDisk.
+func (o OSDisk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "caching", o.Caching)
+ populate(objectMap, "createOption", o.CreateOption)
+ populate(objectMap, "deleteOption", o.DeleteOption)
+ populate(objectMap, "diffDiskSettings", o.DiffDiskSettings)
+ populate(objectMap, "diskSizeGB", o.DiskSizeGB)
+ populate(objectMap, "encryptionSettings", o.EncryptionSettings)
+ populate(objectMap, "image", o.Image)
+ populate(objectMap, "managedDisk", o.ManagedDisk)
+ populate(objectMap, "name", o.Name)
+ populate(objectMap, "osType", o.OSType)
+ populate(objectMap, "vhd", o.Vhd)
+ populate(objectMap, "writeAcceleratorEnabled", o.WriteAcceleratorEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSDisk.
+func (o *OSDisk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "caching":
+ err = unpopulate(val, "Caching", &o.Caching)
+ delete(rawMsg, key)
+ case "createOption":
+ err = unpopulate(val, "CreateOption", &o.CreateOption)
+ delete(rawMsg, key)
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &o.DeleteOption)
+ delete(rawMsg, key)
+ case "diffDiskSettings":
+ err = unpopulate(val, "DiffDiskSettings", &o.DiffDiskSettings)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &o.DiskSizeGB)
+ delete(rawMsg, key)
+ case "encryptionSettings":
+ err = unpopulate(val, "EncryptionSettings", &o.EncryptionSettings)
+ delete(rawMsg, key)
+ case "image":
+ err = unpopulate(val, "Image", &o.Image)
+ delete(rawMsg, key)
+ case "managedDisk":
+ err = unpopulate(val, "ManagedDisk", &o.ManagedDisk)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &o.OSType)
+ delete(rawMsg, key)
+ case "vhd":
+ err = unpopulate(val, "Vhd", &o.Vhd)
+ delete(rawMsg, key)
+ case "writeAcceleratorEnabled":
+ err = unpopulate(val, "WriteAcceleratorEnabled", &o.WriteAcceleratorEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSDiskImage.
+func (o OSDiskImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "operatingSystem", o.OperatingSystem)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImage.
+func (o *OSDiskImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "operatingSystem":
+ err = unpopulate(val, "OperatingSystem", &o.OperatingSystem)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSDiskImageEncryption.
+func (o OSDiskImageEncryption) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskEncryptionSetId", o.DiskEncryptionSetID)
+ populate(objectMap, "securityProfile", o.SecurityProfile)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImageEncryption.
+func (o *OSDiskImageEncryption) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskEncryptionSetId":
+ err = unpopulate(val, "DiskEncryptionSetID", &o.DiskEncryptionSetID)
+ delete(rawMsg, key)
+ case "securityProfile":
+ err = unpopulate(val, "SecurityProfile", &o.SecurityProfile)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSDiskImageSecurityProfile.
+func (o OSDiskImageSecurityProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "confidentialVMEncryptionType", o.ConfidentialVMEncryptionType)
+ populate(objectMap, "secureVMDiskEncryptionSetId", o.SecureVMDiskEncryptionSetID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSDiskImageSecurityProfile.
+func (o *OSDiskImageSecurityProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "confidentialVMEncryptionType":
+ err = unpopulate(val, "ConfidentialVMEncryptionType", &o.ConfidentialVMEncryptionType)
+ delete(rawMsg, key)
+ case "secureVMDiskEncryptionSetId":
+ err = unpopulate(val, "SecureVMDiskEncryptionSetID", &o.SecureVMDiskEncryptionSetID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSFamily.
+func (o OSFamily) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", o.ID)
+ populate(objectMap, "location", o.Location)
+ populate(objectMap, "name", o.Name)
+ populate(objectMap, "properties", o.Properties)
+ populate(objectMap, "type", o.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSFamily.
+func (o *OSFamily) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &o.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &o.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &o.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &o.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSFamilyListResult.
+func (o OSFamilyListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", o.NextLink)
+ populate(objectMap, "value", o.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSFamilyListResult.
+func (o *OSFamilyListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &o.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &o.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSFamilyProperties.
+func (o OSFamilyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "label", o.Label)
+ populate(objectMap, "name", o.Name)
+ populate(objectMap, "versions", o.Versions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSFamilyProperties.
+func (o *OSFamilyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "label":
+ err = unpopulate(val, "Label", &o.Label)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ case "versions":
+ err = unpopulate(val, "Versions", &o.Versions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSImageNotificationProfile.
+func (o OSImageNotificationProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enable", o.Enable)
+ populate(objectMap, "notBeforeTimeout", o.NotBeforeTimeout)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSImageNotificationProfile.
+func (o *OSImageNotificationProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enable":
+ err = unpopulate(val, "Enable", &o.Enable)
+ delete(rawMsg, key)
+ case "notBeforeTimeout":
+ err = unpopulate(val, "NotBeforeTimeout", &o.NotBeforeTimeout)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSProfile.
+func (o OSProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "adminPassword", o.AdminPassword)
+ populate(objectMap, "adminUsername", o.AdminUsername)
+ populate(objectMap, "allowExtensionOperations", o.AllowExtensionOperations)
+ populate(objectMap, "computerName", o.ComputerName)
+ populate(objectMap, "customData", o.CustomData)
+ populate(objectMap, "linuxConfiguration", o.LinuxConfiguration)
+ populate(objectMap, "requireGuestProvisionSignal", o.RequireGuestProvisionSignal)
+ populate(objectMap, "secrets", o.Secrets)
+ populate(objectMap, "windowsConfiguration", o.WindowsConfiguration)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSProfile.
+func (o *OSProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "adminPassword":
+ err = unpopulate(val, "AdminPassword", &o.AdminPassword)
+ delete(rawMsg, key)
+ case "adminUsername":
+ err = unpopulate(val, "AdminUsername", &o.AdminUsername)
+ delete(rawMsg, key)
+ case "allowExtensionOperations":
+ err = unpopulate(val, "AllowExtensionOperations", &o.AllowExtensionOperations)
+ delete(rawMsg, key)
+ case "computerName":
+ err = unpopulate(val, "ComputerName", &o.ComputerName)
+ delete(rawMsg, key)
+ case "customData":
+ err = unpopulate(val, "CustomData", &o.CustomData)
+ delete(rawMsg, key)
+ case "linuxConfiguration":
+ err = unpopulate(val, "LinuxConfiguration", &o.LinuxConfiguration)
+ delete(rawMsg, key)
+ case "requireGuestProvisionSignal":
+ err = unpopulate(val, "RequireGuestProvisionSignal", &o.RequireGuestProvisionSignal)
+ delete(rawMsg, key)
+ case "secrets":
+ err = unpopulate(val, "Secrets", &o.Secrets)
+ delete(rawMsg, key)
+ case "windowsConfiguration":
+ err = unpopulate(val, "WindowsConfiguration", &o.WindowsConfiguration)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSProfileProvisioningData.
+func (o OSProfileProvisioningData) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "adminPassword", o.AdminPassword)
+ populate(objectMap, "customData", o.CustomData)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSProfileProvisioningData.
+func (o *OSProfileProvisioningData) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "adminPassword":
+ err = unpopulate(val, "AdminPassword", &o.AdminPassword)
+ delete(rawMsg, key)
+ case "customData":
+ err = unpopulate(val, "CustomData", &o.CustomData)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSVersion.
+func (o OSVersion) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", o.ID)
+ populate(objectMap, "location", o.Location)
+ populate(objectMap, "name", o.Name)
+ populate(objectMap, "properties", o.Properties)
+ populate(objectMap, "type", o.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersion.
+func (o *OSVersion) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &o.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &o.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &o.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &o.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSVersionListResult.
+func (o OSVersionListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", o.NextLink)
+ populate(objectMap, "value", o.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionListResult.
+func (o *OSVersionListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &o.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &o.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSVersionProperties.
+func (o OSVersionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "family", o.Family)
+ populate(objectMap, "familyLabel", o.FamilyLabel)
+ populate(objectMap, "isActive", o.IsActive)
+ populate(objectMap, "isDefault", o.IsDefault)
+ populate(objectMap, "label", o.Label)
+ populate(objectMap, "version", o.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionProperties.
+func (o *OSVersionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "family":
+ err = unpopulate(val, "Family", &o.Family)
+ delete(rawMsg, key)
+ case "familyLabel":
+ err = unpopulate(val, "FamilyLabel", &o.FamilyLabel)
+ delete(rawMsg, key)
+ case "isActive":
+ err = unpopulate(val, "IsActive", &o.IsActive)
+ delete(rawMsg, key)
+ case "isDefault":
+ err = unpopulate(val, "IsDefault", &o.IsDefault)
+ delete(rawMsg, key)
+ case "label":
+ err = unpopulate(val, "Label", &o.Label)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &o.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OSVersionPropertiesBase.
+func (o OSVersionPropertiesBase) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "isActive", o.IsActive)
+ populate(objectMap, "isDefault", o.IsDefault)
+ populate(objectMap, "label", o.Label)
+ populate(objectMap, "version", o.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OSVersionPropertiesBase.
+func (o *OSVersionPropertiesBase) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "isActive":
+ err = unpopulate(val, "IsActive", &o.IsActive)
+ delete(rawMsg, key)
+ case "isDefault":
+ err = unpopulate(val, "IsDefault", &o.IsDefault)
+ delete(rawMsg, key)
+ case "label":
+ err = unpopulate(val, "Label", &o.Label)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &o.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationListResult.
+func (o OperationListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", o.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
+func (o *OperationListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &o.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationValue.
+func (o OperationValue) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "display", o.Display)
+ populate(objectMap, "name", o.Name)
+ populate(objectMap, "origin", o.Origin)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationValue.
+func (o *OperationValue) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "display":
+ err = unpopulate(val, "Display", &o.Display)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ case "origin":
+ err = unpopulate(val, "Origin", &o.Origin)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationValueDisplay.
+func (o OperationValueDisplay) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", o.Description)
+ populate(objectMap, "operation", o.Operation)
+ populate(objectMap, "provider", o.Provider)
+ populate(objectMap, "resource", o.Resource)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationValueDisplay.
+func (o *OperationValueDisplay) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &o.Description)
+ delete(rawMsg, key)
+ case "operation":
+ err = unpopulate(val, "Operation", &o.Operation)
+ delete(rawMsg, key)
+ case "provider":
+ err = unpopulate(val, "Provider", &o.Provider)
+ delete(rawMsg, key)
+ case "resource":
+ err = unpopulate(val, "Resource", &o.Resource)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OrchestrationServiceStateInput.
+func (o OrchestrationServiceStateInput) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "action", o.Action)
+ populate(objectMap, "serviceName", o.ServiceName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OrchestrationServiceStateInput.
+func (o *OrchestrationServiceStateInput) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "action":
+ err = unpopulate(val, "Action", &o.Action)
+ delete(rawMsg, key)
+ case "serviceName":
+ err = unpopulate(val, "ServiceName", &o.ServiceName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OrchestrationServiceSummary.
+func (o OrchestrationServiceSummary) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "serviceName", o.ServiceName)
+ populate(objectMap, "serviceState", o.ServiceState)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OrchestrationServiceSummary.
+func (o *OrchestrationServiceSummary) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "serviceName":
+ err = unpopulate(val, "ServiceName", &o.ServiceName)
+ delete(rawMsg, key)
+ case "serviceState":
+ err = unpopulate(val, "ServiceState", &o.ServiceState)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PatchInstallationDetail.
+func (p PatchInstallationDetail) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "classifications", p.Classifications)
+ populate(objectMap, "installationState", p.InstallationState)
+ populate(objectMap, "kbId", p.KbID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "patchId", p.PatchID)
+ populate(objectMap, "version", p.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PatchInstallationDetail.
+func (p *PatchInstallationDetail) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "classifications":
+ err = unpopulate(val, "Classifications", &p.Classifications)
+ delete(rawMsg, key)
+ case "installationState":
+ err = unpopulate(val, "InstallationState", &p.InstallationState)
+ delete(rawMsg, key)
+ case "kbId":
+ err = unpopulate(val, "KbID", &p.KbID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "patchId":
+ err = unpopulate(val, "PatchID", &p.PatchID)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &p.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PatchSettings.
+func (p PatchSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "assessmentMode", p.AssessmentMode)
+ populate(objectMap, "automaticByPlatformSettings", p.AutomaticByPlatformSettings)
+ populate(objectMap, "enableHotpatching", p.EnableHotpatching)
+ populate(objectMap, "patchMode", p.PatchMode)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PatchSettings.
+func (p *PatchSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "assessmentMode":
+ err = unpopulate(val, "AssessmentMode", &p.AssessmentMode)
+ delete(rawMsg, key)
+ case "automaticByPlatformSettings":
+ err = unpopulate(val, "AutomaticByPlatformSettings", &p.AutomaticByPlatformSettings)
+ delete(rawMsg, key)
+ case "enableHotpatching":
+ err = unpopulate(val, "EnableHotpatching", &p.EnableHotpatching)
+ delete(rawMsg, key)
+ case "patchMode":
+ err = unpopulate(val, "PatchMode", &p.PatchMode)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PirCommunityGalleryResource.
+func (p PirCommunityGalleryResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identifier", p.Identifier)
+ populate(objectMap, "location", p.Location)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PirCommunityGalleryResource.
+func (p *PirCommunityGalleryResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identifier":
+ err = unpopulate(val, "Identifier", &p.Identifier)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &p.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PirResource.
+func (p PirResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "location", p.Location)
+ populate(objectMap, "name", p.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PirResource.
+func (p *PirResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "location":
+ err = unpopulate(val, "Location", &p.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PirSharedGalleryResource.
+func (p PirSharedGalleryResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identifier", p.Identifier)
+ populate(objectMap, "location", p.Location)
+ populate(objectMap, "name", p.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PirSharedGalleryResource.
+func (p *PirSharedGalleryResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identifier":
+ err = unpopulate(val, "Identifier", &p.Identifier)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &p.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Plan.
+func (p Plan) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "product", p.Product)
+ populate(objectMap, "promotionCode", p.PromotionCode)
+ populate(objectMap, "publisher", p.Publisher)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Plan.
+func (p *Plan) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "product":
+ err = unpopulate(val, "Product", &p.Product)
+ delete(rawMsg, key)
+ case "promotionCode":
+ err = unpopulate(val, "PromotionCode", &p.PromotionCode)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &p.Publisher)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PolicyViolation.
+func (p PolicyViolation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "category", p.Category)
+ populate(objectMap, "details", p.Details)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyViolation.
+func (p *PolicyViolation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "category":
+ err = unpopulate(val, "Category", &p.Category)
+ delete(rawMsg, key)
+ case "details":
+ err = unpopulate(val, "Details", &p.Details)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PriorityMixPolicy.
+func (p PriorityMixPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "baseRegularPriorityCount", p.BaseRegularPriorityCount)
+ populate(objectMap, "regularPriorityPercentageAboveBase", p.RegularPriorityPercentageAboveBase)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PriorityMixPolicy.
+func (p *PriorityMixPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "baseRegularPriorityCount":
+ err = unpopulate(val, "BaseRegularPriorityCount", &p.BaseRegularPriorityCount)
+ delete(rawMsg, key)
+ case "regularPriorityPercentageAboveBase":
+ err = unpopulate(val, "RegularPriorityPercentageAboveBase", &p.RegularPriorityPercentageAboveBase)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint.
+func (p PrivateEndpoint) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint.
+func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.
+func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "properties", p.Properties)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.
+func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &p.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.
+func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", p.NextLink)
+ populate(objectMap, "value", p.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.
+func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &p.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &p.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.
+func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "privateEndpoint", p.PrivateEndpoint)
+ populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState)
+ populate(objectMap, "provisioningState", p.ProvisioningState)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.
+func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "privateEndpoint":
+ err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint)
+ delete(rawMsg, key)
+ case "privateLinkServiceConnectionState":
+ err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &p.ProvisioningState)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.
+func (p PrivateLinkResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "properties", p.Properties)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.
+func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &p.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.
+func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", p.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.
+func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &p.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.
+func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "groupId", p.GroupID)
+ populate(objectMap, "requiredMembers", p.RequiredMembers)
+ populate(objectMap, "requiredZoneNames", p.RequiredZoneNames)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.
+func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "groupId":
+ err = unpopulate(val, "GroupID", &p.GroupID)
+ delete(rawMsg, key)
+ case "requiredMembers":
+ err = unpopulate(val, "RequiredMembers", &p.RequiredMembers)
+ delete(rawMsg, key)
+ case "requiredZoneNames":
+ err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.
+func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "actionsRequired", p.ActionsRequired)
+ populate(objectMap, "description", p.Description)
+ populate(objectMap, "status", p.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.
+func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "actionsRequired":
+ err = unpopulate(val, "ActionsRequired", &p.ActionsRequired)
+ delete(rawMsg, key)
+ case "description":
+ err = unpopulate(val, "Description", &p.Description)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &p.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PropertyUpdatesInProgress.
+func (p PropertyUpdatesInProgress) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "targetTier", p.TargetTier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PropertyUpdatesInProgress.
+func (p *PropertyUpdatesInProgress) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "targetTier":
+ err = unpopulate(val, "TargetTier", &p.TargetTier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroup.
+func (p ProximityPlacementGroup) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "location", p.Location)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "properties", p.Properties)
+ populate(objectMap, "tags", p.Tags)
+ populate(objectMap, "type", p.Type)
+ populate(objectMap, "zones", p.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroup.
+func (p *ProximityPlacementGroup) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &p.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &p.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &p.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &p.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupListResult.
+func (p ProximityPlacementGroupListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", p.NextLink)
+ populate(objectMap, "value", p.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupListResult.
+func (p *ProximityPlacementGroupListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &p.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &p.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupProperties.
+func (p ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "availabilitySets", p.AvailabilitySets)
+ populate(objectMap, "colocationStatus", p.ColocationStatus)
+ populate(objectMap, "intent", p.Intent)
+ populate(objectMap, "proximityPlacementGroupType", p.ProximityPlacementGroupType)
+ populate(objectMap, "virtualMachineScaleSets", p.VirtualMachineScaleSets)
+ populate(objectMap, "virtualMachines", p.VirtualMachines)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupProperties.
+func (p *ProximityPlacementGroupProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "availabilitySets":
+ err = unpopulate(val, "AvailabilitySets", &p.AvailabilitySets)
+ delete(rawMsg, key)
+ case "colocationStatus":
+ err = unpopulate(val, "ColocationStatus", &p.ColocationStatus)
+ delete(rawMsg, key)
+ case "intent":
+ err = unpopulate(val, "Intent", &p.Intent)
+ delete(rawMsg, key)
+ case "proximityPlacementGroupType":
+ err = unpopulate(val, "ProximityPlacementGroupType", &p.ProximityPlacementGroupType)
+ delete(rawMsg, key)
+ case "virtualMachineScaleSets":
+ err = unpopulate(val, "VirtualMachineScaleSets", &p.VirtualMachineScaleSets)
+ delete(rawMsg, key)
+ case "virtualMachines":
+ err = unpopulate(val, "VirtualMachines", &p.VirtualMachines)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupPropertiesIntent.
+func (p ProximityPlacementGroupPropertiesIntent) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "vmSizes", p.VMSizes)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupPropertiesIntent.
+func (p *ProximityPlacementGroupPropertiesIntent) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "vmSizes":
+ err = unpopulate(val, "VMSizes", &p.VMSizes)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProximityPlacementGroupUpdate.
+func (p ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "tags", p.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProximityPlacementGroupUpdate.
+func (p *ProximityPlacementGroupUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "tags":
+ err = unpopulate(val, "Tags", &p.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProxyOnlyResource.
+func (p ProxyOnlyResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyOnlyResource.
+func (p *ProxyOnlyResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProxyResource.
+func (p ProxyResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.
+func (p *ProxyResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PublicIPAddressSKU.
+func (p PublicIPAddressSKU) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "tier", p.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PublicIPAddressSKU.
+func (p *PublicIPAddressSKU) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &p.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PurchasePlan.
+func (p PurchasePlan) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "product", p.Product)
+ populate(objectMap, "publisher", p.Publisher)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PurchasePlan.
+func (p *PurchasePlan) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "product":
+ err = unpopulate(val, "Product", &p.Product)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &p.Publisher)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RecommendedMachineConfiguration.
+func (r RecommendedMachineConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "memory", r.Memory)
+ populate(objectMap, "vCPUs", r.VCPUs)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedMachineConfiguration.
+func (r *RecommendedMachineConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "memory":
+ err = unpopulate(val, "Memory", &r.Memory)
+ delete(rawMsg, key)
+ case "vCPUs":
+ err = unpopulate(val, "VCPUs", &r.VCPUs)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RecoveryWalkResponse.
+func (r RecoveryWalkResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextPlatformUpdateDomain", r.NextPlatformUpdateDomain)
+ populate(objectMap, "walkPerformed", r.WalkPerformed)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryWalkResponse.
+func (r *RecoveryWalkResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextPlatformUpdateDomain":
+ err = unpopulate(val, "NextPlatformUpdateDomain", &r.NextPlatformUpdateDomain)
+ delete(rawMsg, key)
+ case "walkPerformed":
+ err = unpopulate(val, "WalkPerformed", &r.WalkPerformed)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RegionalReplicationStatus.
+func (r RegionalReplicationStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "details", r.Details)
+ populate(objectMap, "progress", r.Progress)
+ populate(objectMap, "region", r.Region)
+ populate(objectMap, "state", r.State)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RegionalReplicationStatus.
+func (r *RegionalReplicationStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "details":
+ err = unpopulate(val, "Details", &r.Details)
+ delete(rawMsg, key)
+ case "progress":
+ err = unpopulate(val, "Progress", &r.Progress)
+ delete(rawMsg, key)
+ case "region":
+ err = unpopulate(val, "Region", &r.Region)
+ delete(rawMsg, key)
+ case "state":
+ err = unpopulate(val, "State", &r.State)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RegionalSharingStatus.
+func (r RegionalSharingStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "details", r.Details)
+ populate(objectMap, "region", r.Region)
+ populate(objectMap, "state", r.State)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RegionalSharingStatus.
+func (r *RegionalSharingStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "details":
+ err = unpopulate(val, "Details", &r.Details)
+ delete(rawMsg, key)
+ case "region":
+ err = unpopulate(val, "Region", &r.Region)
+ delete(rawMsg, key)
+ case "state":
+ err = unpopulate(val, "State", &r.State)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ReplicationStatus.
+func (r ReplicationStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "aggregatedState", r.AggregatedState)
+ populate(objectMap, "summary", r.Summary)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationStatus.
+func (r *ReplicationStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "aggregatedState":
+ err = unpopulate(val, "AggregatedState", &r.AggregatedState)
+ delete(rawMsg, key)
+ case "summary":
+ err = unpopulate(val, "Summary", &r.Summary)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RequestRateByIntervalInput.
+func (r RequestRateByIntervalInput) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobContainerSasUri", r.BlobContainerSasURI)
+ populateDateTimeRFC3339(objectMap, "fromTime", r.FromTime)
+ populate(objectMap, "groupByClientApplicationId", r.GroupByClientApplicationID)
+ populate(objectMap, "groupByOperationName", r.GroupByOperationName)
+ populate(objectMap, "groupByResourceName", r.GroupByResourceName)
+ populate(objectMap, "groupByThrottlePolicy", r.GroupByThrottlePolicy)
+ populate(objectMap, "groupByUserAgent", r.GroupByUserAgent)
+ populate(objectMap, "intervalLength", r.IntervalLength)
+ populateDateTimeRFC3339(objectMap, "toTime", r.ToTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RequestRateByIntervalInput.
+func (r *RequestRateByIntervalInput) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobContainerSasUri":
+ err = unpopulate(val, "BlobContainerSasURI", &r.BlobContainerSasURI)
+ delete(rawMsg, key)
+ case "fromTime":
+ err = unpopulateDateTimeRFC3339(val, "FromTime", &r.FromTime)
+ delete(rawMsg, key)
+ case "groupByClientApplicationId":
+ err = unpopulate(val, "GroupByClientApplicationID", &r.GroupByClientApplicationID)
+ delete(rawMsg, key)
+ case "groupByOperationName":
+ err = unpopulate(val, "GroupByOperationName", &r.GroupByOperationName)
+ delete(rawMsg, key)
+ case "groupByResourceName":
+ err = unpopulate(val, "GroupByResourceName", &r.GroupByResourceName)
+ delete(rawMsg, key)
+ case "groupByThrottlePolicy":
+ err = unpopulate(val, "GroupByThrottlePolicy", &r.GroupByThrottlePolicy)
+ delete(rawMsg, key)
+ case "groupByUserAgent":
+ err = unpopulate(val, "GroupByUserAgent", &r.GroupByUserAgent)
+ delete(rawMsg, key)
+ case "intervalLength":
+ err = unpopulate(val, "IntervalLength", &r.IntervalLength)
+ delete(rawMsg, key)
+ case "toTime":
+ err = unpopulateDateTimeRFC3339(val, "ToTime", &r.ToTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Resource.
+func (r Resource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "location", r.Location)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "tags", r.Tags)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
+func (r *Resource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &r.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &r.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceInstanceViewStatus.
+func (r ResourceInstanceViewStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "code", r.Code)
+ populate(objectMap, "displayStatus", r.DisplayStatus)
+ populate(objectMap, "level", r.Level)
+ populate(objectMap, "message", r.Message)
+ populateDateTimeRFC3339(objectMap, "time", r.Time)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceInstanceViewStatus.
+func (r *ResourceInstanceViewStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "code":
+ err = unpopulate(val, "Code", &r.Code)
+ delete(rawMsg, key)
+ case "displayStatus":
+ err = unpopulate(val, "DisplayStatus", &r.DisplayStatus)
+ delete(rawMsg, key)
+ case "level":
+ err = unpopulate(val, "Level", &r.Level)
+ delete(rawMsg, key)
+ case "message":
+ err = unpopulate(val, "Message", &r.Message)
+ delete(rawMsg, key)
+ case "time":
+ err = unpopulateDateTimeRFC3339(val, "Time", &r.Time)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceRange.
+func (r ResourceRange) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "max", r.Max)
+ populate(objectMap, "min", r.Min)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRange.
+func (r *ResourceRange) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "max":
+ err = unpopulate(val, "Max", &r.Max)
+ delete(rawMsg, key)
+ case "min":
+ err = unpopulate(val, "Min", &r.Min)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceSKU.
+func (r ResourceSKU) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "apiVersions", r.APIVersions)
+ populate(objectMap, "capabilities", r.Capabilities)
+ populate(objectMap, "capacity", r.Capacity)
+ populate(objectMap, "costs", r.Costs)
+ populate(objectMap, "family", r.Family)
+ populate(objectMap, "kind", r.Kind)
+ populate(objectMap, "locationInfo", r.LocationInfo)
+ populate(objectMap, "locations", r.Locations)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "resourceType", r.ResourceType)
+ populate(objectMap, "restrictions", r.Restrictions)
+ populate(objectMap, "size", r.Size)
+ populate(objectMap, "tier", r.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU.
+func (r *ResourceSKU) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "apiVersions":
+ err = unpopulate(val, "APIVersions", &r.APIVersions)
+ delete(rawMsg, key)
+ case "capabilities":
+ err = unpopulate(val, "Capabilities", &r.Capabilities)
+ delete(rawMsg, key)
+ case "capacity":
+ err = unpopulate(val, "Capacity", &r.Capacity)
+ delete(rawMsg, key)
+ case "costs":
+ err = unpopulate(val, "Costs", &r.Costs)
+ delete(rawMsg, key)
+ case "family":
+ err = unpopulate(val, "Family", &r.Family)
+ delete(rawMsg, key)
+ case "kind":
+ err = unpopulate(val, "Kind", &r.Kind)
+ delete(rawMsg, key)
+ case "locationInfo":
+ err = unpopulate(val, "LocationInfo", &r.LocationInfo)
+ delete(rawMsg, key)
+ case "locations":
+ err = unpopulate(val, "Locations", &r.Locations)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "resourceType":
+ err = unpopulate(val, "ResourceType", &r.ResourceType)
+ delete(rawMsg, key)
+ case "restrictions":
+ err = unpopulate(val, "Restrictions", &r.Restrictions)
+ delete(rawMsg, key)
+ case "size":
+ err = unpopulate(val, "Size", &r.Size)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &r.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapabilities.
+func (r ResourceSKUCapabilities) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "value", r.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapabilities.
+func (r *ResourceSKUCapabilities) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &r.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapacity.
+func (r ResourceSKUCapacity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "default", r.Default)
+ populate(objectMap, "maximum", r.Maximum)
+ populate(objectMap, "minimum", r.Minimum)
+ populate(objectMap, "scaleType", r.ScaleType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapacity.
+func (r *ResourceSKUCapacity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "default":
+ err = unpopulate(val, "Default", &r.Default)
+ delete(rawMsg, key)
+ case "maximum":
+ err = unpopulate(val, "Maximum", &r.Maximum)
+ delete(rawMsg, key)
+ case "minimum":
+ err = unpopulate(val, "Minimum", &r.Minimum)
+ delete(rawMsg, key)
+ case "scaleType":
+ err = unpopulate(val, "ScaleType", &r.ScaleType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCosts.
+func (r ResourceSKUCosts) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedUnit", r.ExtendedUnit)
+ populate(objectMap, "meterID", r.MeterID)
+ populate(objectMap, "quantity", r.Quantity)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCosts.
+func (r *ResourceSKUCosts) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedUnit":
+ err = unpopulate(val, "ExtendedUnit", &r.ExtendedUnit)
+ delete(rawMsg, key)
+ case "meterID":
+ err = unpopulate(val, "MeterID", &r.MeterID)
+ delete(rawMsg, key)
+ case "quantity":
+ err = unpopulate(val, "Quantity", &r.Quantity)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceSKULocationInfo.
+func (r ResourceSKULocationInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocations", r.ExtendedLocations)
+ populate(objectMap, "location", r.Location)
+ populate(objectMap, "type", r.Type)
+ populate(objectMap, "zoneDetails", r.ZoneDetails)
+ populate(objectMap, "zones", r.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKULocationInfo.
+func (r *ResourceSKULocationInfo) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocations":
+ err = unpopulate(val, "ExtendedLocations", &r.ExtendedLocations)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &r.Location)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ case "zoneDetails":
+ err = unpopulate(val, "ZoneDetails", &r.ZoneDetails)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &r.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceSKURestrictionInfo.
+func (r ResourceSKURestrictionInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "locations", r.Locations)
+ populate(objectMap, "zones", r.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictionInfo.
+func (r *ResourceSKURestrictionInfo) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "locations":
+ err = unpopulate(val, "Locations", &r.Locations)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &r.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceSKURestrictions.
+func (r ResourceSKURestrictions) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "reasonCode", r.ReasonCode)
+ populate(objectMap, "restrictionInfo", r.RestrictionInfo)
+ populate(objectMap, "type", r.Type)
+ populate(objectMap, "values", r.Values)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictions.
+func (r *ResourceSKURestrictions) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "reasonCode":
+ err = unpopulate(val, "ReasonCode", &r.ReasonCode)
+ delete(rawMsg, key)
+ case "restrictionInfo":
+ err = unpopulate(val, "RestrictionInfo", &r.RestrictionInfo)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ case "values":
+ err = unpopulate(val, "Values", &r.Values)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceSKUZoneDetails.
+func (r ResourceSKUZoneDetails) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capabilities", r.Capabilities)
+ populate(objectMap, "name", r.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUZoneDetails.
+func (r *ResourceSKUZoneDetails) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capabilities":
+ err = unpopulate(val, "Capabilities", &r.Capabilities)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceSKUsResult.
+func (r ResourceSKUsResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", r.NextLink)
+ populate(objectMap, "value", r.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUsResult.
+func (r *ResourceSKUsResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &r.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &r.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceURIList.
+func (r ResourceURIList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", r.NextLink)
+ populate(objectMap, "value", r.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceURIList.
+func (r *ResourceURIList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &r.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &r.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceWithOptionalLocation.
+func (r ResourceWithOptionalLocation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "location", r.Location)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "tags", r.Tags)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceWithOptionalLocation.
+func (r *ResourceWithOptionalLocation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &r.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &r.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePoint.
+func (r RestorePoint) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "properties", r.Properties)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePoint.
+func (r *RestorePoint) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &r.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointCollection.
+func (r RestorePointCollection) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "location", r.Location)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "properties", r.Properties)
+ populate(objectMap, "tags", r.Tags)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollection.
+func (r *RestorePointCollection) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &r.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &r.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &r.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionListResult.
+func (r RestorePointCollectionListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", r.NextLink)
+ populate(objectMap, "value", r.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionListResult.
+func (r *RestorePointCollectionListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &r.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &r.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionProperties.
+func (r RestorePointCollectionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "provisioningState", r.ProvisioningState)
+ populate(objectMap, "restorePointCollectionId", r.RestorePointCollectionID)
+ populate(objectMap, "restorePoints", r.RestorePoints)
+ populate(objectMap, "source", r.Source)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionProperties.
+func (r *RestorePointCollectionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &r.ProvisioningState)
+ delete(rawMsg, key)
+ case "restorePointCollectionId":
+ err = unpopulate(val, "RestorePointCollectionID", &r.RestorePointCollectionID)
+ delete(rawMsg, key)
+ case "restorePoints":
+ err = unpopulate(val, "RestorePoints", &r.RestorePoints)
+ delete(rawMsg, key)
+ case "source":
+ err = unpopulate(val, "Source", &r.Source)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionSourceProperties.
+func (r RestorePointCollectionSourceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "location", r.Location)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionSourceProperties.
+func (r *RestorePointCollectionSourceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &r.Location)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointCollectionUpdate.
+func (r RestorePointCollectionUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", r.Properties)
+ populate(objectMap, "tags", r.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointCollectionUpdate.
+func (r *RestorePointCollectionUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &r.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &r.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointEncryption.
+func (r RestorePointEncryption) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskEncryptionSet", r.DiskEncryptionSet)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointEncryption.
+func (r *RestorePointEncryption) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskEncryptionSet":
+ err = unpopulate(val, "DiskEncryptionSet", &r.DiskEncryptionSet)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointInstanceView.
+func (r RestorePointInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskRestorePoints", r.DiskRestorePoints)
+ populate(objectMap, "statuses", r.Statuses)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointInstanceView.
+func (r *RestorePointInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskRestorePoints":
+ err = unpopulate(val, "DiskRestorePoints", &r.DiskRestorePoints)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &r.Statuses)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointProperties.
+func (r RestorePointProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "consistencyMode", r.ConsistencyMode)
+ populate(objectMap, "excludeDisks", r.ExcludeDisks)
+ populate(objectMap, "instanceView", r.InstanceView)
+ populate(objectMap, "provisioningState", r.ProvisioningState)
+ populate(objectMap, "sourceMetadata", r.SourceMetadata)
+ populate(objectMap, "sourceRestorePoint", r.SourceRestorePoint)
+ populateDateTimeRFC3339(objectMap, "timeCreated", r.TimeCreated)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointProperties.
+func (r *RestorePointProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "consistencyMode":
+ err = unpopulate(val, "ConsistencyMode", &r.ConsistencyMode)
+ delete(rawMsg, key)
+ case "excludeDisks":
+ err = unpopulate(val, "ExcludeDisks", &r.ExcludeDisks)
+ delete(rawMsg, key)
+ case "instanceView":
+ err = unpopulate(val, "InstanceView", &r.InstanceView)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &r.ProvisioningState)
+ delete(rawMsg, key)
+ case "sourceMetadata":
+ err = unpopulate(val, "SourceMetadata", &r.SourceMetadata)
+ delete(rawMsg, key)
+ case "sourceRestorePoint":
+ err = unpopulate(val, "SourceRestorePoint", &r.SourceRestorePoint)
+ delete(rawMsg, key)
+ case "timeCreated":
+ err = unpopulateDateTimeRFC3339(val, "TimeCreated", &r.TimeCreated)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceMetadata.
+func (r RestorePointSourceMetadata) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diagnosticsProfile", r.DiagnosticsProfile)
+ populate(objectMap, "hardwareProfile", r.HardwareProfile)
+ populate(objectMap, "hyperVGeneration", r.HyperVGeneration)
+ populate(objectMap, "licenseType", r.LicenseType)
+ populate(objectMap, "location", r.Location)
+ populate(objectMap, "osProfile", r.OSProfile)
+ populate(objectMap, "securityProfile", r.SecurityProfile)
+ populate(objectMap, "storageProfile", r.StorageProfile)
+ populate(objectMap, "userData", r.UserData)
+ populate(objectMap, "vmId", r.VMID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceMetadata.
+func (r *RestorePointSourceMetadata) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diagnosticsProfile":
+ err = unpopulate(val, "DiagnosticsProfile", &r.DiagnosticsProfile)
+ delete(rawMsg, key)
+ case "hardwareProfile":
+ err = unpopulate(val, "HardwareProfile", &r.HardwareProfile)
+ delete(rawMsg, key)
+ case "hyperVGeneration":
+ err = unpopulate(val, "HyperVGeneration", &r.HyperVGeneration)
+ delete(rawMsg, key)
+ case "licenseType":
+ err = unpopulate(val, "LicenseType", &r.LicenseType)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &r.Location)
+ delete(rawMsg, key)
+ case "osProfile":
+ err = unpopulate(val, "OSProfile", &r.OSProfile)
+ delete(rawMsg, key)
+ case "securityProfile":
+ err = unpopulate(val, "SecurityProfile", &r.SecurityProfile)
+ delete(rawMsg, key)
+ case "storageProfile":
+ err = unpopulate(val, "StorageProfile", &r.StorageProfile)
+ delete(rawMsg, key)
+ case "userData":
+ err = unpopulate(val, "UserData", &r.UserData)
+ delete(rawMsg, key)
+ case "vmId":
+ err = unpopulate(val, "VMID", &r.VMID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMDataDisk.
+func (r RestorePointSourceVMDataDisk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "caching", r.Caching)
+ populate(objectMap, "diskRestorePoint", r.DiskRestorePoint)
+ populate(objectMap, "diskSizeGB", r.DiskSizeGB)
+ populate(objectMap, "lun", r.Lun)
+ populate(objectMap, "managedDisk", r.ManagedDisk)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "writeAcceleratorEnabled", r.WriteAcceleratorEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMDataDisk.
+func (r *RestorePointSourceVMDataDisk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "caching":
+ err = unpopulate(val, "Caching", &r.Caching)
+ delete(rawMsg, key)
+ case "diskRestorePoint":
+ err = unpopulate(val, "DiskRestorePoint", &r.DiskRestorePoint)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &r.DiskSizeGB)
+ delete(rawMsg, key)
+ case "lun":
+ err = unpopulate(val, "Lun", &r.Lun)
+ delete(rawMsg, key)
+ case "managedDisk":
+ err = unpopulate(val, "ManagedDisk", &r.ManagedDisk)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "writeAcceleratorEnabled":
+ err = unpopulate(val, "WriteAcceleratorEnabled", &r.WriteAcceleratorEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMOSDisk.
+func (r RestorePointSourceVMOSDisk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "caching", r.Caching)
+ populate(objectMap, "diskRestorePoint", r.DiskRestorePoint)
+ populate(objectMap, "diskSizeGB", r.DiskSizeGB)
+ populate(objectMap, "encryptionSettings", r.EncryptionSettings)
+ populate(objectMap, "managedDisk", r.ManagedDisk)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "osType", r.OSType)
+ populate(objectMap, "writeAcceleratorEnabled", r.WriteAcceleratorEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMOSDisk.
+func (r *RestorePointSourceVMOSDisk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "caching":
+ err = unpopulate(val, "Caching", &r.Caching)
+ delete(rawMsg, key)
+ case "diskRestorePoint":
+ err = unpopulate(val, "DiskRestorePoint", &r.DiskRestorePoint)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &r.DiskSizeGB)
+ delete(rawMsg, key)
+ case "encryptionSettings":
+ err = unpopulate(val, "EncryptionSettings", &r.EncryptionSettings)
+ delete(rawMsg, key)
+ case "managedDisk":
+ err = unpopulate(val, "ManagedDisk", &r.ManagedDisk)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &r.OSType)
+ delete(rawMsg, key)
+ case "writeAcceleratorEnabled":
+ err = unpopulate(val, "WriteAcceleratorEnabled", &r.WriteAcceleratorEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePointSourceVMStorageProfile.
+func (r RestorePointSourceVMStorageProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dataDisks", r.DataDisks)
+ populate(objectMap, "osDisk", r.OSDisk)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointSourceVMStorageProfile.
+func (r *RestorePointSourceVMStorageProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dataDisks":
+ err = unpopulate(val, "DataDisks", &r.DataDisks)
+ delete(rawMsg, key)
+ case "osDisk":
+ err = unpopulate(val, "OSDisk", &r.OSDisk)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RetrieveBootDiagnosticsDataResult.
+func (r RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "consoleScreenshotBlobUri", r.ConsoleScreenshotBlobURI)
+ populate(objectMap, "serialConsoleLogBlobUri", r.SerialConsoleLogBlobURI)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RetrieveBootDiagnosticsDataResult.
+func (r *RetrieveBootDiagnosticsDataResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "consoleScreenshotBlobUri":
+ err = unpopulate(val, "ConsoleScreenshotBlobURI", &r.ConsoleScreenshotBlobURI)
+ delete(rawMsg, key)
+ case "serialConsoleLogBlobUri":
+ err = unpopulate(val, "SerialConsoleLogBlobURI", &r.SerialConsoleLogBlobURI)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RoleInstance.
+func (r RoleInstance) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "location", r.Location)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "properties", r.Properties)
+ populate(objectMap, "sku", r.SKU)
+ populate(objectMap, "tags", r.Tags)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstance.
+func (r *RoleInstance) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &r.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &r.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &r.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &r.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RoleInstanceListResult.
+func (r RoleInstanceListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", r.NextLink)
+ populate(objectMap, "value", r.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceListResult.
+func (r *RoleInstanceListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &r.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &r.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RoleInstanceNetworkProfile.
+func (r RoleInstanceNetworkProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "networkInterfaces", r.NetworkInterfaces)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceNetworkProfile.
+func (r *RoleInstanceNetworkProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "networkInterfaces":
+ err = unpopulate(val, "NetworkInterfaces", &r.NetworkInterfaces)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RoleInstanceProperties.
+func (r RoleInstanceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "instanceView", r.InstanceView)
+ populate(objectMap, "networkProfile", r.NetworkProfile)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceProperties.
+func (r *RoleInstanceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "instanceView":
+ err = unpopulate(val, "InstanceView", &r.InstanceView)
+ delete(rawMsg, key)
+ case "networkProfile":
+ err = unpopulate(val, "NetworkProfile", &r.NetworkProfile)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RoleInstanceView.
+func (r RoleInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "platformFaultDomain", r.PlatformFaultDomain)
+ populate(objectMap, "platformUpdateDomain", r.PlatformUpdateDomain)
+ populate(objectMap, "privateId", r.PrivateID)
+ populate(objectMap, "statuses", r.Statuses)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstanceView.
+func (r *RoleInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "platformFaultDomain":
+ err = unpopulate(val, "PlatformFaultDomain", &r.PlatformFaultDomain)
+ delete(rawMsg, key)
+ case "platformUpdateDomain":
+ err = unpopulate(val, "PlatformUpdateDomain", &r.PlatformUpdateDomain)
+ delete(rawMsg, key)
+ case "privateId":
+ err = unpopulate(val, "PrivateID", &r.PrivateID)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &r.Statuses)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RoleInstances.
+func (r RoleInstances) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "roleInstances", r.RoleInstances)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RoleInstances.
+func (r *RoleInstances) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "roleInstances":
+ err = unpopulate(val, "RoleInstances", &r.RoleInstances)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RollbackStatusInfo.
+func (r RollbackStatusInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "failedRolledbackInstanceCount", r.FailedRolledbackInstanceCount)
+ populate(objectMap, "rollbackError", r.RollbackError)
+ populate(objectMap, "successfullyRolledbackInstanceCount", r.SuccessfullyRolledbackInstanceCount)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RollbackStatusInfo.
+func (r *RollbackStatusInfo) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "failedRolledbackInstanceCount":
+ err = unpopulate(val, "FailedRolledbackInstanceCount", &r.FailedRolledbackInstanceCount)
+ delete(rawMsg, key)
+ case "rollbackError":
+ err = unpopulate(val, "RollbackError", &r.RollbackError)
+ delete(rawMsg, key)
+ case "successfullyRolledbackInstanceCount":
+ err = unpopulate(val, "SuccessfullyRolledbackInstanceCount", &r.SuccessfullyRolledbackInstanceCount)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RollingUpgradePolicy.
+func (r RollingUpgradePolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enableCrossZoneUpgrade", r.EnableCrossZoneUpgrade)
+ populate(objectMap, "maxBatchInstancePercent", r.MaxBatchInstancePercent)
+ populate(objectMap, "maxSurge", r.MaxSurge)
+ populate(objectMap, "maxUnhealthyInstancePercent", r.MaxUnhealthyInstancePercent)
+ populate(objectMap, "maxUnhealthyUpgradedInstancePercent", r.MaxUnhealthyUpgradedInstancePercent)
+ populate(objectMap, "pauseTimeBetweenBatches", r.PauseTimeBetweenBatches)
+ populate(objectMap, "prioritizeUnhealthyInstances", r.PrioritizeUnhealthyInstances)
+ populate(objectMap, "rollbackFailedInstancesOnPolicyBreach", r.RollbackFailedInstancesOnPolicyBreach)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradePolicy.
+func (r *RollingUpgradePolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enableCrossZoneUpgrade":
+ err = unpopulate(val, "EnableCrossZoneUpgrade", &r.EnableCrossZoneUpgrade)
+ delete(rawMsg, key)
+ case "maxBatchInstancePercent":
+ err = unpopulate(val, "MaxBatchInstancePercent", &r.MaxBatchInstancePercent)
+ delete(rawMsg, key)
+ case "maxSurge":
+ err = unpopulate(val, "MaxSurge", &r.MaxSurge)
+ delete(rawMsg, key)
+ case "maxUnhealthyInstancePercent":
+ err = unpopulate(val, "MaxUnhealthyInstancePercent", &r.MaxUnhealthyInstancePercent)
+ delete(rawMsg, key)
+ case "maxUnhealthyUpgradedInstancePercent":
+ err = unpopulate(val, "MaxUnhealthyUpgradedInstancePercent", &r.MaxUnhealthyUpgradedInstancePercent)
+ delete(rawMsg, key)
+ case "pauseTimeBetweenBatches":
+ err = unpopulate(val, "PauseTimeBetweenBatches", &r.PauseTimeBetweenBatches)
+ delete(rawMsg, key)
+ case "prioritizeUnhealthyInstances":
+ err = unpopulate(val, "PrioritizeUnhealthyInstances", &r.PrioritizeUnhealthyInstances)
+ delete(rawMsg, key)
+ case "rollbackFailedInstancesOnPolicyBreach":
+ err = unpopulate(val, "RollbackFailedInstancesOnPolicyBreach", &r.RollbackFailedInstancesOnPolicyBreach)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeProgressInfo.
+func (r RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "failedInstanceCount", r.FailedInstanceCount)
+ populate(objectMap, "inProgressInstanceCount", r.InProgressInstanceCount)
+ populate(objectMap, "pendingInstanceCount", r.PendingInstanceCount)
+ populate(objectMap, "successfulInstanceCount", r.SuccessfulInstanceCount)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeProgressInfo.
+func (r *RollingUpgradeProgressInfo) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "failedInstanceCount":
+ err = unpopulate(val, "FailedInstanceCount", &r.FailedInstanceCount)
+ delete(rawMsg, key)
+ case "inProgressInstanceCount":
+ err = unpopulate(val, "InProgressInstanceCount", &r.InProgressInstanceCount)
+ delete(rawMsg, key)
+ case "pendingInstanceCount":
+ err = unpopulate(val, "PendingInstanceCount", &r.PendingInstanceCount)
+ delete(rawMsg, key)
+ case "successfulInstanceCount":
+ err = unpopulate(val, "SuccessfulInstanceCount", &r.SuccessfulInstanceCount)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeRunningStatus.
+func (r RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "code", r.Code)
+ populate(objectMap, "lastAction", r.LastAction)
+ populateDateTimeRFC3339(objectMap, "lastActionTime", r.LastActionTime)
+ populateDateTimeRFC3339(objectMap, "startTime", r.StartTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeRunningStatus.
+func (r *RollingUpgradeRunningStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "code":
+ err = unpopulate(val, "Code", &r.Code)
+ delete(rawMsg, key)
+ case "lastAction":
+ err = unpopulate(val, "LastAction", &r.LastAction)
+ delete(rawMsg, key)
+ case "lastActionTime":
+ err = unpopulateDateTimeRFC3339(val, "LastActionTime", &r.LastActionTime)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulateDateTimeRFC3339(val, "StartTime", &r.StartTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeStatusInfo.
+func (r RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "location", r.Location)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "properties", r.Properties)
+ populate(objectMap, "tags", r.Tags)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeStatusInfo.
+func (r *RollingUpgradeStatusInfo) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &r.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &r.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &r.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RollingUpgradeStatusInfoProperties.
+func (r RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", r.Error)
+ populate(objectMap, "policy", r.Policy)
+ populate(objectMap, "progress", r.Progress)
+ populate(objectMap, "runningStatus", r.RunningStatus)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RollingUpgradeStatusInfoProperties.
+func (r *RollingUpgradeStatusInfoProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &r.Error)
+ delete(rawMsg, key)
+ case "policy":
+ err = unpopulate(val, "Policy", &r.Policy)
+ delete(rawMsg, key)
+ case "progress":
+ err = unpopulate(val, "Progress", &r.Progress)
+ delete(rawMsg, key)
+ case "runningStatus":
+ err = unpopulate(val, "RunningStatus", &r.RunningStatus)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RunCommandDocument.
+func (r RunCommandDocument) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", r.Description)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "label", r.Label)
+ populate(objectMap, "osType", r.OSType)
+ populate(objectMap, "parameters", r.Parameters)
+ populate(objectMap, "$schema", r.Schema)
+ populate(objectMap, "script", r.Script)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandDocument.
+func (r *RunCommandDocument) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &r.Description)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "label":
+ err = unpopulate(val, "Label", &r.Label)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &r.OSType)
+ delete(rawMsg, key)
+ case "parameters":
+ err = unpopulate(val, "Parameters", &r.Parameters)
+ delete(rawMsg, key)
+ case "$schema":
+ err = unpopulate(val, "Schema", &r.Schema)
+ delete(rawMsg, key)
+ case "script":
+ err = unpopulate(val, "Script", &r.Script)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RunCommandDocumentBase.
+func (r RunCommandDocumentBase) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", r.Description)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "label", r.Label)
+ populate(objectMap, "osType", r.OSType)
+ populate(objectMap, "$schema", r.Schema)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandDocumentBase.
+func (r *RunCommandDocumentBase) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &r.Description)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "label":
+ err = unpopulate(val, "Label", &r.Label)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &r.OSType)
+ delete(rawMsg, key)
+ case "$schema":
+ err = unpopulate(val, "Schema", &r.Schema)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RunCommandInput.
+func (r RunCommandInput) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "commandId", r.CommandID)
+ populate(objectMap, "parameters", r.Parameters)
+ populate(objectMap, "script", r.Script)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandInput.
+func (r *RunCommandInput) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "commandId":
+ err = unpopulate(val, "CommandID", &r.CommandID)
+ delete(rawMsg, key)
+ case "parameters":
+ err = unpopulate(val, "Parameters", &r.Parameters)
+ delete(rawMsg, key)
+ case "script":
+ err = unpopulate(val, "Script", &r.Script)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RunCommandInputParameter.
+func (r RunCommandInputParameter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "value", r.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandInputParameter.
+func (r *RunCommandInputParameter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &r.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RunCommandListResult.
+func (r RunCommandListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", r.NextLink)
+ populate(objectMap, "value", r.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandListResult.
+func (r *RunCommandListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &r.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &r.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RunCommandManagedIdentity.
+func (r RunCommandManagedIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "clientId", r.ClientID)
+ populate(objectMap, "objectId", r.ObjectID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandManagedIdentity.
+func (r *RunCommandManagedIdentity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "clientId":
+ err = unpopulate(val, "ClientID", &r.ClientID)
+ delete(rawMsg, key)
+ case "objectId":
+ err = unpopulate(val, "ObjectID", &r.ObjectID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RunCommandParameterDefinition.
+func (r RunCommandParameterDefinition) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "defaultValue", r.DefaultValue)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "required", r.Required)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandParameterDefinition.
+func (r *RunCommandParameterDefinition) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "defaultValue":
+ err = unpopulate(val, "DefaultValue", &r.DefaultValue)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "required":
+ err = unpopulate(val, "Required", &r.Required)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RunCommandResult.
+func (r RunCommandResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", r.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RunCommandResult.
+func (r *RunCommandResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &r.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SKU.
+func (s SKU) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capacity", s.Capacity)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "tier", s.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SKU.
+func (s *SKU) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capacity":
+ err = unpopulate(val, "Capacity", &s.Capacity)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &s.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SSHConfiguration.
+func (s SSHConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "publicKeys", s.PublicKeys)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SSHConfiguration.
+func (s *SSHConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "publicKeys":
+ err = unpopulate(val, "PublicKeys", &s.PublicKeys)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SSHPublicKey.
+func (s SSHPublicKey) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "keyData", s.KeyData)
+ populate(objectMap, "path", s.Path)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKey.
+func (s *SSHPublicKey) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "keyData":
+ err = unpopulate(val, "KeyData", &s.KeyData)
+ delete(rawMsg, key)
+ case "path":
+ err = unpopulate(val, "Path", &s.Path)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyGenerateKeyPairResult.
+func (s SSHPublicKeyGenerateKeyPairResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", s.ID)
+ populate(objectMap, "privateKey", s.PrivateKey)
+ populate(objectMap, "publicKey", s.PublicKey)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyGenerateKeyPairResult.
+func (s *SSHPublicKeyGenerateKeyPairResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ case "privateKey":
+ err = unpopulate(val, "PrivateKey", &s.PrivateKey)
+ delete(rawMsg, key)
+ case "publicKey":
+ err = unpopulate(val, "PublicKey", &s.PublicKey)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyResource.
+func (s SSHPublicKeyResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", s.ID)
+ populate(objectMap, "location", s.Location)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "properties", s.Properties)
+ populate(objectMap, "tags", s.Tags)
+ populate(objectMap, "type", s.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyResource.
+func (s *SSHPublicKeyResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &s.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &s.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &s.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &s.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyResourceProperties.
+func (s SSHPublicKeyResourceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "publicKey", s.PublicKey)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyResourceProperties.
+func (s *SSHPublicKeyResourceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "publicKey":
+ err = unpopulate(val, "PublicKey", &s.PublicKey)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeyUpdateResource.
+func (s SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", s.Properties)
+ populate(objectMap, "tags", s.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeyUpdateResource.
+func (s *SSHPublicKeyUpdateResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &s.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &s.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SSHPublicKeysGroupListResult.
+func (s SSHPublicKeysGroupListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", s.NextLink)
+ populate(objectMap, "value", s.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKeysGroupListResult.
+func (s *SSHPublicKeysGroupListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &s.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &s.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ScaleInPolicy.
+func (s ScaleInPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "forceDeletion", s.ForceDeletion)
+ populate(objectMap, "rules", s.Rules)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleInPolicy.
+func (s *ScaleInPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "forceDeletion":
+ err = unpopulate(val, "ForceDeletion", &s.ForceDeletion)
+ delete(rawMsg, key)
+ case "rules":
+ err = unpopulate(val, "Rules", &s.Rules)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ScheduledEventsProfile.
+func (s ScheduledEventsProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "osImageNotificationProfile", s.OSImageNotificationProfile)
+ populate(objectMap, "terminateNotificationProfile", s.TerminateNotificationProfile)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledEventsProfile.
+func (s *ScheduledEventsProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "osImageNotificationProfile":
+ err = unpopulate(val, "OSImageNotificationProfile", &s.OSImageNotificationProfile)
+ delete(rawMsg, key)
+ case "terminateNotificationProfile":
+ err = unpopulate(val, "TerminateNotificationProfile", &s.TerminateNotificationProfile)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SecurityPostureReference.
+func (s SecurityPostureReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "excludeExtensions", s.ExcludeExtensions)
+ populate(objectMap, "id", s.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPostureReference.
+func (s *SecurityPostureReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "excludeExtensions":
+ err = unpopulate(val, "ExcludeExtensions", &s.ExcludeExtensions)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SecurityProfile.
+func (s SecurityProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "encryptionAtHost", s.EncryptionAtHost)
+ populate(objectMap, "securityType", s.SecurityType)
+ populate(objectMap, "uefiSettings", s.UefiSettings)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityProfile.
+func (s *SecurityProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "encryptionAtHost":
+ err = unpopulate(val, "EncryptionAtHost", &s.EncryptionAtHost)
+ delete(rawMsg, key)
+ case "securityType":
+ err = unpopulate(val, "SecurityType", &s.SecurityType)
+ delete(rawMsg, key)
+ case "uefiSettings":
+ err = unpopulate(val, "UefiSettings", &s.UefiSettings)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ServiceArtifactReference.
+func (s ServiceArtifactReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", s.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceArtifactReference.
+func (s *ServiceArtifactReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ShareInfoElement.
+func (s ShareInfoElement) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "vmUri", s.VMURI)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ShareInfoElement.
+func (s *ShareInfoElement) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "vmUri":
+ err = unpopulate(val, "VMURI", &s.VMURI)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGallery.
+func (s SharedGallery) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identifier", s.Identifier)
+ populate(objectMap, "location", s.Location)
+ populate(objectMap, "name", s.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGallery.
+func (s *SharedGallery) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identifier":
+ err = unpopulate(val, "Identifier", &s.Identifier)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &s.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryDataDiskImage.
+func (s SharedGalleryDataDiskImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskSizeGB", s.DiskSizeGB)
+ populate(objectMap, "hostCaching", s.HostCaching)
+ populate(objectMap, "lun", s.Lun)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryDataDiskImage.
+func (s *SharedGalleryDataDiskImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB)
+ delete(rawMsg, key)
+ case "hostCaching":
+ err = unpopulate(val, "HostCaching", &s.HostCaching)
+ delete(rawMsg, key)
+ case "lun":
+ err = unpopulate(val, "Lun", &s.Lun)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryDiskImage.
+func (s SharedGalleryDiskImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskSizeGB", s.DiskSizeGB)
+ populate(objectMap, "hostCaching", s.HostCaching)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryDiskImage.
+func (s *SharedGalleryDiskImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB)
+ delete(rawMsg, key)
+ case "hostCaching":
+ err = unpopulate(val, "HostCaching", &s.HostCaching)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryIdentifier.
+func (s SharedGalleryIdentifier) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "uniqueId", s.UniqueID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryIdentifier.
+func (s *SharedGalleryIdentifier) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "uniqueId":
+ err = unpopulate(val, "UniqueID", &s.UniqueID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImage.
+func (s SharedGalleryImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identifier", s.Identifier)
+ populate(objectMap, "location", s.Location)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "properties", s.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImage.
+func (s *SharedGalleryImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identifier":
+ err = unpopulate(val, "Identifier", &s.Identifier)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &s.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &s.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageList.
+func (s SharedGalleryImageList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", s.NextLink)
+ populate(objectMap, "value", s.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageList.
+func (s *SharedGalleryImageList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &s.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &s.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageProperties.
+func (s SharedGalleryImageProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "architecture", s.Architecture)
+ populate(objectMap, "disallowed", s.Disallowed)
+ populateDateTimeRFC3339(objectMap, "endOfLifeDate", s.EndOfLifeDate)
+ populate(objectMap, "eula", s.Eula)
+ populate(objectMap, "features", s.Features)
+ populate(objectMap, "hyperVGeneration", s.HyperVGeneration)
+ populate(objectMap, "identifier", s.Identifier)
+ populate(objectMap, "osState", s.OSState)
+ populate(objectMap, "osType", s.OSType)
+ populate(objectMap, "privacyStatementUri", s.PrivacyStatementURI)
+ populate(objectMap, "purchasePlan", s.PurchasePlan)
+ populate(objectMap, "recommended", s.Recommended)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageProperties.
+func (s *SharedGalleryImageProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "architecture":
+ err = unpopulate(val, "Architecture", &s.Architecture)
+ delete(rawMsg, key)
+ case "disallowed":
+ err = unpopulate(val, "Disallowed", &s.Disallowed)
+ delete(rawMsg, key)
+ case "endOfLifeDate":
+ err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &s.EndOfLifeDate)
+ delete(rawMsg, key)
+ case "eula":
+ err = unpopulate(val, "Eula", &s.Eula)
+ delete(rawMsg, key)
+ case "features":
+ err = unpopulate(val, "Features", &s.Features)
+ delete(rawMsg, key)
+ case "hyperVGeneration":
+ err = unpopulate(val, "HyperVGeneration", &s.HyperVGeneration)
+ delete(rawMsg, key)
+ case "identifier":
+ err = unpopulate(val, "Identifier", &s.Identifier)
+ delete(rawMsg, key)
+ case "osState":
+ err = unpopulate(val, "OSState", &s.OSState)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &s.OSType)
+ delete(rawMsg, key)
+ case "privacyStatementUri":
+ err = unpopulate(val, "PrivacyStatementURI", &s.PrivacyStatementURI)
+ delete(rawMsg, key)
+ case "purchasePlan":
+ err = unpopulate(val, "PurchasePlan", &s.PurchasePlan)
+ delete(rawMsg, key)
+ case "recommended":
+ err = unpopulate(val, "Recommended", &s.Recommended)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersion.
+func (s SharedGalleryImageVersion) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identifier", s.Identifier)
+ populate(objectMap, "location", s.Location)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "properties", s.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersion.
+func (s *SharedGalleryImageVersion) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identifier":
+ err = unpopulate(val, "Identifier", &s.Identifier)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &s.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &s.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionList.
+func (s SharedGalleryImageVersionList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", s.NextLink)
+ populate(objectMap, "value", s.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionList.
+func (s *SharedGalleryImageVersionList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &s.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &s.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionProperties.
+func (s SharedGalleryImageVersionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "endOfLifeDate", s.EndOfLifeDate)
+ populate(objectMap, "excludeFromLatest", s.ExcludeFromLatest)
+ populateDateTimeRFC3339(objectMap, "publishedDate", s.PublishedDate)
+ populate(objectMap, "storageProfile", s.StorageProfile)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionProperties.
+func (s *SharedGalleryImageVersionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endOfLifeDate":
+ err = unpopulateDateTimeRFC3339(val, "EndOfLifeDate", &s.EndOfLifeDate)
+ delete(rawMsg, key)
+ case "excludeFromLatest":
+ err = unpopulate(val, "ExcludeFromLatest", &s.ExcludeFromLatest)
+ delete(rawMsg, key)
+ case "publishedDate":
+ err = unpopulateDateTimeRFC3339(val, "PublishedDate", &s.PublishedDate)
+ delete(rawMsg, key)
+ case "storageProfile":
+ err = unpopulate(val, "StorageProfile", &s.StorageProfile)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryImageVersionStorageProfile.
+func (s SharedGalleryImageVersionStorageProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dataDiskImages", s.DataDiskImages)
+ populate(objectMap, "osDiskImage", s.OSDiskImage)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryImageVersionStorageProfile.
+func (s *SharedGalleryImageVersionStorageProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dataDiskImages":
+ err = unpopulate(val, "DataDiskImages", &s.DataDiskImages)
+ delete(rawMsg, key)
+ case "osDiskImage":
+ err = unpopulate(val, "OSDiskImage", &s.OSDiskImage)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryList.
+func (s SharedGalleryList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", s.NextLink)
+ populate(objectMap, "value", s.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryList.
+func (s *SharedGalleryList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &s.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &s.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharedGalleryOSDiskImage.
+func (s SharedGalleryOSDiskImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskSizeGB", s.DiskSizeGB)
+ populate(objectMap, "hostCaching", s.HostCaching)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharedGalleryOSDiskImage.
+func (s *SharedGalleryOSDiskImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB)
+ delete(rawMsg, key)
+ case "hostCaching":
+ err = unpopulate(val, "HostCaching", &s.HostCaching)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharingProfile.
+func (s SharingProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "communityGalleryInfo", s.CommunityGalleryInfo)
+ populate(objectMap, "groups", s.Groups)
+ populate(objectMap, "permissions", s.Permissions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharingProfile.
+func (s *SharingProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "communityGalleryInfo":
+ err = unpopulate(val, "CommunityGalleryInfo", &s.CommunityGalleryInfo)
+ delete(rawMsg, key)
+ case "groups":
+ err = unpopulate(val, "Groups", &s.Groups)
+ delete(rawMsg, key)
+ case "permissions":
+ err = unpopulate(val, "Permissions", &s.Permissions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharingProfileGroup.
+func (s SharingProfileGroup) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "ids", s.IDs)
+ populate(objectMap, "type", s.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharingProfileGroup.
+func (s *SharingProfileGroup) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "ids":
+ err = unpopulate(val, "IDs", &s.IDs)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &s.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharingStatus.
+func (s SharingStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "aggregatedState", s.AggregatedState)
+ populate(objectMap, "summary", s.Summary)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharingStatus.
+func (s *SharingStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "aggregatedState":
+ err = unpopulate(val, "AggregatedState", &s.AggregatedState)
+ delete(rawMsg, key)
+ case "summary":
+ err = unpopulate(val, "Summary", &s.Summary)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SharingUpdate.
+func (s SharingUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "groups", s.Groups)
+ populate(objectMap, "operationType", s.OperationType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SharingUpdate.
+func (s *SharingUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "groups":
+ err = unpopulate(val, "Groups", &s.Groups)
+ delete(rawMsg, key)
+ case "operationType":
+ err = unpopulate(val, "OperationType", &s.OperationType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Snapshot.
+func (s Snapshot) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", s.ExtendedLocation)
+ populate(objectMap, "id", s.ID)
+ populate(objectMap, "location", s.Location)
+ populate(objectMap, "managedBy", s.ManagedBy)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "properties", s.Properties)
+ populate(objectMap, "sku", s.SKU)
+ populate(objectMap, "tags", s.Tags)
+ populate(objectMap, "type", s.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Snapshot.
+func (s *Snapshot) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &s.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &s.Location)
+ delete(rawMsg, key)
+ case "managedBy":
+ err = unpopulate(val, "ManagedBy", &s.ManagedBy)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &s.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &s.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &s.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &s.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SnapshotList.
+func (s SnapshotList) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", s.NextLink)
+ populate(objectMap, "value", s.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotList.
+func (s *SnapshotList) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &s.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &s.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SnapshotProperties.
+func (s SnapshotProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "completionPercent", s.CompletionPercent)
+ populate(objectMap, "copyCompletionError", s.CopyCompletionError)
+ populate(objectMap, "creationData", s.CreationData)
+ populate(objectMap, "dataAccessAuthMode", s.DataAccessAuthMode)
+ populate(objectMap, "diskAccessId", s.DiskAccessID)
+ populate(objectMap, "diskSizeBytes", s.DiskSizeBytes)
+ populate(objectMap, "diskSizeGB", s.DiskSizeGB)
+ populate(objectMap, "diskState", s.DiskState)
+ populate(objectMap, "encryption", s.Encryption)
+ populate(objectMap, "encryptionSettingsCollection", s.EncryptionSettingsCollection)
+ populate(objectMap, "hyperVGeneration", s.HyperVGeneration)
+ populate(objectMap, "incremental", s.Incremental)
+ populate(objectMap, "incrementalSnapshotFamilyId", s.IncrementalSnapshotFamilyID)
+ populate(objectMap, "networkAccessPolicy", s.NetworkAccessPolicy)
+ populate(objectMap, "osType", s.OSType)
+ populate(objectMap, "provisioningState", s.ProvisioningState)
+ populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess)
+ populate(objectMap, "purchasePlan", s.PurchasePlan)
+ populate(objectMap, "securityProfile", s.SecurityProfile)
+ populate(objectMap, "supportedCapabilities", s.SupportedCapabilities)
+ populate(objectMap, "supportsHibernation", s.SupportsHibernation)
+ populateDateTimeRFC3339(objectMap, "timeCreated", s.TimeCreated)
+ populate(objectMap, "uniqueId", s.UniqueID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotProperties.
+func (s *SnapshotProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "completionPercent":
+ err = unpopulate(val, "CompletionPercent", &s.CompletionPercent)
+ delete(rawMsg, key)
+ case "copyCompletionError":
+ err = unpopulate(val, "CopyCompletionError", &s.CopyCompletionError)
+ delete(rawMsg, key)
+ case "creationData":
+ err = unpopulate(val, "CreationData", &s.CreationData)
+ delete(rawMsg, key)
+ case "dataAccessAuthMode":
+ err = unpopulate(val, "DataAccessAuthMode", &s.DataAccessAuthMode)
+ delete(rawMsg, key)
+ case "diskAccessId":
+ err = unpopulate(val, "DiskAccessID", &s.DiskAccessID)
+ delete(rawMsg, key)
+ case "diskSizeBytes":
+ err = unpopulate(val, "DiskSizeBytes", &s.DiskSizeBytes)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB)
+ delete(rawMsg, key)
+ case "diskState":
+ err = unpopulate(val, "DiskState", &s.DiskState)
+ delete(rawMsg, key)
+ case "encryption":
+ err = unpopulate(val, "Encryption", &s.Encryption)
+ delete(rawMsg, key)
+ case "encryptionSettingsCollection":
+ err = unpopulate(val, "EncryptionSettingsCollection", &s.EncryptionSettingsCollection)
+ delete(rawMsg, key)
+ case "hyperVGeneration":
+ err = unpopulate(val, "HyperVGeneration", &s.HyperVGeneration)
+ delete(rawMsg, key)
+ case "incremental":
+ err = unpopulate(val, "Incremental", &s.Incremental)
+ delete(rawMsg, key)
+ case "incrementalSnapshotFamilyId":
+ err = unpopulate(val, "IncrementalSnapshotFamilyID", &s.IncrementalSnapshotFamilyID)
+ delete(rawMsg, key)
+ case "networkAccessPolicy":
+ err = unpopulate(val, "NetworkAccessPolicy", &s.NetworkAccessPolicy)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &s.OSType)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &s.ProvisioningState)
+ delete(rawMsg, key)
+ case "publicNetworkAccess":
+ err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess)
+ delete(rawMsg, key)
+ case "purchasePlan":
+ err = unpopulate(val, "PurchasePlan", &s.PurchasePlan)
+ delete(rawMsg, key)
+ case "securityProfile":
+ err = unpopulate(val, "SecurityProfile", &s.SecurityProfile)
+ delete(rawMsg, key)
+ case "supportedCapabilities":
+ err = unpopulate(val, "SupportedCapabilities", &s.SupportedCapabilities)
+ delete(rawMsg, key)
+ case "supportsHibernation":
+ err = unpopulate(val, "SupportsHibernation", &s.SupportsHibernation)
+ delete(rawMsg, key)
+ case "timeCreated":
+ err = unpopulateDateTimeRFC3339(val, "TimeCreated", &s.TimeCreated)
+ delete(rawMsg, key)
+ case "uniqueId":
+ err = unpopulate(val, "UniqueID", &s.UniqueID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SnapshotSKU.
+func (s SnapshotSKU) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "tier", s.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotSKU.
+func (s *SnapshotSKU) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &s.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SnapshotUpdate.
+func (s SnapshotUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", s.Properties)
+ populate(objectMap, "sku", s.SKU)
+ populate(objectMap, "tags", s.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotUpdate.
+func (s *SnapshotUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &s.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &s.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &s.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SnapshotUpdateProperties.
+func (s SnapshotUpdateProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dataAccessAuthMode", s.DataAccessAuthMode)
+ populate(objectMap, "diskAccessId", s.DiskAccessID)
+ populate(objectMap, "diskSizeGB", s.DiskSizeGB)
+ populate(objectMap, "encryption", s.Encryption)
+ populate(objectMap, "encryptionSettingsCollection", s.EncryptionSettingsCollection)
+ populate(objectMap, "networkAccessPolicy", s.NetworkAccessPolicy)
+ populate(objectMap, "osType", s.OSType)
+ populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess)
+ populate(objectMap, "supportedCapabilities", s.SupportedCapabilities)
+ populate(objectMap, "supportsHibernation", s.SupportsHibernation)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SnapshotUpdateProperties.
+func (s *SnapshotUpdateProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dataAccessAuthMode":
+ err = unpopulate(val, "DataAccessAuthMode", &s.DataAccessAuthMode)
+ delete(rawMsg, key)
+ case "diskAccessId":
+ err = unpopulate(val, "DiskAccessID", &s.DiskAccessID)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &s.DiskSizeGB)
+ delete(rawMsg, key)
+ case "encryption":
+ err = unpopulate(val, "Encryption", &s.Encryption)
+ delete(rawMsg, key)
+ case "encryptionSettingsCollection":
+ err = unpopulate(val, "EncryptionSettingsCollection", &s.EncryptionSettingsCollection)
+ delete(rawMsg, key)
+ case "networkAccessPolicy":
+ err = unpopulate(val, "NetworkAccessPolicy", &s.NetworkAccessPolicy)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &s.OSType)
+ delete(rawMsg, key)
+ case "publicNetworkAccess":
+ err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess)
+ delete(rawMsg, key)
+ case "supportedCapabilities":
+ err = unpopulate(val, "SupportedCapabilities", &s.SupportedCapabilities)
+ delete(rawMsg, key)
+ case "supportsHibernation":
+ err = unpopulate(val, "SupportsHibernation", &s.SupportsHibernation)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SoftDeletePolicy.
+func (s SoftDeletePolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "isSoftDeleteEnabled", s.IsSoftDeleteEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SoftDeletePolicy.
+func (s *SoftDeletePolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "isSoftDeleteEnabled":
+ err = unpopulate(val, "IsSoftDeleteEnabled", &s.IsSoftDeleteEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SourceVault.
+func (s SourceVault) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", s.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SourceVault.
+func (s *SourceVault) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SpotRestorePolicy.
+func (s SpotRestorePolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", s.Enabled)
+ populate(objectMap, "restoreTimeout", s.RestoreTimeout)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SpotRestorePolicy.
+func (s *SpotRestorePolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &s.Enabled)
+ delete(rawMsg, key)
+ case "restoreTimeout":
+ err = unpopulate(val, "RestoreTimeout", &s.RestoreTimeout)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type StatusCodeCount.
+func (s StatusCodeCount) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "code", s.Code)
+ populate(objectMap, "count", s.Count)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type StatusCodeCount.
+func (s *StatusCodeCount) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "code":
+ err = unpopulate(val, "Code", &s.Code)
+ delete(rawMsg, key)
+ case "count":
+ err = unpopulate(val, "Count", &s.Count)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type StorageProfile.
+func (s StorageProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dataDisks", s.DataDisks)
+ populate(objectMap, "diskControllerType", s.DiskControllerType)
+ populate(objectMap, "imageReference", s.ImageReference)
+ populate(objectMap, "osDisk", s.OSDisk)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type StorageProfile.
+func (s *StorageProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dataDisks":
+ err = unpopulate(val, "DataDisks", &s.DataDisks)
+ delete(rawMsg, key)
+ case "diskControllerType":
+ err = unpopulate(val, "DiskControllerType", &s.DiskControllerType)
+ delete(rawMsg, key)
+ case "imageReference":
+ err = unpopulate(val, "ImageReference", &s.ImageReference)
+ delete(rawMsg, key)
+ case "osDisk":
+ err = unpopulate(val, "OSDisk", &s.OSDisk)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SubResource.
+func (s SubResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", s.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource.
+func (s *SubResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SubResourceReadOnly.
+func (s SubResourceReadOnly) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", s.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SubResourceReadOnly.
+func (s *SubResourceReadOnly) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SubResourceWithColocationStatus.
+func (s SubResourceWithColocationStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "colocationStatus", s.ColocationStatus)
+ populate(objectMap, "id", s.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SubResourceWithColocationStatus.
+func (s *SubResourceWithColocationStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "colocationStatus":
+ err = unpopulate(val, "ColocationStatus", &s.ColocationStatus)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SupportedCapabilities.
+func (s SupportedCapabilities) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "acceleratedNetwork", s.AcceleratedNetwork)
+ populate(objectMap, "architecture", s.Architecture)
+ populate(objectMap, "diskControllerTypes", s.DiskControllerTypes)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedCapabilities.
+func (s *SupportedCapabilities) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "acceleratedNetwork":
+ err = unpopulate(val, "AcceleratedNetwork", &s.AcceleratedNetwork)
+ delete(rawMsg, key)
+ case "architecture":
+ err = unpopulate(val, "Architecture", &s.Architecture)
+ delete(rawMsg, key)
+ case "diskControllerTypes":
+ err = unpopulate(val, "DiskControllerTypes", &s.DiskControllerTypes)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SystemData.
+func (s SystemData) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt)
+ populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
+func (s *SystemData) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "createdAt":
+ err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt)
+ delete(rawMsg, key)
+ case "lastModifiedAt":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TargetRegion.
+func (t TargetRegion) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "encryption", t.Encryption)
+ populate(objectMap, "excludeFromLatest", t.ExcludeFromLatest)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "regionalReplicaCount", t.RegionalReplicaCount)
+ populate(objectMap, "storageAccountType", t.StorageAccountType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TargetRegion.
+func (t *TargetRegion) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "encryption":
+ err = unpopulate(val, "Encryption", &t.Encryption)
+ delete(rawMsg, key)
+ case "excludeFromLatest":
+ err = unpopulate(val, "ExcludeFromLatest", &t.ExcludeFromLatest)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "regionalReplicaCount":
+ err = unpopulate(val, "RegionalReplicaCount", &t.RegionalReplicaCount)
+ delete(rawMsg, key)
+ case "storageAccountType":
+ err = unpopulate(val, "StorageAccountType", &t.StorageAccountType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TerminateNotificationProfile.
+func (t TerminateNotificationProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enable", t.Enable)
+ populate(objectMap, "notBeforeTimeout", t.NotBeforeTimeout)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TerminateNotificationProfile.
+func (t *TerminateNotificationProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enable":
+ err = unpopulate(val, "Enable", &t.Enable)
+ delete(rawMsg, key)
+ case "notBeforeTimeout":
+ err = unpopulate(val, "NotBeforeTimeout", &t.NotBeforeTimeout)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ThrottledRequestsInput.
+func (t ThrottledRequestsInput) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobContainerSasUri", t.BlobContainerSasURI)
+ populateDateTimeRFC3339(objectMap, "fromTime", t.FromTime)
+ populate(objectMap, "groupByClientApplicationId", t.GroupByClientApplicationID)
+ populate(objectMap, "groupByOperationName", t.GroupByOperationName)
+ populate(objectMap, "groupByResourceName", t.GroupByResourceName)
+ populate(objectMap, "groupByThrottlePolicy", t.GroupByThrottlePolicy)
+ populate(objectMap, "groupByUserAgent", t.GroupByUserAgent)
+ populateDateTimeRFC3339(objectMap, "toTime", t.ToTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ThrottledRequestsInput.
+func (t *ThrottledRequestsInput) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobContainerSasUri":
+ err = unpopulate(val, "BlobContainerSasURI", &t.BlobContainerSasURI)
+ delete(rawMsg, key)
+ case "fromTime":
+ err = unpopulateDateTimeRFC3339(val, "FromTime", &t.FromTime)
+ delete(rawMsg, key)
+ case "groupByClientApplicationId":
+ err = unpopulate(val, "GroupByClientApplicationID", &t.GroupByClientApplicationID)
+ delete(rawMsg, key)
+ case "groupByOperationName":
+ err = unpopulate(val, "GroupByOperationName", &t.GroupByOperationName)
+ delete(rawMsg, key)
+ case "groupByResourceName":
+ err = unpopulate(val, "GroupByResourceName", &t.GroupByResourceName)
+ delete(rawMsg, key)
+ case "groupByThrottlePolicy":
+ err = unpopulate(val, "GroupByThrottlePolicy", &t.GroupByThrottlePolicy)
+ delete(rawMsg, key)
+ case "groupByUserAgent":
+ err = unpopulate(val, "GroupByUserAgent", &t.GroupByUserAgent)
+ delete(rawMsg, key)
+ case "toTime":
+ err = unpopulateDateTimeRFC3339(val, "ToTime", &t.ToTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UefiSettings.
+func (u UefiSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "secureBootEnabled", u.SecureBootEnabled)
+ populate(objectMap, "vTpmEnabled", u.VTpmEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UefiSettings.
+func (u *UefiSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "secureBootEnabled":
+ err = unpopulate(val, "SecureBootEnabled", &u.SecureBootEnabled)
+ delete(rawMsg, key)
+ case "vTpmEnabled":
+ err = unpopulate(val, "VTpmEnabled", &u.VTpmEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UpdateDomain.
+func (u UpdateDomain) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", u.ID)
+ populate(objectMap, "name", u.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateDomain.
+func (u *UpdateDomain) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &u.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &u.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UpdateDomainListResult.
+func (u UpdateDomainListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", u.NextLink)
+ populate(objectMap, "value", u.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateDomainListResult.
+func (u *UpdateDomainListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &u.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &u.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UpdateResource.
+func (u UpdateResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "tags", u.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateResource.
+func (u *UpdateResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "tags":
+ err = unpopulate(val, "Tags", &u.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UpdateResourceDefinition.
+func (u UpdateResourceDefinition) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", u.ID)
+ populate(objectMap, "name", u.Name)
+ populate(objectMap, "tags", u.Tags)
+ populate(objectMap, "type", u.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateResourceDefinition.
+func (u *UpdateResourceDefinition) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &u.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &u.Name)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &u.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &u.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoricalStatusInfo.
+func (u UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "location", u.Location)
+ populate(objectMap, "properties", u.Properties)
+ populate(objectMap, "type", u.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoricalStatusInfo.
+func (u *UpgradeOperationHistoricalStatusInfo) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "location":
+ err = unpopulate(val, "Location", &u.Location)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &u.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &u.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoricalStatusInfoProperties.
+func (u UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", u.Error)
+ populate(objectMap, "progress", u.Progress)
+ populate(objectMap, "rollbackInfo", u.RollbackInfo)
+ populate(objectMap, "runningStatus", u.RunningStatus)
+ populate(objectMap, "startedBy", u.StartedBy)
+ populate(objectMap, "targetImageReference", u.TargetImageReference)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoricalStatusInfoProperties.
+func (u *UpgradeOperationHistoricalStatusInfoProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &u.Error)
+ delete(rawMsg, key)
+ case "progress":
+ err = unpopulate(val, "Progress", &u.Progress)
+ delete(rawMsg, key)
+ case "rollbackInfo":
+ err = unpopulate(val, "RollbackInfo", &u.RollbackInfo)
+ delete(rawMsg, key)
+ case "runningStatus":
+ err = unpopulate(val, "RunningStatus", &u.RunningStatus)
+ delete(rawMsg, key)
+ case "startedBy":
+ err = unpopulate(val, "StartedBy", &u.StartedBy)
+ delete(rawMsg, key)
+ case "targetImageReference":
+ err = unpopulate(val, "TargetImageReference", &u.TargetImageReference)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UpgradeOperationHistoryStatus.
+func (u UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "code", u.Code)
+ populateDateTimeRFC3339(objectMap, "endTime", u.EndTime)
+ populateDateTimeRFC3339(objectMap, "startTime", u.StartTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeOperationHistoryStatus.
+func (u *UpgradeOperationHistoryStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "code":
+ err = unpopulate(val, "Code", &u.Code)
+ delete(rawMsg, key)
+ case "endTime":
+ err = unpopulateDateTimeRFC3339(val, "EndTime", &u.EndTime)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulateDateTimeRFC3339(val, "StartTime", &u.StartTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UpgradePolicy.
+func (u UpgradePolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "automaticOSUpgradePolicy", u.AutomaticOSUpgradePolicy)
+ populate(objectMap, "mode", u.Mode)
+ populate(objectMap, "rollingUpgradePolicy", u.RollingUpgradePolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradePolicy.
+func (u *UpgradePolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "automaticOSUpgradePolicy":
+ err = unpopulate(val, "AutomaticOSUpgradePolicy", &u.AutomaticOSUpgradePolicy)
+ delete(rawMsg, key)
+ case "mode":
+ err = unpopulate(val, "Mode", &u.Mode)
+ delete(rawMsg, key)
+ case "rollingUpgradePolicy":
+ err = unpopulate(val, "RollingUpgradePolicy", &u.RollingUpgradePolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Usage.
+func (u Usage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "currentValue", u.CurrentValue)
+ populate(objectMap, "limit", u.Limit)
+ populate(objectMap, "name", u.Name)
+ objectMap["unit"] = "Count"
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Usage.
+func (u *Usage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "currentValue":
+ err = unpopulate(val, "CurrentValue", &u.CurrentValue)
+ delete(rawMsg, key)
+ case "limit":
+ err = unpopulate(val, "Limit", &u.Limit)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &u.Name)
+ delete(rawMsg, key)
+ case "unit":
+ err = unpopulate(val, "Unit", &u.Unit)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UsageName.
+func (u UsageName) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "localizedValue", u.LocalizedValue)
+ populate(objectMap, "value", u.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UsageName.
+func (u *UsageName) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "localizedValue":
+ err = unpopulate(val, "LocalizedValue", &u.LocalizedValue)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &u.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UserArtifactManage.
+func (u UserArtifactManage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "install", u.Install)
+ populate(objectMap, "remove", u.Remove)
+ populate(objectMap, "update", u.Update)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactManage.
+func (u *UserArtifactManage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "install":
+ err = unpopulate(val, "Install", &u.Install)
+ delete(rawMsg, key)
+ case "remove":
+ err = unpopulate(val, "Remove", &u.Remove)
+ delete(rawMsg, key)
+ case "update":
+ err = unpopulate(val, "Update", &u.Update)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UserArtifactSettings.
+func (u UserArtifactSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "configFileName", u.ConfigFileName)
+ populate(objectMap, "packageFileName", u.PackageFileName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactSettings.
+func (u *UserArtifactSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "configFileName":
+ err = unpopulate(val, "ConfigFileName", &u.ConfigFileName)
+ delete(rawMsg, key)
+ case "packageFileName":
+ err = unpopulate(val, "PackageFileName", &u.PackageFileName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UserArtifactSource.
+func (u UserArtifactSource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "defaultConfigurationLink", u.DefaultConfigurationLink)
+ populate(objectMap, "mediaLink", u.MediaLink)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UserArtifactSource.
+func (u *UserArtifactSource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "defaultConfigurationLink":
+ err = unpopulate(val, "DefaultConfigurationLink", &u.DefaultConfigurationLink)
+ delete(rawMsg, key)
+ case "mediaLink":
+ err = unpopulate(val, "MediaLink", &u.MediaLink)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentitiesValue.
+func (u UserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "clientId", u.ClientID)
+ populate(objectMap, "principalId", u.PrincipalID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentitiesValue.
+func (u *UserAssignedIdentitiesValue) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "clientId":
+ err = unpopulate(val, "ClientID", &u.ClientID)
+ delete(rawMsg, key)
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &u.PrincipalID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VMDiskSecurityProfile.
+func (v VMDiskSecurityProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskEncryptionSet", v.DiskEncryptionSet)
+ populate(objectMap, "securityEncryptionType", v.SecurityEncryptionType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VMDiskSecurityProfile.
+func (v *VMDiskSecurityProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskEncryptionSet":
+ err = unpopulate(val, "DiskEncryptionSet", &v.DiskEncryptionSet)
+ delete(rawMsg, key)
+ case "securityEncryptionType":
+ err = unpopulate(val, "SecurityEncryptionType", &v.SecurityEncryptionType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VMGalleryApplication.
+func (v VMGalleryApplication) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "configurationReference", v.ConfigurationReference)
+ populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade)
+ populate(objectMap, "order", v.Order)
+ populate(objectMap, "packageReferenceId", v.PackageReferenceID)
+ populate(objectMap, "tags", v.Tags)
+ populate(objectMap, "treatFailureAsDeploymentFailure", v.TreatFailureAsDeploymentFailure)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VMGalleryApplication.
+func (v *VMGalleryApplication) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "configurationReference":
+ err = unpopulate(val, "ConfigurationReference", &v.ConfigurationReference)
+ delete(rawMsg, key)
+ case "enableAutomaticUpgrade":
+ err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade)
+ delete(rawMsg, key)
+ case "order":
+ err = unpopulate(val, "Order", &v.Order)
+ delete(rawMsg, key)
+ case "packageReferenceId":
+ err = unpopulate(val, "PackageReferenceID", &v.PackageReferenceID)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ case "treatFailureAsDeploymentFailure":
+ err = unpopulate(val, "TreatFailureAsDeploymentFailure", &v.TreatFailureAsDeploymentFailure)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VMImagesInEdgeZoneListResult.
+func (v VMImagesInEdgeZoneListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", v.NextLink)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VMImagesInEdgeZoneListResult.
+func (v *VMImagesInEdgeZoneListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &v.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VMScaleSetConvertToSinglePlacementGroupInput.
+func (v VMScaleSetConvertToSinglePlacementGroupInput) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "activePlacementGroupId", v.ActivePlacementGroupID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VMScaleSetConvertToSinglePlacementGroupInput.
+func (v *VMScaleSetConvertToSinglePlacementGroupInput) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "activePlacementGroupId":
+ err = unpopulate(val, "ActivePlacementGroupID", &v.ActivePlacementGroupID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VMSizeProperties.
+func (v VMSizeProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "vCPUsAvailable", v.VCPUsAvailable)
+ populate(objectMap, "vCPUsPerCore", v.VCPUsPerCore)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VMSizeProperties.
+func (v *VMSizeProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "vCPUsAvailable":
+ err = unpopulate(val, "VCPUsAvailable", &v.VCPUsAvailable)
+ delete(rawMsg, key)
+ case "vCPUsPerCore":
+ err = unpopulate(val, "VCPUsPerCore", &v.VCPUsPerCore)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VaultCertificate.
+func (v VaultCertificate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "certificateStore", v.CertificateStore)
+ populate(objectMap, "certificateUrl", v.CertificateURL)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VaultCertificate.
+func (v *VaultCertificate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "certificateStore":
+ err = unpopulate(val, "CertificateStore", &v.CertificateStore)
+ delete(rawMsg, key)
+ case "certificateUrl":
+ err = unpopulate(val, "CertificateURL", &v.CertificateURL)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VaultSecretGroup.
+func (v VaultSecretGroup) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "sourceVault", v.SourceVault)
+ populate(objectMap, "vaultCertificates", v.VaultCertificates)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VaultSecretGroup.
+func (v *VaultSecretGroup) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "sourceVault":
+ err = unpopulate(val, "SourceVault", &v.SourceVault)
+ delete(rawMsg, key)
+ case "vaultCertificates":
+ err = unpopulate(val, "VaultCertificates", &v.VaultCertificates)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualHardDisk.
+func (v VirtualHardDisk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "uri", v.URI)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualHardDisk.
+func (v *VirtualHardDisk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "uri":
+ err = unpopulate(val, "URI", &v.URI)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachine.
+func (v VirtualMachine) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", v.ExtendedLocation)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "identity", v.Identity)
+ populate(objectMap, "location", v.Location)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "plan", v.Plan)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "resources", v.Resources)
+ populate(objectMap, "tags", v.Tags)
+ populate(objectMap, "type", v.Type)
+ populate(objectMap, "zones", v.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachine.
+func (v *VirtualMachine) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &v.Identity)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &v.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "plan":
+ err = unpopulate(val, "Plan", &v.Plan)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "resources":
+ err = unpopulate(val, "Resources", &v.Resources)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &v.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineAgentInstanceView.
+func (v VirtualMachineAgentInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extensionHandlers", v.ExtensionHandlers)
+ populate(objectMap, "statuses", v.Statuses)
+ populate(objectMap, "vmAgentVersion", v.VMAgentVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineAgentInstanceView.
+func (v *VirtualMachineAgentInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extensionHandlers":
+ err = unpopulate(val, "ExtensionHandlers", &v.ExtensionHandlers)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &v.Statuses)
+ delete(rawMsg, key)
+ case "vmAgentVersion":
+ err = unpopulate(val, "VMAgentVersion", &v.VMAgentVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineAssessPatchesResult.
+func (v VirtualMachineAssessPatchesResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "assessmentActivityId", v.AssessmentActivityID)
+ populate(objectMap, "availablePatches", v.AvailablePatches)
+ populate(objectMap, "criticalAndSecurityPatchCount", v.CriticalAndSecurityPatchCount)
+ populate(objectMap, "error", v.Error)
+ populate(objectMap, "otherPatchCount", v.OtherPatchCount)
+ populate(objectMap, "rebootPending", v.RebootPending)
+ populateDateTimeRFC3339(objectMap, "startDateTime", v.StartDateTime)
+ populate(objectMap, "status", v.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineAssessPatchesResult.
+func (v *VirtualMachineAssessPatchesResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "assessmentActivityId":
+ err = unpopulate(val, "AssessmentActivityID", &v.AssessmentActivityID)
+ delete(rawMsg, key)
+ case "availablePatches":
+ err = unpopulate(val, "AvailablePatches", &v.AvailablePatches)
+ delete(rawMsg, key)
+ case "criticalAndSecurityPatchCount":
+ err = unpopulate(val, "CriticalAndSecurityPatchCount", &v.CriticalAndSecurityPatchCount)
+ delete(rawMsg, key)
+ case "error":
+ err = unpopulate(val, "Error", &v.Error)
+ delete(rawMsg, key)
+ case "otherPatchCount":
+ err = unpopulate(val, "OtherPatchCount", &v.OtherPatchCount)
+ delete(rawMsg, key)
+ case "rebootPending":
+ err = unpopulate(val, "RebootPending", &v.RebootPending)
+ delete(rawMsg, key)
+ case "startDateTime":
+ err = unpopulateDateTimeRFC3339(val, "StartDateTime", &v.StartDateTime)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &v.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineCaptureParameters.
+func (v VirtualMachineCaptureParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "destinationContainerName", v.DestinationContainerName)
+ populate(objectMap, "overwriteVhds", v.OverwriteVhds)
+ populate(objectMap, "vhdPrefix", v.VhdPrefix)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineCaptureParameters.
+func (v *VirtualMachineCaptureParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "destinationContainerName":
+ err = unpopulate(val, "DestinationContainerName", &v.DestinationContainerName)
+ delete(rawMsg, key)
+ case "overwriteVhds":
+ err = unpopulate(val, "OverwriteVhds", &v.OverwriteVhds)
+ delete(rawMsg, key)
+ case "vhdPrefix":
+ err = unpopulate(val, "VhdPrefix", &v.VhdPrefix)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineCaptureResult.
+func (v VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "contentVersion", v.ContentVersion)
+ populate(objectMap, "id", v.ID)
+ populateAny(objectMap, "parameters", v.Parameters)
+ populate(objectMap, "resources", v.Resources)
+ populate(objectMap, "$schema", v.Schema)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineCaptureResult.
+func (v *VirtualMachineCaptureResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "contentVersion":
+ err = unpopulate(val, "ContentVersion", &v.ContentVersion)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "parameters":
+ err = unpopulate(val, "Parameters", &v.Parameters)
+ delete(rawMsg, key)
+ case "resources":
+ err = unpopulate(val, "Resources", &v.Resources)
+ delete(rawMsg, key)
+ case "$schema":
+ err = unpopulate(val, "Schema", &v.Schema)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtension.
+func (v VirtualMachineExtension) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "location", v.Location)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "tags", v.Tags)
+ populate(objectMap, "type", v.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtension.
+func (v *VirtualMachineExtension) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &v.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionHandlerInstanceView.
+func (v VirtualMachineExtensionHandlerInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "status", v.Status)
+ populate(objectMap, "type", v.Type)
+ populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionHandlerInstanceView.
+func (v *VirtualMachineExtensionHandlerInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "status":
+ err = unpopulate(val, "Status", &v.Status)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ case "typeHandlerVersion":
+ err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionImage.
+func (v VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "location", v.Location)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "tags", v.Tags)
+ populate(objectMap, "type", v.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionImage.
+func (v *VirtualMachineExtensionImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &v.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionImageProperties.
+func (v VirtualMachineExtensionImageProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "computeRole", v.ComputeRole)
+ populate(objectMap, "handlerSchema", v.HandlerSchema)
+ populate(objectMap, "operatingSystem", v.OperatingSystem)
+ populate(objectMap, "supportsMultipleExtensions", v.SupportsMultipleExtensions)
+ populate(objectMap, "vmScaleSetEnabled", v.VMScaleSetEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionImageProperties.
+func (v *VirtualMachineExtensionImageProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "computeRole":
+ err = unpopulate(val, "ComputeRole", &v.ComputeRole)
+ delete(rawMsg, key)
+ case "handlerSchema":
+ err = unpopulate(val, "HandlerSchema", &v.HandlerSchema)
+ delete(rawMsg, key)
+ case "operatingSystem":
+ err = unpopulate(val, "OperatingSystem", &v.OperatingSystem)
+ delete(rawMsg, key)
+ case "supportsMultipleExtensions":
+ err = unpopulate(val, "SupportsMultipleExtensions", &v.SupportsMultipleExtensions)
+ delete(rawMsg, key)
+ case "vmScaleSetEnabled":
+ err = unpopulate(val, "VMScaleSetEnabled", &v.VMScaleSetEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionInstanceView.
+func (v VirtualMachineExtensionInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "statuses", v.Statuses)
+ populate(objectMap, "substatuses", v.Substatuses)
+ populate(objectMap, "type", v.Type)
+ populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionInstanceView.
+func (v *VirtualMachineExtensionInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &v.Statuses)
+ delete(rawMsg, key)
+ case "substatuses":
+ err = unpopulate(val, "Substatuses", &v.Substatuses)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ case "typeHandlerVersion":
+ err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionProperties.
+func (v VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion)
+ populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade)
+ populate(objectMap, "forceUpdateTag", v.ForceUpdateTag)
+ populate(objectMap, "instanceView", v.InstanceView)
+ populateAny(objectMap, "protectedSettings", v.ProtectedSettings)
+ populate(objectMap, "protectedSettingsFromKeyVault", v.ProtectedSettingsFromKeyVault)
+ populate(objectMap, "provisionAfterExtensions", v.ProvisionAfterExtensions)
+ populate(objectMap, "provisioningState", v.ProvisioningState)
+ populate(objectMap, "publisher", v.Publisher)
+ populateAny(objectMap, "settings", v.Settings)
+ populate(objectMap, "suppressFailures", v.SuppressFailures)
+ populate(objectMap, "type", v.Type)
+ populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionProperties.
+func (v *VirtualMachineExtensionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "autoUpgradeMinorVersion":
+ err = unpopulate(val, "AutoUpgradeMinorVersion", &v.AutoUpgradeMinorVersion)
+ delete(rawMsg, key)
+ case "enableAutomaticUpgrade":
+ err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade)
+ delete(rawMsg, key)
+ case "forceUpdateTag":
+ err = unpopulate(val, "ForceUpdateTag", &v.ForceUpdateTag)
+ delete(rawMsg, key)
+ case "instanceView":
+ err = unpopulate(val, "InstanceView", &v.InstanceView)
+ delete(rawMsg, key)
+ case "protectedSettings":
+ err = unpopulate(val, "ProtectedSettings", &v.ProtectedSettings)
+ delete(rawMsg, key)
+ case "protectedSettingsFromKeyVault":
+ err = unpopulate(val, "ProtectedSettingsFromKeyVault", &v.ProtectedSettingsFromKeyVault)
+ delete(rawMsg, key)
+ case "provisionAfterExtensions":
+ err = unpopulate(val, "ProvisionAfterExtensions", &v.ProvisionAfterExtensions)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &v.ProvisioningState)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &v.Publisher)
+ delete(rawMsg, key)
+ case "settings":
+ err = unpopulate(val, "Settings", &v.Settings)
+ delete(rawMsg, key)
+ case "suppressFailures":
+ err = unpopulate(val, "SuppressFailures", &v.SuppressFailures)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ case "typeHandlerVersion":
+ err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionUpdate.
+func (v VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "tags", v.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionUpdate.
+func (v *VirtualMachineExtensionUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionUpdateProperties.
+func (v VirtualMachineExtensionUpdateProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion)
+ populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade)
+ populate(objectMap, "forceUpdateTag", v.ForceUpdateTag)
+ populateAny(objectMap, "protectedSettings", v.ProtectedSettings)
+ populate(objectMap, "protectedSettingsFromKeyVault", v.ProtectedSettingsFromKeyVault)
+ populate(objectMap, "publisher", v.Publisher)
+ populateAny(objectMap, "settings", v.Settings)
+ populate(objectMap, "suppressFailures", v.SuppressFailures)
+ populate(objectMap, "type", v.Type)
+ populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionUpdateProperties.
+func (v *VirtualMachineExtensionUpdateProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "autoUpgradeMinorVersion":
+ err = unpopulate(val, "AutoUpgradeMinorVersion", &v.AutoUpgradeMinorVersion)
+ delete(rawMsg, key)
+ case "enableAutomaticUpgrade":
+ err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade)
+ delete(rawMsg, key)
+ case "forceUpdateTag":
+ err = unpopulate(val, "ForceUpdateTag", &v.ForceUpdateTag)
+ delete(rawMsg, key)
+ case "protectedSettings":
+ err = unpopulate(val, "ProtectedSettings", &v.ProtectedSettings)
+ delete(rawMsg, key)
+ case "protectedSettingsFromKeyVault":
+ err = unpopulate(val, "ProtectedSettingsFromKeyVault", &v.ProtectedSettingsFromKeyVault)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &v.Publisher)
+ delete(rawMsg, key)
+ case "settings":
+ err = unpopulate(val, "Settings", &v.Settings)
+ delete(rawMsg, key)
+ case "suppressFailures":
+ err = unpopulate(val, "SuppressFailures", &v.SuppressFailures)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ case "typeHandlerVersion":
+ err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineExtensionsListResult.
+func (v VirtualMachineExtensionsListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineExtensionsListResult.
+func (v *VirtualMachineExtensionsListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineHealthStatus.
+func (v VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "status", v.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineHealthStatus.
+func (v *VirtualMachineHealthStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "status":
+ err = unpopulate(val, "Status", &v.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineIPTag.
+func (v VirtualMachineIPTag) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "ipTagType", v.IPTagType)
+ populate(objectMap, "tag", v.Tag)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineIPTag.
+func (v *VirtualMachineIPTag) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "ipTagType":
+ err = unpopulate(val, "IPTagType", &v.IPTagType)
+ delete(rawMsg, key)
+ case "tag":
+ err = unpopulate(val, "Tag", &v.Tag)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineIdentity.
+func (v VirtualMachineIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "principalId", v.PrincipalID)
+ populate(objectMap, "tenantId", v.TenantID)
+ populate(objectMap, "type", v.Type)
+ populate(objectMap, "userAssignedIdentities", v.UserAssignedIdentities)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineIdentity.
+func (v *VirtualMachineIdentity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &v.PrincipalID)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &v.TenantID)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ case "userAssignedIdentities":
+ err = unpopulate(val, "UserAssignedIdentities", &v.UserAssignedIdentities)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImage.
+func (v VirtualMachineImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", v.ExtendedLocation)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "location", v.Location)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "tags", v.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImage.
+func (v *VirtualMachineImage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &v.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageFeature.
+func (v VirtualMachineImageFeature) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageFeature.
+func (v *VirtualMachineImageFeature) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageProperties.
+func (v VirtualMachineImageProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "architecture", v.Architecture)
+ populate(objectMap, "automaticOSUpgradeProperties", v.AutomaticOSUpgradeProperties)
+ populate(objectMap, "dataDiskImages", v.DataDiskImages)
+ populate(objectMap, "disallowed", v.Disallowed)
+ populate(objectMap, "features", v.Features)
+ populate(objectMap, "hyperVGeneration", v.HyperVGeneration)
+ populate(objectMap, "imageDeprecationStatus", v.ImageDeprecationStatus)
+ populate(objectMap, "osDiskImage", v.OSDiskImage)
+ populate(objectMap, "plan", v.Plan)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageProperties.
+func (v *VirtualMachineImageProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "architecture":
+ err = unpopulate(val, "Architecture", &v.Architecture)
+ delete(rawMsg, key)
+ case "automaticOSUpgradeProperties":
+ err = unpopulate(val, "AutomaticOSUpgradeProperties", &v.AutomaticOSUpgradeProperties)
+ delete(rawMsg, key)
+ case "dataDiskImages":
+ err = unpopulate(val, "DataDiskImages", &v.DataDiskImages)
+ delete(rawMsg, key)
+ case "disallowed":
+ err = unpopulate(val, "Disallowed", &v.Disallowed)
+ delete(rawMsg, key)
+ case "features":
+ err = unpopulate(val, "Features", &v.Features)
+ delete(rawMsg, key)
+ case "hyperVGeneration":
+ err = unpopulate(val, "HyperVGeneration", &v.HyperVGeneration)
+ delete(rawMsg, key)
+ case "imageDeprecationStatus":
+ err = unpopulate(val, "ImageDeprecationStatus", &v.ImageDeprecationStatus)
+ delete(rawMsg, key)
+ case "osDiskImage":
+ err = unpopulate(val, "OSDiskImage", &v.OSDiskImage)
+ delete(rawMsg, key)
+ case "plan":
+ err = unpopulate(val, "Plan", &v.Plan)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineImageResource.
+func (v VirtualMachineImageResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", v.ExtendedLocation)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "location", v.Location)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "tags", v.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineImageResource.
+func (v *VirtualMachineImageResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &v.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstallPatchesParameters.
+func (v VirtualMachineInstallPatchesParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "linuxParameters", v.LinuxParameters)
+ populate(objectMap, "maximumDuration", v.MaximumDuration)
+ populate(objectMap, "rebootSetting", v.RebootSetting)
+ populate(objectMap, "windowsParameters", v.WindowsParameters)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstallPatchesParameters.
+func (v *VirtualMachineInstallPatchesParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "linuxParameters":
+ err = unpopulate(val, "LinuxParameters", &v.LinuxParameters)
+ delete(rawMsg, key)
+ case "maximumDuration":
+ err = unpopulate(val, "MaximumDuration", &v.MaximumDuration)
+ delete(rawMsg, key)
+ case "rebootSetting":
+ err = unpopulate(val, "RebootSetting", &v.RebootSetting)
+ delete(rawMsg, key)
+ case "windowsParameters":
+ err = unpopulate(val, "WindowsParameters", &v.WindowsParameters)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstallPatchesResult.
+func (v VirtualMachineInstallPatchesResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", v.Error)
+ populate(objectMap, "excludedPatchCount", v.ExcludedPatchCount)
+ populate(objectMap, "failedPatchCount", v.FailedPatchCount)
+ populate(objectMap, "installationActivityId", v.InstallationActivityID)
+ populate(objectMap, "installedPatchCount", v.InstalledPatchCount)
+ populate(objectMap, "maintenanceWindowExceeded", v.MaintenanceWindowExceeded)
+ populate(objectMap, "notSelectedPatchCount", v.NotSelectedPatchCount)
+ populate(objectMap, "patches", v.Patches)
+ populate(objectMap, "pendingPatchCount", v.PendingPatchCount)
+ populate(objectMap, "rebootStatus", v.RebootStatus)
+ populateDateTimeRFC3339(objectMap, "startDateTime", v.StartDateTime)
+ populate(objectMap, "status", v.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstallPatchesResult.
+func (v *VirtualMachineInstallPatchesResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &v.Error)
+ delete(rawMsg, key)
+ case "excludedPatchCount":
+ err = unpopulate(val, "ExcludedPatchCount", &v.ExcludedPatchCount)
+ delete(rawMsg, key)
+ case "failedPatchCount":
+ err = unpopulate(val, "FailedPatchCount", &v.FailedPatchCount)
+ delete(rawMsg, key)
+ case "installationActivityId":
+ err = unpopulate(val, "InstallationActivityID", &v.InstallationActivityID)
+ delete(rawMsg, key)
+ case "installedPatchCount":
+ err = unpopulate(val, "InstalledPatchCount", &v.InstalledPatchCount)
+ delete(rawMsg, key)
+ case "maintenanceWindowExceeded":
+ err = unpopulate(val, "MaintenanceWindowExceeded", &v.MaintenanceWindowExceeded)
+ delete(rawMsg, key)
+ case "notSelectedPatchCount":
+ err = unpopulate(val, "NotSelectedPatchCount", &v.NotSelectedPatchCount)
+ delete(rawMsg, key)
+ case "patches":
+ err = unpopulate(val, "Patches", &v.Patches)
+ delete(rawMsg, key)
+ case "pendingPatchCount":
+ err = unpopulate(val, "PendingPatchCount", &v.PendingPatchCount)
+ delete(rawMsg, key)
+ case "rebootStatus":
+ err = unpopulate(val, "RebootStatus", &v.RebootStatus)
+ delete(rawMsg, key)
+ case "startDateTime":
+ err = unpopulateDateTimeRFC3339(val, "StartDateTime", &v.StartDateTime)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &v.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineInstanceView.
+func (v VirtualMachineInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "assignedHost", v.AssignedHost)
+ populate(objectMap, "bootDiagnostics", v.BootDiagnostics)
+ populate(objectMap, "computerName", v.ComputerName)
+ populate(objectMap, "disks", v.Disks)
+ populate(objectMap, "extensions", v.Extensions)
+ populate(objectMap, "hyperVGeneration", v.HyperVGeneration)
+ populate(objectMap, "maintenanceRedeployStatus", v.MaintenanceRedeployStatus)
+ populate(objectMap, "osName", v.OSName)
+ populate(objectMap, "osVersion", v.OSVersion)
+ populate(objectMap, "patchStatus", v.PatchStatus)
+ populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain)
+ populate(objectMap, "platformUpdateDomain", v.PlatformUpdateDomain)
+ populate(objectMap, "rdpThumbPrint", v.RdpThumbPrint)
+ populate(objectMap, "statuses", v.Statuses)
+ populate(objectMap, "vmAgent", v.VMAgent)
+ populate(objectMap, "vmHealth", v.VMHealth)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineInstanceView.
+func (v *VirtualMachineInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "assignedHost":
+ err = unpopulate(val, "AssignedHost", &v.AssignedHost)
+ delete(rawMsg, key)
+ case "bootDiagnostics":
+ err = unpopulate(val, "BootDiagnostics", &v.BootDiagnostics)
+ delete(rawMsg, key)
+ case "computerName":
+ err = unpopulate(val, "ComputerName", &v.ComputerName)
+ delete(rawMsg, key)
+ case "disks":
+ err = unpopulate(val, "Disks", &v.Disks)
+ delete(rawMsg, key)
+ case "extensions":
+ err = unpopulate(val, "Extensions", &v.Extensions)
+ delete(rawMsg, key)
+ case "hyperVGeneration":
+ err = unpopulate(val, "HyperVGeneration", &v.HyperVGeneration)
+ delete(rawMsg, key)
+ case "maintenanceRedeployStatus":
+ err = unpopulate(val, "MaintenanceRedeployStatus", &v.MaintenanceRedeployStatus)
+ delete(rawMsg, key)
+ case "osName":
+ err = unpopulate(val, "OSName", &v.OSName)
+ delete(rawMsg, key)
+ case "osVersion":
+ err = unpopulate(val, "OSVersion", &v.OSVersion)
+ delete(rawMsg, key)
+ case "patchStatus":
+ err = unpopulate(val, "PatchStatus", &v.PatchStatus)
+ delete(rawMsg, key)
+ case "platformFaultDomain":
+ err = unpopulate(val, "PlatformFaultDomain", &v.PlatformFaultDomain)
+ delete(rawMsg, key)
+ case "platformUpdateDomain":
+ err = unpopulate(val, "PlatformUpdateDomain", &v.PlatformUpdateDomain)
+ delete(rawMsg, key)
+ case "rdpThumbPrint":
+ err = unpopulate(val, "RdpThumbPrint", &v.RdpThumbPrint)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &v.Statuses)
+ delete(rawMsg, key)
+ case "vmAgent":
+ err = unpopulate(val, "VMAgent", &v.VMAgent)
+ delete(rawMsg, key)
+ case "vmHealth":
+ err = unpopulate(val, "VMHealth", &v.VMHealth)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineListResult.
+func (v VirtualMachineListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", v.NextLink)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineListResult.
+func (v *VirtualMachineListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &v.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceConfiguration.
+func (v VirtualMachineNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceConfiguration.
+func (v *VirtualMachineNetworkInterfaceConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceConfigurationProperties.
+func (v VirtualMachineNetworkInterfaceConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "auxiliaryMode", v.AuxiliaryMode)
+ populate(objectMap, "auxiliarySku", v.AuxiliarySKU)
+ populate(objectMap, "dnsSettings", v.DNSSettings)
+ populate(objectMap, "deleteOption", v.DeleteOption)
+ populate(objectMap, "disableTcpStateTracking", v.DisableTCPStateTracking)
+ populate(objectMap, "dscpConfiguration", v.DscpConfiguration)
+ populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking)
+ populate(objectMap, "enableFpga", v.EnableFpga)
+ populate(objectMap, "enableIPForwarding", v.EnableIPForwarding)
+ populate(objectMap, "ipConfigurations", v.IPConfigurations)
+ populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup)
+ populate(objectMap, "primary", v.Primary)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceConfigurationProperties.
+func (v *VirtualMachineNetworkInterfaceConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "auxiliaryMode":
+ err = unpopulate(val, "AuxiliaryMode", &v.AuxiliaryMode)
+ delete(rawMsg, key)
+ case "auxiliarySku":
+ err = unpopulate(val, "AuxiliarySKU", &v.AuxiliarySKU)
+ delete(rawMsg, key)
+ case "dnsSettings":
+ err = unpopulate(val, "DNSSettings", &v.DNSSettings)
+ delete(rawMsg, key)
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &v.DeleteOption)
+ delete(rawMsg, key)
+ case "disableTcpStateTracking":
+ err = unpopulate(val, "DisableTCPStateTracking", &v.DisableTCPStateTracking)
+ delete(rawMsg, key)
+ case "dscpConfiguration":
+ err = unpopulate(val, "DscpConfiguration", &v.DscpConfiguration)
+ delete(rawMsg, key)
+ case "enableAcceleratedNetworking":
+ err = unpopulate(val, "EnableAcceleratedNetworking", &v.EnableAcceleratedNetworking)
+ delete(rawMsg, key)
+ case "enableFpga":
+ err = unpopulate(val, "EnableFpga", &v.EnableFpga)
+ delete(rawMsg, key)
+ case "enableIPForwarding":
+ err = unpopulate(val, "EnableIPForwarding", &v.EnableIPForwarding)
+ delete(rawMsg, key)
+ case "ipConfigurations":
+ err = unpopulate(val, "IPConfigurations", &v.IPConfigurations)
+ delete(rawMsg, key)
+ case "networkSecurityGroup":
+ err = unpopulate(val, "NetworkSecurityGroup", &v.NetworkSecurityGroup)
+ delete(rawMsg, key)
+ case "primary":
+ err = unpopulate(val, "Primary", &v.Primary)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceDNSSettingsConfiguration.
+func (v VirtualMachineNetworkInterfaceDNSSettingsConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dnsServers", v.DNSServers)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceDNSSettingsConfiguration.
+func (v *VirtualMachineNetworkInterfaceDNSSettingsConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dnsServers":
+ err = unpopulate(val, "DNSServers", &v.DNSServers)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceIPConfiguration.
+func (v VirtualMachineNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceIPConfiguration.
+func (v *VirtualMachineNetworkInterfaceIPConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNetworkInterfaceIPConfigurationProperties.
+func (v VirtualMachineNetworkInterfaceIPConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools)
+ populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups)
+ populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools)
+ populate(objectMap, "primary", v.Primary)
+ populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion)
+ populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration)
+ populate(objectMap, "subnet", v.Subnet)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNetworkInterfaceIPConfigurationProperties.
+func (v *VirtualMachineNetworkInterfaceIPConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "applicationGatewayBackendAddressPools":
+ err = unpopulate(val, "ApplicationGatewayBackendAddressPools", &v.ApplicationGatewayBackendAddressPools)
+ delete(rawMsg, key)
+ case "applicationSecurityGroups":
+ err = unpopulate(val, "ApplicationSecurityGroups", &v.ApplicationSecurityGroups)
+ delete(rawMsg, key)
+ case "loadBalancerBackendAddressPools":
+ err = unpopulate(val, "LoadBalancerBackendAddressPools", &v.LoadBalancerBackendAddressPools)
+ delete(rawMsg, key)
+ case "primary":
+ err = unpopulate(val, "Primary", &v.Primary)
+ delete(rawMsg, key)
+ case "privateIPAddressVersion":
+ err = unpopulate(val, "PrivateIPAddressVersion", &v.PrivateIPAddressVersion)
+ delete(rawMsg, key)
+ case "publicIPAddressConfiguration":
+ err = unpopulate(val, "PublicIPAddressConfiguration", &v.PublicIPAddressConfiguration)
+ delete(rawMsg, key)
+ case "subnet":
+ err = unpopulate(val, "Subnet", &v.Subnet)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePatchStatus.
+func (v VirtualMachinePatchStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "availablePatchSummary", v.AvailablePatchSummary)
+ populate(objectMap, "configurationStatuses", v.ConfigurationStatuses)
+ populate(objectMap, "lastPatchInstallationSummary", v.LastPatchInstallationSummary)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePatchStatus.
+func (v *VirtualMachinePatchStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "availablePatchSummary":
+ err = unpopulate(val, "AvailablePatchSummary", &v.AvailablePatchSummary)
+ delete(rawMsg, key)
+ case "configurationStatuses":
+ err = unpopulate(val, "ConfigurationStatuses", &v.ConfigurationStatuses)
+ delete(rawMsg, key)
+ case "lastPatchInstallationSummary":
+ err = unpopulate(val, "LastPatchInstallationSummary", &v.LastPatchInstallationSummary)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineProperties.
+func (v VirtualMachineProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities)
+ populate(objectMap, "applicationProfile", v.ApplicationProfile)
+ populate(objectMap, "availabilitySet", v.AvailabilitySet)
+ populate(objectMap, "billingProfile", v.BillingProfile)
+ populate(objectMap, "capacityReservation", v.CapacityReservation)
+ populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile)
+ populate(objectMap, "evictionPolicy", v.EvictionPolicy)
+ populate(objectMap, "extensionsTimeBudget", v.ExtensionsTimeBudget)
+ populate(objectMap, "hardwareProfile", v.HardwareProfile)
+ populate(objectMap, "host", v.Host)
+ populate(objectMap, "hostGroup", v.HostGroup)
+ populate(objectMap, "instanceView", v.InstanceView)
+ populate(objectMap, "licenseType", v.LicenseType)
+ populate(objectMap, "networkProfile", v.NetworkProfile)
+ populate(objectMap, "osProfile", v.OSProfile)
+ populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain)
+ populate(objectMap, "priority", v.Priority)
+ populate(objectMap, "provisioningState", v.ProvisioningState)
+ populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup)
+ populate(objectMap, "scheduledEventsProfile", v.ScheduledEventsProfile)
+ populate(objectMap, "securityProfile", v.SecurityProfile)
+ populate(objectMap, "storageProfile", v.StorageProfile)
+ populateDateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated)
+ populate(objectMap, "userData", v.UserData)
+ populate(objectMap, "vmId", v.VMID)
+ populate(objectMap, "virtualMachineScaleSet", v.VirtualMachineScaleSet)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineProperties.
+func (v *VirtualMachineProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "additionalCapabilities":
+ err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities)
+ delete(rawMsg, key)
+ case "applicationProfile":
+ err = unpopulate(val, "ApplicationProfile", &v.ApplicationProfile)
+ delete(rawMsg, key)
+ case "availabilitySet":
+ err = unpopulate(val, "AvailabilitySet", &v.AvailabilitySet)
+ delete(rawMsg, key)
+ case "billingProfile":
+ err = unpopulate(val, "BillingProfile", &v.BillingProfile)
+ delete(rawMsg, key)
+ case "capacityReservation":
+ err = unpopulate(val, "CapacityReservation", &v.CapacityReservation)
+ delete(rawMsg, key)
+ case "diagnosticsProfile":
+ err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile)
+ delete(rawMsg, key)
+ case "evictionPolicy":
+ err = unpopulate(val, "EvictionPolicy", &v.EvictionPolicy)
+ delete(rawMsg, key)
+ case "extensionsTimeBudget":
+ err = unpopulate(val, "ExtensionsTimeBudget", &v.ExtensionsTimeBudget)
+ delete(rawMsg, key)
+ case "hardwareProfile":
+ err = unpopulate(val, "HardwareProfile", &v.HardwareProfile)
+ delete(rawMsg, key)
+ case "host":
+ err = unpopulate(val, "Host", &v.Host)
+ delete(rawMsg, key)
+ case "hostGroup":
+ err = unpopulate(val, "HostGroup", &v.HostGroup)
+ delete(rawMsg, key)
+ case "instanceView":
+ err = unpopulate(val, "InstanceView", &v.InstanceView)
+ delete(rawMsg, key)
+ case "licenseType":
+ err = unpopulate(val, "LicenseType", &v.LicenseType)
+ delete(rawMsg, key)
+ case "networkProfile":
+ err = unpopulate(val, "NetworkProfile", &v.NetworkProfile)
+ delete(rawMsg, key)
+ case "osProfile":
+ err = unpopulate(val, "OSProfile", &v.OSProfile)
+ delete(rawMsg, key)
+ case "platformFaultDomain":
+ err = unpopulate(val, "PlatformFaultDomain", &v.PlatformFaultDomain)
+ delete(rawMsg, key)
+ case "priority":
+ err = unpopulate(val, "Priority", &v.Priority)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &v.ProvisioningState)
+ delete(rawMsg, key)
+ case "proximityPlacementGroup":
+ err = unpopulate(val, "ProximityPlacementGroup", &v.ProximityPlacementGroup)
+ delete(rawMsg, key)
+ case "scheduledEventsProfile":
+ err = unpopulate(val, "ScheduledEventsProfile", &v.ScheduledEventsProfile)
+ delete(rawMsg, key)
+ case "securityProfile":
+ err = unpopulate(val, "SecurityProfile", &v.SecurityProfile)
+ delete(rawMsg, key)
+ case "storageProfile":
+ err = unpopulate(val, "StorageProfile", &v.StorageProfile)
+ delete(rawMsg, key)
+ case "timeCreated":
+ err = unpopulateDateTimeRFC3339(val, "TimeCreated", &v.TimeCreated)
+ delete(rawMsg, key)
+ case "userData":
+ err = unpopulate(val, "UserData", &v.UserData)
+ delete(rawMsg, key)
+ case "vmId":
+ err = unpopulate(val, "VMID", &v.VMID)
+ delete(rawMsg, key)
+ case "virtualMachineScaleSet":
+ err = unpopulate(val, "VirtualMachineScaleSet", &v.VirtualMachineScaleSet)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressConfiguration.
+func (v VirtualMachinePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "sku", v.SKU)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressConfiguration.
+func (v *VirtualMachinePublicIPAddressConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &v.SKU)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressConfigurationProperties.
+func (v VirtualMachinePublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dnsSettings", v.DNSSettings)
+ populate(objectMap, "deleteOption", v.DeleteOption)
+ populate(objectMap, "ipTags", v.IPTags)
+ populate(objectMap, "idleTimeoutInMinutes", v.IdleTimeoutInMinutes)
+ populate(objectMap, "publicIPAddressVersion", v.PublicIPAddressVersion)
+ populate(objectMap, "publicIPAllocationMethod", v.PublicIPAllocationMethod)
+ populate(objectMap, "publicIPPrefix", v.PublicIPPrefix)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressConfigurationProperties.
+func (v *VirtualMachinePublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dnsSettings":
+ err = unpopulate(val, "DNSSettings", &v.DNSSettings)
+ delete(rawMsg, key)
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &v.DeleteOption)
+ delete(rawMsg, key)
+ case "ipTags":
+ err = unpopulate(val, "IPTags", &v.IPTags)
+ delete(rawMsg, key)
+ case "idleTimeoutInMinutes":
+ err = unpopulate(val, "IdleTimeoutInMinutes", &v.IdleTimeoutInMinutes)
+ delete(rawMsg, key)
+ case "publicIPAddressVersion":
+ err = unpopulate(val, "PublicIPAddressVersion", &v.PublicIPAddressVersion)
+ delete(rawMsg, key)
+ case "publicIPAllocationMethod":
+ err = unpopulate(val, "PublicIPAllocationMethod", &v.PublicIPAllocationMethod)
+ delete(rawMsg, key)
+ case "publicIPPrefix":
+ err = unpopulate(val, "PublicIPPrefix", &v.PublicIPPrefix)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachinePublicIPAddressDNSSettingsConfiguration.
+func (v VirtualMachinePublicIPAddressDNSSettingsConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "domainNameLabel", v.DomainNameLabel)
+ populate(objectMap, "domainNameLabelScope", v.DomainNameLabelScope)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinePublicIPAddressDNSSettingsConfiguration.
+func (v *VirtualMachinePublicIPAddressDNSSettingsConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "domainNameLabel":
+ err = unpopulate(val, "DomainNameLabel", &v.DomainNameLabel)
+ delete(rawMsg, key)
+ case "domainNameLabelScope":
+ err = unpopulate(val, "DomainNameLabelScope", &v.DomainNameLabelScope)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineReimageParameters.
+func (v VirtualMachineReimageParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "exactVersion", v.ExactVersion)
+ populate(objectMap, "osProfile", v.OSProfile)
+ populate(objectMap, "tempDisk", v.TempDisk)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineReimageParameters.
+func (v *VirtualMachineReimageParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "exactVersion":
+ err = unpopulate(val, "ExactVersion", &v.ExactVersion)
+ delete(rawMsg, key)
+ case "osProfile":
+ err = unpopulate(val, "OSProfile", &v.OSProfile)
+ delete(rawMsg, key)
+ case "tempDisk":
+ err = unpopulate(val, "TempDisk", &v.TempDisk)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommand.
+func (v VirtualMachineRunCommand) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "location", v.Location)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "tags", v.Tags)
+ populate(objectMap, "type", v.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommand.
+func (v *VirtualMachineRunCommand) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &v.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandInstanceView.
+func (v VirtualMachineRunCommandInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "endTime", v.EndTime)
+ populate(objectMap, "error", v.Error)
+ populate(objectMap, "executionMessage", v.ExecutionMessage)
+ populate(objectMap, "executionState", v.ExecutionState)
+ populate(objectMap, "exitCode", v.ExitCode)
+ populate(objectMap, "output", v.Output)
+ populateDateTimeRFC3339(objectMap, "startTime", v.StartTime)
+ populate(objectMap, "statuses", v.Statuses)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandInstanceView.
+func (v *VirtualMachineRunCommandInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endTime":
+ err = unpopulateDateTimeRFC3339(val, "EndTime", &v.EndTime)
+ delete(rawMsg, key)
+ case "error":
+ err = unpopulate(val, "Error", &v.Error)
+ delete(rawMsg, key)
+ case "executionMessage":
+ err = unpopulate(val, "ExecutionMessage", &v.ExecutionMessage)
+ delete(rawMsg, key)
+ case "executionState":
+ err = unpopulate(val, "ExecutionState", &v.ExecutionState)
+ delete(rawMsg, key)
+ case "exitCode":
+ err = unpopulate(val, "ExitCode", &v.ExitCode)
+ delete(rawMsg, key)
+ case "output":
+ err = unpopulate(val, "Output", &v.Output)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulateDateTimeRFC3339(val, "StartTime", &v.StartTime)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &v.Statuses)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandProperties.
+func (v VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "asyncExecution", v.AsyncExecution)
+ populate(objectMap, "errorBlobManagedIdentity", v.ErrorBlobManagedIdentity)
+ populate(objectMap, "errorBlobUri", v.ErrorBlobURI)
+ populate(objectMap, "instanceView", v.InstanceView)
+ populate(objectMap, "outputBlobManagedIdentity", v.OutputBlobManagedIdentity)
+ populate(objectMap, "outputBlobUri", v.OutputBlobURI)
+ populate(objectMap, "parameters", v.Parameters)
+ populate(objectMap, "protectedParameters", v.ProtectedParameters)
+ populate(objectMap, "provisioningState", v.ProvisioningState)
+ populate(objectMap, "runAsPassword", v.RunAsPassword)
+ populate(objectMap, "runAsUser", v.RunAsUser)
+ populate(objectMap, "source", v.Source)
+ populate(objectMap, "timeoutInSeconds", v.TimeoutInSeconds)
+ populate(objectMap, "treatFailureAsDeploymentFailure", v.TreatFailureAsDeploymentFailure)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandProperties.
+func (v *VirtualMachineRunCommandProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "asyncExecution":
+ err = unpopulate(val, "AsyncExecution", &v.AsyncExecution)
+ delete(rawMsg, key)
+ case "errorBlobManagedIdentity":
+ err = unpopulate(val, "ErrorBlobManagedIdentity", &v.ErrorBlobManagedIdentity)
+ delete(rawMsg, key)
+ case "errorBlobUri":
+ err = unpopulate(val, "ErrorBlobURI", &v.ErrorBlobURI)
+ delete(rawMsg, key)
+ case "instanceView":
+ err = unpopulate(val, "InstanceView", &v.InstanceView)
+ delete(rawMsg, key)
+ case "outputBlobManagedIdentity":
+ err = unpopulate(val, "OutputBlobManagedIdentity", &v.OutputBlobManagedIdentity)
+ delete(rawMsg, key)
+ case "outputBlobUri":
+ err = unpopulate(val, "OutputBlobURI", &v.OutputBlobURI)
+ delete(rawMsg, key)
+ case "parameters":
+ err = unpopulate(val, "Parameters", &v.Parameters)
+ delete(rawMsg, key)
+ case "protectedParameters":
+ err = unpopulate(val, "ProtectedParameters", &v.ProtectedParameters)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &v.ProvisioningState)
+ delete(rawMsg, key)
+ case "runAsPassword":
+ err = unpopulate(val, "RunAsPassword", &v.RunAsPassword)
+ delete(rawMsg, key)
+ case "runAsUser":
+ err = unpopulate(val, "RunAsUser", &v.RunAsUser)
+ delete(rawMsg, key)
+ case "source":
+ err = unpopulate(val, "Source", &v.Source)
+ delete(rawMsg, key)
+ case "timeoutInSeconds":
+ err = unpopulate(val, "TimeoutInSeconds", &v.TimeoutInSeconds)
+ delete(rawMsg, key)
+ case "treatFailureAsDeploymentFailure":
+ err = unpopulate(val, "TreatFailureAsDeploymentFailure", &v.TreatFailureAsDeploymentFailure)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandScriptSource.
+func (v VirtualMachineRunCommandScriptSource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "commandId", v.CommandID)
+ populate(objectMap, "script", v.Script)
+ populate(objectMap, "scriptUri", v.ScriptURI)
+ populate(objectMap, "scriptUriManagedIdentity", v.ScriptURIManagedIdentity)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandScriptSource.
+func (v *VirtualMachineRunCommandScriptSource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "commandId":
+ err = unpopulate(val, "CommandID", &v.CommandID)
+ delete(rawMsg, key)
+ case "script":
+ err = unpopulate(val, "Script", &v.Script)
+ delete(rawMsg, key)
+ case "scriptUri":
+ err = unpopulate(val, "ScriptURI", &v.ScriptURI)
+ delete(rawMsg, key)
+ case "scriptUriManagedIdentity":
+ err = unpopulate(val, "ScriptURIManagedIdentity", &v.ScriptURIManagedIdentity)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandUpdate.
+func (v VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "tags", v.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandUpdate.
+func (v *VirtualMachineRunCommandUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineRunCommandsListResult.
+func (v VirtualMachineRunCommandsListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", v.NextLink)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineRunCommandsListResult.
+func (v *VirtualMachineRunCommandsListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &v.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSet.
+func (v VirtualMachineScaleSet) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", v.ExtendedLocation)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "identity", v.Identity)
+ populate(objectMap, "location", v.Location)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "plan", v.Plan)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "sku", v.SKU)
+ populate(objectMap, "tags", v.Tags)
+ populate(objectMap, "type", v.Type)
+ populate(objectMap, "zones", v.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSet.
+func (v *VirtualMachineScaleSet) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &v.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &v.Identity)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &v.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "plan":
+ err = unpopulate(val, "Plan", &v.Plan)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &v.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &v.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetDataDisk.
+func (v VirtualMachineScaleSetDataDisk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "caching", v.Caching)
+ populate(objectMap, "createOption", v.CreateOption)
+ populate(objectMap, "deleteOption", v.DeleteOption)
+ populate(objectMap, "diskIOPSReadWrite", v.DiskIOPSReadWrite)
+ populate(objectMap, "diskMBpsReadWrite", v.DiskMBpsReadWrite)
+ populate(objectMap, "diskSizeGB", v.DiskSizeGB)
+ populate(objectMap, "lun", v.Lun)
+ populate(objectMap, "managedDisk", v.ManagedDisk)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "writeAcceleratorEnabled", v.WriteAcceleratorEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetDataDisk.
+func (v *VirtualMachineScaleSetDataDisk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "caching":
+ err = unpopulate(val, "Caching", &v.Caching)
+ delete(rawMsg, key)
+ case "createOption":
+ err = unpopulate(val, "CreateOption", &v.CreateOption)
+ delete(rawMsg, key)
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &v.DeleteOption)
+ delete(rawMsg, key)
+ case "diskIOPSReadWrite":
+ err = unpopulate(val, "DiskIOPSReadWrite", &v.DiskIOPSReadWrite)
+ delete(rawMsg, key)
+ case "diskMBpsReadWrite":
+ err = unpopulate(val, "DiskMBpsReadWrite", &v.DiskMBpsReadWrite)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &v.DiskSizeGB)
+ delete(rawMsg, key)
+ case "lun":
+ err = unpopulate(val, "Lun", &v.Lun)
+ delete(rawMsg, key)
+ case "managedDisk":
+ err = unpopulate(val, "ManagedDisk", &v.ManagedDisk)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "writeAcceleratorEnabled":
+ err = unpopulate(val, "WriteAcceleratorEnabled", &v.WriteAcceleratorEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtension.
+func (v VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "type", v.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtension.
+func (v *VirtualMachineScaleSetExtension) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionListResult.
+func (v VirtualMachineScaleSetExtensionListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", v.NextLink)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionListResult.
+func (v *VirtualMachineScaleSetExtensionListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &v.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionProfile.
+func (v VirtualMachineScaleSetExtensionProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extensions", v.Extensions)
+ populate(objectMap, "extensionsTimeBudget", v.ExtensionsTimeBudget)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionProfile.
+func (v *VirtualMachineScaleSetExtensionProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extensions":
+ err = unpopulate(val, "Extensions", &v.Extensions)
+ delete(rawMsg, key)
+ case "extensionsTimeBudget":
+ err = unpopulate(val, "ExtensionsTimeBudget", &v.ExtensionsTimeBudget)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionProperties.
+func (v VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion)
+ populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade)
+ populate(objectMap, "forceUpdateTag", v.ForceUpdateTag)
+ populateAny(objectMap, "protectedSettings", v.ProtectedSettings)
+ populate(objectMap, "protectedSettingsFromKeyVault", v.ProtectedSettingsFromKeyVault)
+ populate(objectMap, "provisionAfterExtensions", v.ProvisionAfterExtensions)
+ populate(objectMap, "provisioningState", v.ProvisioningState)
+ populate(objectMap, "publisher", v.Publisher)
+ populateAny(objectMap, "settings", v.Settings)
+ populate(objectMap, "suppressFailures", v.SuppressFailures)
+ populate(objectMap, "type", v.Type)
+ populate(objectMap, "typeHandlerVersion", v.TypeHandlerVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionProperties.
+func (v *VirtualMachineScaleSetExtensionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "autoUpgradeMinorVersion":
+ err = unpopulate(val, "AutoUpgradeMinorVersion", &v.AutoUpgradeMinorVersion)
+ delete(rawMsg, key)
+ case "enableAutomaticUpgrade":
+ err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade)
+ delete(rawMsg, key)
+ case "forceUpdateTag":
+ err = unpopulate(val, "ForceUpdateTag", &v.ForceUpdateTag)
+ delete(rawMsg, key)
+ case "protectedSettings":
+ err = unpopulate(val, "ProtectedSettings", &v.ProtectedSettings)
+ delete(rawMsg, key)
+ case "protectedSettingsFromKeyVault":
+ err = unpopulate(val, "ProtectedSettingsFromKeyVault", &v.ProtectedSettingsFromKeyVault)
+ delete(rawMsg, key)
+ case "provisionAfterExtensions":
+ err = unpopulate(val, "ProvisionAfterExtensions", &v.ProvisionAfterExtensions)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &v.ProvisioningState)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &v.Publisher)
+ delete(rawMsg, key)
+ case "settings":
+ err = unpopulate(val, "Settings", &v.Settings)
+ delete(rawMsg, key)
+ case "suppressFailures":
+ err = unpopulate(val, "SuppressFailures", &v.SuppressFailures)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ case "typeHandlerVersion":
+ err = unpopulate(val, "TypeHandlerVersion", &v.TypeHandlerVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetExtensionUpdate.
+func (v VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "type", v.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetExtensionUpdate.
+func (v *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetHardwareProfile.
+func (v VirtualMachineScaleSetHardwareProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "vmSizeProperties", v.VMSizeProperties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetHardwareProfile.
+func (v *VirtualMachineScaleSetHardwareProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "vmSizeProperties":
+ err = unpopulate(val, "VMSizeProperties", &v.VMSizeProperties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPConfiguration.
+func (v VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPConfiguration.
+func (v *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPConfigurationProperties.
+func (v VirtualMachineScaleSetIPConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools)
+ populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups)
+ populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools)
+ populate(objectMap, "loadBalancerInboundNatPools", v.LoadBalancerInboundNatPools)
+ populate(objectMap, "primary", v.Primary)
+ populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion)
+ populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration)
+ populate(objectMap, "subnet", v.Subnet)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPConfigurationProperties.
+func (v *VirtualMachineScaleSetIPConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "applicationGatewayBackendAddressPools":
+ err = unpopulate(val, "ApplicationGatewayBackendAddressPools", &v.ApplicationGatewayBackendAddressPools)
+ delete(rawMsg, key)
+ case "applicationSecurityGroups":
+ err = unpopulate(val, "ApplicationSecurityGroups", &v.ApplicationSecurityGroups)
+ delete(rawMsg, key)
+ case "loadBalancerBackendAddressPools":
+ err = unpopulate(val, "LoadBalancerBackendAddressPools", &v.LoadBalancerBackendAddressPools)
+ delete(rawMsg, key)
+ case "loadBalancerInboundNatPools":
+ err = unpopulate(val, "LoadBalancerInboundNatPools", &v.LoadBalancerInboundNatPools)
+ delete(rawMsg, key)
+ case "primary":
+ err = unpopulate(val, "Primary", &v.Primary)
+ delete(rawMsg, key)
+ case "privateIPAddressVersion":
+ err = unpopulate(val, "PrivateIPAddressVersion", &v.PrivateIPAddressVersion)
+ delete(rawMsg, key)
+ case "publicIPAddressConfiguration":
+ err = unpopulate(val, "PublicIPAddressConfiguration", &v.PublicIPAddressConfiguration)
+ delete(rawMsg, key)
+ case "subnet":
+ err = unpopulate(val, "Subnet", &v.Subnet)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIPTag.
+func (v VirtualMachineScaleSetIPTag) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "ipTagType", v.IPTagType)
+ populate(objectMap, "tag", v.Tag)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIPTag.
+func (v *VirtualMachineScaleSetIPTag) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "ipTagType":
+ err = unpopulate(val, "IPTagType", &v.IPTagType)
+ delete(rawMsg, key)
+ case "tag":
+ err = unpopulate(val, "Tag", &v.Tag)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetIdentity.
+func (v VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "principalId", v.PrincipalID)
+ populate(objectMap, "tenantId", v.TenantID)
+ populate(objectMap, "type", v.Type)
+ populate(objectMap, "userAssignedIdentities", v.UserAssignedIdentities)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetIdentity.
+func (v *VirtualMachineScaleSetIdentity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &v.PrincipalID)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &v.TenantID)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ case "userAssignedIdentities":
+ err = unpopulate(val, "UserAssignedIdentities", &v.UserAssignedIdentities)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetInstanceView.
+func (v VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extensions", v.Extensions)
+ populate(objectMap, "orchestrationServices", v.OrchestrationServices)
+ populate(objectMap, "statuses", v.Statuses)
+ populate(objectMap, "virtualMachine", v.VirtualMachine)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetInstanceView.
+func (v *VirtualMachineScaleSetInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extensions":
+ err = unpopulate(val, "Extensions", &v.Extensions)
+ delete(rawMsg, key)
+ case "orchestrationServices":
+ err = unpopulate(val, "OrchestrationServices", &v.OrchestrationServices)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &v.Statuses)
+ delete(rawMsg, key)
+ case "virtualMachine":
+ err = unpopulate(val, "VirtualMachine", &v.VirtualMachine)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetInstanceViewStatusesSummary.
+func (v VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "statusesSummary", v.StatusesSummary)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetInstanceViewStatusesSummary.
+func (v *VirtualMachineScaleSetInstanceViewStatusesSummary) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "statusesSummary":
+ err = unpopulate(val, "StatusesSummary", &v.StatusesSummary)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListOSUpgradeHistory.
+func (v VirtualMachineScaleSetListOSUpgradeHistory) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", v.NextLink)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListOSUpgradeHistory.
+func (v *VirtualMachineScaleSetListOSUpgradeHistory) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &v.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListResult.
+func (v VirtualMachineScaleSetListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", v.NextLink)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListResult.
+func (v *VirtualMachineScaleSetListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &v.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListSKUsResult.
+func (v VirtualMachineScaleSetListSKUsResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", v.NextLink)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListSKUsResult.
+func (v *VirtualMachineScaleSetListSKUsResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &v.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetListWithLinkResult.
+func (v VirtualMachineScaleSetListWithLinkResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", v.NextLink)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetListWithLinkResult.
+func (v *VirtualMachineScaleSetListWithLinkResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &v.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetManagedDiskParameters.
+func (v VirtualMachineScaleSetManagedDiskParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "diskEncryptionSet", v.DiskEncryptionSet)
+ populate(objectMap, "securityProfile", v.SecurityProfile)
+ populate(objectMap, "storageAccountType", v.StorageAccountType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetManagedDiskParameters.
+func (v *VirtualMachineScaleSetManagedDiskParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "diskEncryptionSet":
+ err = unpopulate(val, "DiskEncryptionSet", &v.DiskEncryptionSet)
+ delete(rawMsg, key)
+ case "securityProfile":
+ err = unpopulate(val, "SecurityProfile", &v.SecurityProfile)
+ delete(rawMsg, key)
+ case "storageAccountType":
+ err = unpopulate(val, "StorageAccountType", &v.StorageAccountType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfiguration.
+func (v VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfiguration.
+func (v *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfigurationDNSSettings.
+func (v VirtualMachineScaleSetNetworkConfigurationDNSSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dnsServers", v.DNSServers)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfigurationDNSSettings.
+func (v *VirtualMachineScaleSetNetworkConfigurationDNSSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dnsServers":
+ err = unpopulate(val, "DNSServers", &v.DNSServers)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkConfigurationProperties.
+func (v VirtualMachineScaleSetNetworkConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "auxiliaryMode", v.AuxiliaryMode)
+ populate(objectMap, "auxiliarySku", v.AuxiliarySKU)
+ populate(objectMap, "dnsSettings", v.DNSSettings)
+ populate(objectMap, "deleteOption", v.DeleteOption)
+ populate(objectMap, "disableTcpStateTracking", v.DisableTCPStateTracking)
+ populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking)
+ populate(objectMap, "enableFpga", v.EnableFpga)
+ populate(objectMap, "enableIPForwarding", v.EnableIPForwarding)
+ populate(objectMap, "ipConfigurations", v.IPConfigurations)
+ populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup)
+ populate(objectMap, "primary", v.Primary)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkConfigurationProperties.
+func (v *VirtualMachineScaleSetNetworkConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "auxiliaryMode":
+ err = unpopulate(val, "AuxiliaryMode", &v.AuxiliaryMode)
+ delete(rawMsg, key)
+ case "auxiliarySku":
+ err = unpopulate(val, "AuxiliarySKU", &v.AuxiliarySKU)
+ delete(rawMsg, key)
+ case "dnsSettings":
+ err = unpopulate(val, "DNSSettings", &v.DNSSettings)
+ delete(rawMsg, key)
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &v.DeleteOption)
+ delete(rawMsg, key)
+ case "disableTcpStateTracking":
+ err = unpopulate(val, "DisableTCPStateTracking", &v.DisableTCPStateTracking)
+ delete(rawMsg, key)
+ case "enableAcceleratedNetworking":
+ err = unpopulate(val, "EnableAcceleratedNetworking", &v.EnableAcceleratedNetworking)
+ delete(rawMsg, key)
+ case "enableFpga":
+ err = unpopulate(val, "EnableFpga", &v.EnableFpga)
+ delete(rawMsg, key)
+ case "enableIPForwarding":
+ err = unpopulate(val, "EnableIPForwarding", &v.EnableIPForwarding)
+ delete(rawMsg, key)
+ case "ipConfigurations":
+ err = unpopulate(val, "IPConfigurations", &v.IPConfigurations)
+ delete(rawMsg, key)
+ case "networkSecurityGroup":
+ err = unpopulate(val, "NetworkSecurityGroup", &v.NetworkSecurityGroup)
+ delete(rawMsg, key)
+ case "primary":
+ err = unpopulate(val, "Primary", &v.Primary)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetNetworkProfile.
+func (v VirtualMachineScaleSetNetworkProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "healthProbe", v.HealthProbe)
+ populate(objectMap, "networkApiVersion", v.NetworkAPIVersion)
+ populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetNetworkProfile.
+func (v *VirtualMachineScaleSetNetworkProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "healthProbe":
+ err = unpopulate(val, "HealthProbe", &v.HealthProbe)
+ delete(rawMsg, key)
+ case "networkApiVersion":
+ err = unpopulate(val, "NetworkAPIVersion", &v.NetworkAPIVersion)
+ delete(rawMsg, key)
+ case "networkInterfaceConfigurations":
+ err = unpopulate(val, "NetworkInterfaceConfigurations", &v.NetworkInterfaceConfigurations)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetOSDisk.
+func (v VirtualMachineScaleSetOSDisk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "caching", v.Caching)
+ populate(objectMap, "createOption", v.CreateOption)
+ populate(objectMap, "deleteOption", v.DeleteOption)
+ populate(objectMap, "diffDiskSettings", v.DiffDiskSettings)
+ populate(objectMap, "diskSizeGB", v.DiskSizeGB)
+ populate(objectMap, "image", v.Image)
+ populate(objectMap, "managedDisk", v.ManagedDisk)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "osType", v.OSType)
+ populate(objectMap, "vhdContainers", v.VhdContainers)
+ populate(objectMap, "writeAcceleratorEnabled", v.WriteAcceleratorEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetOSDisk.
+func (v *VirtualMachineScaleSetOSDisk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "caching":
+ err = unpopulate(val, "Caching", &v.Caching)
+ delete(rawMsg, key)
+ case "createOption":
+ err = unpopulate(val, "CreateOption", &v.CreateOption)
+ delete(rawMsg, key)
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &v.DeleteOption)
+ delete(rawMsg, key)
+ case "diffDiskSettings":
+ err = unpopulate(val, "DiffDiskSettings", &v.DiffDiskSettings)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &v.DiskSizeGB)
+ delete(rawMsg, key)
+ case "image":
+ err = unpopulate(val, "Image", &v.Image)
+ delete(rawMsg, key)
+ case "managedDisk":
+ err = unpopulate(val, "ManagedDisk", &v.ManagedDisk)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "osType":
+ err = unpopulate(val, "OSType", &v.OSType)
+ delete(rawMsg, key)
+ case "vhdContainers":
+ err = unpopulate(val, "VhdContainers", &v.VhdContainers)
+ delete(rawMsg, key)
+ case "writeAcceleratorEnabled":
+ err = unpopulate(val, "WriteAcceleratorEnabled", &v.WriteAcceleratorEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetOSProfile.
+func (v VirtualMachineScaleSetOSProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "adminPassword", v.AdminPassword)
+ populate(objectMap, "adminUsername", v.AdminUsername)
+ populate(objectMap, "allowExtensionOperations", v.AllowExtensionOperations)
+ populate(objectMap, "computerNamePrefix", v.ComputerNamePrefix)
+ populate(objectMap, "customData", v.CustomData)
+ populate(objectMap, "linuxConfiguration", v.LinuxConfiguration)
+ populate(objectMap, "requireGuestProvisionSignal", v.RequireGuestProvisionSignal)
+ populate(objectMap, "secrets", v.Secrets)
+ populate(objectMap, "windowsConfiguration", v.WindowsConfiguration)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetOSProfile.
+func (v *VirtualMachineScaleSetOSProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "adminPassword":
+ err = unpopulate(val, "AdminPassword", &v.AdminPassword)
+ delete(rawMsg, key)
+ case "adminUsername":
+ err = unpopulate(val, "AdminUsername", &v.AdminUsername)
+ delete(rawMsg, key)
+ case "allowExtensionOperations":
+ err = unpopulate(val, "AllowExtensionOperations", &v.AllowExtensionOperations)
+ delete(rawMsg, key)
+ case "computerNamePrefix":
+ err = unpopulate(val, "ComputerNamePrefix", &v.ComputerNamePrefix)
+ delete(rawMsg, key)
+ case "customData":
+ err = unpopulate(val, "CustomData", &v.CustomData)
+ delete(rawMsg, key)
+ case "linuxConfiguration":
+ err = unpopulate(val, "LinuxConfiguration", &v.LinuxConfiguration)
+ delete(rawMsg, key)
+ case "requireGuestProvisionSignal":
+ err = unpopulate(val, "RequireGuestProvisionSignal", &v.RequireGuestProvisionSignal)
+ delete(rawMsg, key)
+ case "secrets":
+ err = unpopulate(val, "Secrets", &v.Secrets)
+ delete(rawMsg, key)
+ case "windowsConfiguration":
+ err = unpopulate(val, "WindowsConfiguration", &v.WindowsConfiguration)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetProperties.
+func (v VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities)
+ populate(objectMap, "automaticRepairsPolicy", v.AutomaticRepairsPolicy)
+ populate(objectMap, "constrainedMaximumCapacity", v.ConstrainedMaximumCapacity)
+ populate(objectMap, "doNotRunExtensionsOnOverprovisionedVMs", v.DoNotRunExtensionsOnOverprovisionedVMs)
+ populate(objectMap, "hostGroup", v.HostGroup)
+ populate(objectMap, "orchestrationMode", v.OrchestrationMode)
+ populate(objectMap, "overprovision", v.Overprovision)
+ populate(objectMap, "platformFaultDomainCount", v.PlatformFaultDomainCount)
+ populate(objectMap, "priorityMixPolicy", v.PriorityMixPolicy)
+ populate(objectMap, "provisioningState", v.ProvisioningState)
+ populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup)
+ populate(objectMap, "scaleInPolicy", v.ScaleInPolicy)
+ populate(objectMap, "singlePlacementGroup", v.SinglePlacementGroup)
+ populate(objectMap, "spotRestorePolicy", v.SpotRestorePolicy)
+ populateDateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated)
+ populate(objectMap, "uniqueId", v.UniqueID)
+ populate(objectMap, "upgradePolicy", v.UpgradePolicy)
+ populate(objectMap, "virtualMachineProfile", v.VirtualMachineProfile)
+ populate(objectMap, "zoneBalance", v.ZoneBalance)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetProperties.
+func (v *VirtualMachineScaleSetProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "additionalCapabilities":
+ err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities)
+ delete(rawMsg, key)
+ case "automaticRepairsPolicy":
+ err = unpopulate(val, "AutomaticRepairsPolicy", &v.AutomaticRepairsPolicy)
+ delete(rawMsg, key)
+ case "constrainedMaximumCapacity":
+ err = unpopulate(val, "ConstrainedMaximumCapacity", &v.ConstrainedMaximumCapacity)
+ delete(rawMsg, key)
+ case "doNotRunExtensionsOnOverprovisionedVMs":
+ err = unpopulate(val, "DoNotRunExtensionsOnOverprovisionedVMs", &v.DoNotRunExtensionsOnOverprovisionedVMs)
+ delete(rawMsg, key)
+ case "hostGroup":
+ err = unpopulate(val, "HostGroup", &v.HostGroup)
+ delete(rawMsg, key)
+ case "orchestrationMode":
+ err = unpopulate(val, "OrchestrationMode", &v.OrchestrationMode)
+ delete(rawMsg, key)
+ case "overprovision":
+ err = unpopulate(val, "Overprovision", &v.Overprovision)
+ delete(rawMsg, key)
+ case "platformFaultDomainCount":
+ err = unpopulate(val, "PlatformFaultDomainCount", &v.PlatformFaultDomainCount)
+ delete(rawMsg, key)
+ case "priorityMixPolicy":
+ err = unpopulate(val, "PriorityMixPolicy", &v.PriorityMixPolicy)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &v.ProvisioningState)
+ delete(rawMsg, key)
+ case "proximityPlacementGroup":
+ err = unpopulate(val, "ProximityPlacementGroup", &v.ProximityPlacementGroup)
+ delete(rawMsg, key)
+ case "scaleInPolicy":
+ err = unpopulate(val, "ScaleInPolicy", &v.ScaleInPolicy)
+ delete(rawMsg, key)
+ case "singlePlacementGroup":
+ err = unpopulate(val, "SinglePlacementGroup", &v.SinglePlacementGroup)
+ delete(rawMsg, key)
+ case "spotRestorePolicy":
+ err = unpopulate(val, "SpotRestorePolicy", &v.SpotRestorePolicy)
+ delete(rawMsg, key)
+ case "timeCreated":
+ err = unpopulateDateTimeRFC3339(val, "TimeCreated", &v.TimeCreated)
+ delete(rawMsg, key)
+ case "uniqueId":
+ err = unpopulate(val, "UniqueID", &v.UniqueID)
+ delete(rawMsg, key)
+ case "upgradePolicy":
+ err = unpopulate(val, "UpgradePolicy", &v.UpgradePolicy)
+ delete(rawMsg, key)
+ case "virtualMachineProfile":
+ err = unpopulate(val, "VirtualMachineProfile", &v.VirtualMachineProfile)
+ delete(rawMsg, key)
+ case "zoneBalance":
+ err = unpopulate(val, "ZoneBalance", &v.ZoneBalance)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfiguration.
+func (v VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "sku", v.SKU)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfiguration.
+func (v *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &v.SKU)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings.
+func (v VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "domainNameLabel", v.DomainNameLabel)
+ populate(objectMap, "domainNameLabelScope", v.DomainNameLabelScope)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings.
+func (v *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "domainNameLabel":
+ err = unpopulate(val, "DomainNameLabel", &v.DomainNameLabel)
+ delete(rawMsg, key)
+ case "domainNameLabelScope":
+ err = unpopulate(val, "DomainNameLabelScope", &v.DomainNameLabelScope)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationProperties.
+func (v VirtualMachineScaleSetPublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dnsSettings", v.DNSSettings)
+ populate(objectMap, "deleteOption", v.DeleteOption)
+ populate(objectMap, "ipTags", v.IPTags)
+ populate(objectMap, "idleTimeoutInMinutes", v.IdleTimeoutInMinutes)
+ populate(objectMap, "publicIPAddressVersion", v.PublicIPAddressVersion)
+ populate(objectMap, "publicIPPrefix", v.PublicIPPrefix)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetPublicIPAddressConfigurationProperties.
+func (v *VirtualMachineScaleSetPublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dnsSettings":
+ err = unpopulate(val, "DNSSettings", &v.DNSSettings)
+ delete(rawMsg, key)
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &v.DeleteOption)
+ delete(rawMsg, key)
+ case "ipTags":
+ err = unpopulate(val, "IPTags", &v.IPTags)
+ delete(rawMsg, key)
+ case "idleTimeoutInMinutes":
+ err = unpopulate(val, "IdleTimeoutInMinutes", &v.IdleTimeoutInMinutes)
+ delete(rawMsg, key)
+ case "publicIPAddressVersion":
+ err = unpopulate(val, "PublicIPAddressVersion", &v.PublicIPAddressVersion)
+ delete(rawMsg, key)
+ case "publicIPPrefix":
+ err = unpopulate(val, "PublicIPPrefix", &v.PublicIPPrefix)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetReimageParameters.
+func (v VirtualMachineScaleSetReimageParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "exactVersion", v.ExactVersion)
+ populate(objectMap, "instanceIds", v.InstanceIDs)
+ populate(objectMap, "osProfile", v.OSProfile)
+ populate(objectMap, "tempDisk", v.TempDisk)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetReimageParameters.
+func (v *VirtualMachineScaleSetReimageParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "exactVersion":
+ err = unpopulate(val, "ExactVersion", &v.ExactVersion)
+ delete(rawMsg, key)
+ case "instanceIds":
+ err = unpopulate(val, "InstanceIDs", &v.InstanceIDs)
+ delete(rawMsg, key)
+ case "osProfile":
+ err = unpopulate(val, "OSProfile", &v.OSProfile)
+ delete(rawMsg, key)
+ case "tempDisk":
+ err = unpopulate(val, "TempDisk", &v.TempDisk)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetSKU.
+func (v VirtualMachineScaleSetSKU) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capacity", v.Capacity)
+ populate(objectMap, "resourceType", v.ResourceType)
+ populate(objectMap, "sku", v.SKU)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetSKU.
+func (v *VirtualMachineScaleSetSKU) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capacity":
+ err = unpopulate(val, "Capacity", &v.Capacity)
+ delete(rawMsg, key)
+ case "resourceType":
+ err = unpopulate(val, "ResourceType", &v.ResourceType)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &v.SKU)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetSKUCapacity.
+func (v VirtualMachineScaleSetSKUCapacity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "defaultCapacity", v.DefaultCapacity)
+ populate(objectMap, "maximum", v.Maximum)
+ populate(objectMap, "minimum", v.Minimum)
+ populate(objectMap, "scaleType", v.ScaleType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetSKUCapacity.
+func (v *VirtualMachineScaleSetSKUCapacity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "defaultCapacity":
+ err = unpopulate(val, "DefaultCapacity", &v.DefaultCapacity)
+ delete(rawMsg, key)
+ case "maximum":
+ err = unpopulate(val, "Maximum", &v.Maximum)
+ delete(rawMsg, key)
+ case "minimum":
+ err = unpopulate(val, "Minimum", &v.Minimum)
+ delete(rawMsg, key)
+ case "scaleType":
+ err = unpopulate(val, "ScaleType", &v.ScaleType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetStorageProfile.
+func (v VirtualMachineScaleSetStorageProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dataDisks", v.DataDisks)
+ populate(objectMap, "diskControllerType", v.DiskControllerType)
+ populate(objectMap, "imageReference", v.ImageReference)
+ populate(objectMap, "osDisk", v.OSDisk)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetStorageProfile.
+func (v *VirtualMachineScaleSetStorageProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dataDisks":
+ err = unpopulate(val, "DataDisks", &v.DataDisks)
+ delete(rawMsg, key)
+ case "diskControllerType":
+ err = unpopulate(val, "DiskControllerType", &v.DiskControllerType)
+ delete(rawMsg, key)
+ case "imageReference":
+ err = unpopulate(val, "ImageReference", &v.ImageReference)
+ delete(rawMsg, key)
+ case "osDisk":
+ err = unpopulate(val, "OSDisk", &v.OSDisk)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdate.
+func (v VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identity", v.Identity)
+ populate(objectMap, "plan", v.Plan)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "sku", v.SKU)
+ populate(objectMap, "tags", v.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdate.
+func (v *VirtualMachineScaleSetUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identity":
+ err = unpopulate(val, "Identity", &v.Identity)
+ delete(rawMsg, key)
+ case "plan":
+ err = unpopulate(val, "Plan", &v.Plan)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &v.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateIPConfiguration.
+func (v VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateIPConfiguration.
+func (v *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateIPConfigurationProperties.
+func (v VirtualMachineScaleSetUpdateIPConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "applicationGatewayBackendAddressPools", v.ApplicationGatewayBackendAddressPools)
+ populate(objectMap, "applicationSecurityGroups", v.ApplicationSecurityGroups)
+ populate(objectMap, "loadBalancerBackendAddressPools", v.LoadBalancerBackendAddressPools)
+ populate(objectMap, "loadBalancerInboundNatPools", v.LoadBalancerInboundNatPools)
+ populate(objectMap, "primary", v.Primary)
+ populate(objectMap, "privateIPAddressVersion", v.PrivateIPAddressVersion)
+ populate(objectMap, "publicIPAddressConfiguration", v.PublicIPAddressConfiguration)
+ populate(objectMap, "subnet", v.Subnet)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateIPConfigurationProperties.
+func (v *VirtualMachineScaleSetUpdateIPConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "applicationGatewayBackendAddressPools":
+ err = unpopulate(val, "ApplicationGatewayBackendAddressPools", &v.ApplicationGatewayBackendAddressPools)
+ delete(rawMsg, key)
+ case "applicationSecurityGroups":
+ err = unpopulate(val, "ApplicationSecurityGroups", &v.ApplicationSecurityGroups)
+ delete(rawMsg, key)
+ case "loadBalancerBackendAddressPools":
+ err = unpopulate(val, "LoadBalancerBackendAddressPools", &v.LoadBalancerBackendAddressPools)
+ delete(rawMsg, key)
+ case "loadBalancerInboundNatPools":
+ err = unpopulate(val, "LoadBalancerInboundNatPools", &v.LoadBalancerInboundNatPools)
+ delete(rawMsg, key)
+ case "primary":
+ err = unpopulate(val, "Primary", &v.Primary)
+ delete(rawMsg, key)
+ case "privateIPAddressVersion":
+ err = unpopulate(val, "PrivateIPAddressVersion", &v.PrivateIPAddressVersion)
+ delete(rawMsg, key)
+ case "publicIPAddressConfiguration":
+ err = unpopulate(val, "PublicIPAddressConfiguration", &v.PublicIPAddressConfiguration)
+ delete(rawMsg, key)
+ case "subnet":
+ err = unpopulate(val, "Subnet", &v.Subnet)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkConfiguration.
+func (v VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkConfiguration.
+func (v *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkConfigurationProperties.
+func (v VirtualMachineScaleSetUpdateNetworkConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "auxiliaryMode", v.AuxiliaryMode)
+ populate(objectMap, "auxiliarySku", v.AuxiliarySKU)
+ populate(objectMap, "dnsSettings", v.DNSSettings)
+ populate(objectMap, "deleteOption", v.DeleteOption)
+ populate(objectMap, "disableTcpStateTracking", v.DisableTCPStateTracking)
+ populate(objectMap, "enableAcceleratedNetworking", v.EnableAcceleratedNetworking)
+ populate(objectMap, "enableFpga", v.EnableFpga)
+ populate(objectMap, "enableIPForwarding", v.EnableIPForwarding)
+ populate(objectMap, "ipConfigurations", v.IPConfigurations)
+ populate(objectMap, "networkSecurityGroup", v.NetworkSecurityGroup)
+ populate(objectMap, "primary", v.Primary)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkConfigurationProperties.
+func (v *VirtualMachineScaleSetUpdateNetworkConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "auxiliaryMode":
+ err = unpopulate(val, "AuxiliaryMode", &v.AuxiliaryMode)
+ delete(rawMsg, key)
+ case "auxiliarySku":
+ err = unpopulate(val, "AuxiliarySKU", &v.AuxiliarySKU)
+ delete(rawMsg, key)
+ case "dnsSettings":
+ err = unpopulate(val, "DNSSettings", &v.DNSSettings)
+ delete(rawMsg, key)
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &v.DeleteOption)
+ delete(rawMsg, key)
+ case "disableTcpStateTracking":
+ err = unpopulate(val, "DisableTCPStateTracking", &v.DisableTCPStateTracking)
+ delete(rawMsg, key)
+ case "enableAcceleratedNetworking":
+ err = unpopulate(val, "EnableAcceleratedNetworking", &v.EnableAcceleratedNetworking)
+ delete(rawMsg, key)
+ case "enableFpga":
+ err = unpopulate(val, "EnableFpga", &v.EnableFpga)
+ delete(rawMsg, key)
+ case "enableIPForwarding":
+ err = unpopulate(val, "EnableIPForwarding", &v.EnableIPForwarding)
+ delete(rawMsg, key)
+ case "ipConfigurations":
+ err = unpopulate(val, "IPConfigurations", &v.IPConfigurations)
+ delete(rawMsg, key)
+ case "networkSecurityGroup":
+ err = unpopulate(val, "NetworkSecurityGroup", &v.NetworkSecurityGroup)
+ delete(rawMsg, key)
+ case "primary":
+ err = unpopulate(val, "Primary", &v.Primary)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateNetworkProfile.
+func (v VirtualMachineScaleSetUpdateNetworkProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "healthProbe", v.HealthProbe)
+ populate(objectMap, "networkApiVersion", v.NetworkAPIVersion)
+ populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateNetworkProfile.
+func (v *VirtualMachineScaleSetUpdateNetworkProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "healthProbe":
+ err = unpopulate(val, "HealthProbe", &v.HealthProbe)
+ delete(rawMsg, key)
+ case "networkApiVersion":
+ err = unpopulate(val, "NetworkAPIVersion", &v.NetworkAPIVersion)
+ delete(rawMsg, key)
+ case "networkInterfaceConfigurations":
+ err = unpopulate(val, "NetworkInterfaceConfigurations", &v.NetworkInterfaceConfigurations)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateOSDisk.
+func (v VirtualMachineScaleSetUpdateOSDisk) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "caching", v.Caching)
+ populate(objectMap, "deleteOption", v.DeleteOption)
+ populate(objectMap, "diskSizeGB", v.DiskSizeGB)
+ populate(objectMap, "image", v.Image)
+ populate(objectMap, "managedDisk", v.ManagedDisk)
+ populate(objectMap, "vhdContainers", v.VhdContainers)
+ populate(objectMap, "writeAcceleratorEnabled", v.WriteAcceleratorEnabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateOSDisk.
+func (v *VirtualMachineScaleSetUpdateOSDisk) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "caching":
+ err = unpopulate(val, "Caching", &v.Caching)
+ delete(rawMsg, key)
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &v.DeleteOption)
+ delete(rawMsg, key)
+ case "diskSizeGB":
+ err = unpopulate(val, "DiskSizeGB", &v.DiskSizeGB)
+ delete(rawMsg, key)
+ case "image":
+ err = unpopulate(val, "Image", &v.Image)
+ delete(rawMsg, key)
+ case "managedDisk":
+ err = unpopulate(val, "ManagedDisk", &v.ManagedDisk)
+ delete(rawMsg, key)
+ case "vhdContainers":
+ err = unpopulate(val, "VhdContainers", &v.VhdContainers)
+ delete(rawMsg, key)
+ case "writeAcceleratorEnabled":
+ err = unpopulate(val, "WriteAcceleratorEnabled", &v.WriteAcceleratorEnabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateOSProfile.
+func (v VirtualMachineScaleSetUpdateOSProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "customData", v.CustomData)
+ populate(objectMap, "linuxConfiguration", v.LinuxConfiguration)
+ populate(objectMap, "secrets", v.Secrets)
+ populate(objectMap, "windowsConfiguration", v.WindowsConfiguration)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateOSProfile.
+func (v *VirtualMachineScaleSetUpdateOSProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "customData":
+ err = unpopulate(val, "CustomData", &v.CustomData)
+ delete(rawMsg, key)
+ case "linuxConfiguration":
+ err = unpopulate(val, "LinuxConfiguration", &v.LinuxConfiguration)
+ delete(rawMsg, key)
+ case "secrets":
+ err = unpopulate(val, "Secrets", &v.Secrets)
+ delete(rawMsg, key)
+ case "windowsConfiguration":
+ err = unpopulate(val, "WindowsConfiguration", &v.WindowsConfiguration)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateProperties.
+func (v VirtualMachineScaleSetUpdateProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities)
+ populate(objectMap, "automaticRepairsPolicy", v.AutomaticRepairsPolicy)
+ populate(objectMap, "doNotRunExtensionsOnOverprovisionedVMs", v.DoNotRunExtensionsOnOverprovisionedVMs)
+ populate(objectMap, "overprovision", v.Overprovision)
+ populate(objectMap, "priorityMixPolicy", v.PriorityMixPolicy)
+ populate(objectMap, "proximityPlacementGroup", v.ProximityPlacementGroup)
+ populate(objectMap, "scaleInPolicy", v.ScaleInPolicy)
+ populate(objectMap, "singlePlacementGroup", v.SinglePlacementGroup)
+ populate(objectMap, "spotRestorePolicy", v.SpotRestorePolicy)
+ populate(objectMap, "upgradePolicy", v.UpgradePolicy)
+ populate(objectMap, "virtualMachineProfile", v.VirtualMachineProfile)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateProperties.
+func (v *VirtualMachineScaleSetUpdateProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "additionalCapabilities":
+ err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities)
+ delete(rawMsg, key)
+ case "automaticRepairsPolicy":
+ err = unpopulate(val, "AutomaticRepairsPolicy", &v.AutomaticRepairsPolicy)
+ delete(rawMsg, key)
+ case "doNotRunExtensionsOnOverprovisionedVMs":
+ err = unpopulate(val, "DoNotRunExtensionsOnOverprovisionedVMs", &v.DoNotRunExtensionsOnOverprovisionedVMs)
+ delete(rawMsg, key)
+ case "overprovision":
+ err = unpopulate(val, "Overprovision", &v.Overprovision)
+ delete(rawMsg, key)
+ case "priorityMixPolicy":
+ err = unpopulate(val, "PriorityMixPolicy", &v.PriorityMixPolicy)
+ delete(rawMsg, key)
+ case "proximityPlacementGroup":
+ err = unpopulate(val, "ProximityPlacementGroup", &v.ProximityPlacementGroup)
+ delete(rawMsg, key)
+ case "scaleInPolicy":
+ err = unpopulate(val, "ScaleInPolicy", &v.ScaleInPolicy)
+ delete(rawMsg, key)
+ case "singlePlacementGroup":
+ err = unpopulate(val, "SinglePlacementGroup", &v.SinglePlacementGroup)
+ delete(rawMsg, key)
+ case "spotRestorePolicy":
+ err = unpopulate(val, "SpotRestorePolicy", &v.SpotRestorePolicy)
+ delete(rawMsg, key)
+ case "upgradePolicy":
+ err = unpopulate(val, "UpgradePolicy", &v.UpgradePolicy)
+ delete(rawMsg, key)
+ case "virtualMachineProfile":
+ err = unpopulate(val, "VirtualMachineProfile", &v.VirtualMachineProfile)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.
+func (v VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.
+func (v *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties.
+func (v VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dnsSettings", v.DNSSettings)
+ populate(objectMap, "deleteOption", v.DeleteOption)
+ populate(objectMap, "idleTimeoutInMinutes", v.IdleTimeoutInMinutes)
+ populate(objectMap, "publicIPPrefix", v.PublicIPPrefix)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties.
+func (v *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dnsSettings":
+ err = unpopulate(val, "DNSSettings", &v.DNSSettings)
+ delete(rawMsg, key)
+ case "deleteOption":
+ err = unpopulate(val, "DeleteOption", &v.DeleteOption)
+ delete(rawMsg, key)
+ case "idleTimeoutInMinutes":
+ err = unpopulate(val, "IdleTimeoutInMinutes", &v.IdleTimeoutInMinutes)
+ delete(rawMsg, key)
+ case "publicIPPrefix":
+ err = unpopulate(val, "PublicIPPrefix", &v.PublicIPPrefix)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateStorageProfile.
+func (v VirtualMachineScaleSetUpdateStorageProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dataDisks", v.DataDisks)
+ populate(objectMap, "diskControllerType", v.DiskControllerType)
+ populate(objectMap, "imageReference", v.ImageReference)
+ populate(objectMap, "osDisk", v.OSDisk)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateStorageProfile.
+func (v *VirtualMachineScaleSetUpdateStorageProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dataDisks":
+ err = unpopulate(val, "DataDisks", &v.DataDisks)
+ delete(rawMsg, key)
+ case "diskControllerType":
+ err = unpopulate(val, "DiskControllerType", &v.DiskControllerType)
+ delete(rawMsg, key)
+ case "imageReference":
+ err = unpopulate(val, "ImageReference", &v.ImageReference)
+ delete(rawMsg, key)
+ case "osDisk":
+ err = unpopulate(val, "OSDisk", &v.OSDisk)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetUpdateVMProfile.
+func (v VirtualMachineScaleSetUpdateVMProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "billingProfile", v.BillingProfile)
+ populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile)
+ populate(objectMap, "extensionProfile", v.ExtensionProfile)
+ populate(objectMap, "hardwareProfile", v.HardwareProfile)
+ populate(objectMap, "licenseType", v.LicenseType)
+ populate(objectMap, "networkProfile", v.NetworkProfile)
+ populate(objectMap, "osProfile", v.OSProfile)
+ populate(objectMap, "scheduledEventsProfile", v.ScheduledEventsProfile)
+ populate(objectMap, "securityProfile", v.SecurityProfile)
+ populate(objectMap, "storageProfile", v.StorageProfile)
+ populate(objectMap, "userData", v.UserData)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetUpdateVMProfile.
+func (v *VirtualMachineScaleSetUpdateVMProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "billingProfile":
+ err = unpopulate(val, "BillingProfile", &v.BillingProfile)
+ delete(rawMsg, key)
+ case "diagnosticsProfile":
+ err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile)
+ delete(rawMsg, key)
+ case "extensionProfile":
+ err = unpopulate(val, "ExtensionProfile", &v.ExtensionProfile)
+ delete(rawMsg, key)
+ case "hardwareProfile":
+ err = unpopulate(val, "HardwareProfile", &v.HardwareProfile)
+ delete(rawMsg, key)
+ case "licenseType":
+ err = unpopulate(val, "LicenseType", &v.LicenseType)
+ delete(rawMsg, key)
+ case "networkProfile":
+ err = unpopulate(val, "NetworkProfile", &v.NetworkProfile)
+ delete(rawMsg, key)
+ case "osProfile":
+ err = unpopulate(val, "OSProfile", &v.OSProfile)
+ delete(rawMsg, key)
+ case "scheduledEventsProfile":
+ err = unpopulate(val, "ScheduledEventsProfile", &v.ScheduledEventsProfile)
+ delete(rawMsg, key)
+ case "securityProfile":
+ err = unpopulate(val, "SecurityProfile", &v.SecurityProfile)
+ delete(rawMsg, key)
+ case "storageProfile":
+ err = unpopulate(val, "StorageProfile", &v.StorageProfile)
+ delete(rawMsg, key)
+ case "userData":
+ err = unpopulate(val, "UserData", &v.UserData)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVM.
+func (v VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "identity", v.Identity)
+ populate(objectMap, "instanceId", v.InstanceID)
+ populate(objectMap, "location", v.Location)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "plan", v.Plan)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "resources", v.Resources)
+ populate(objectMap, "sku", v.SKU)
+ populate(objectMap, "tags", v.Tags)
+ populate(objectMap, "type", v.Type)
+ populate(objectMap, "zones", v.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVM.
+func (v *VirtualMachineScaleSetVM) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &v.Identity)
+ delete(rawMsg, key)
+ case "instanceId":
+ err = unpopulate(val, "InstanceID", &v.InstanceID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &v.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "plan":
+ err = unpopulate(val, "Plan", &v.Plan)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "resources":
+ err = unpopulate(val, "Resources", &v.Resources)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &v.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &v.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtension.
+func (v VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "location", v.Location)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "type", v.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtension.
+func (v *VirtualMachineScaleSetVMExtension) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &v.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionUpdate.
+func (v VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", v.ID)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "type", v.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionUpdate.
+func (v *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &v.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &v.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionsListResult.
+func (v VirtualMachineScaleSetVMExtensionsListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionsListResult.
+func (v *VirtualMachineScaleSetVMExtensionsListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMExtensionsSummary.
+func (v VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "statusesSummary", v.StatusesSummary)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMExtensionsSummary.
+func (v *VirtualMachineScaleSetVMExtensionsSummary) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "statusesSummary":
+ err = unpopulate(val, "StatusesSummary", &v.StatusesSummary)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceIDs.
+func (v VirtualMachineScaleSetVMInstanceIDs) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "instanceIds", v.InstanceIDs)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceIDs.
+func (v *VirtualMachineScaleSetVMInstanceIDs) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "instanceIds":
+ err = unpopulate(val, "InstanceIDs", &v.InstanceIDs)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceRequiredIDs.
+func (v VirtualMachineScaleSetVMInstanceRequiredIDs) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "instanceIds", v.InstanceIDs)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceRequiredIDs.
+func (v *VirtualMachineScaleSetVMInstanceRequiredIDs) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "instanceIds":
+ err = unpopulate(val, "InstanceIDs", &v.InstanceIDs)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMInstanceView.
+func (v VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "assignedHost", v.AssignedHost)
+ populate(objectMap, "bootDiagnostics", v.BootDiagnostics)
+ populate(objectMap, "computerName", v.ComputerName)
+ populate(objectMap, "disks", v.Disks)
+ populate(objectMap, "extensions", v.Extensions)
+ populate(objectMap, "hyperVGeneration", v.HyperVGeneration)
+ populate(objectMap, "maintenanceRedeployStatus", v.MaintenanceRedeployStatus)
+ populate(objectMap, "osName", v.OSName)
+ populate(objectMap, "osVersion", v.OSVersion)
+ populate(objectMap, "placementGroupId", v.PlacementGroupID)
+ populate(objectMap, "platformFaultDomain", v.PlatformFaultDomain)
+ populate(objectMap, "platformUpdateDomain", v.PlatformUpdateDomain)
+ populate(objectMap, "rdpThumbPrint", v.RdpThumbPrint)
+ populate(objectMap, "statuses", v.Statuses)
+ populate(objectMap, "vmAgent", v.VMAgent)
+ populate(objectMap, "vmHealth", v.VMHealth)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMInstanceView.
+func (v *VirtualMachineScaleSetVMInstanceView) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "assignedHost":
+ err = unpopulate(val, "AssignedHost", &v.AssignedHost)
+ delete(rawMsg, key)
+ case "bootDiagnostics":
+ err = unpopulate(val, "BootDiagnostics", &v.BootDiagnostics)
+ delete(rawMsg, key)
+ case "computerName":
+ err = unpopulate(val, "ComputerName", &v.ComputerName)
+ delete(rawMsg, key)
+ case "disks":
+ err = unpopulate(val, "Disks", &v.Disks)
+ delete(rawMsg, key)
+ case "extensions":
+ err = unpopulate(val, "Extensions", &v.Extensions)
+ delete(rawMsg, key)
+ case "hyperVGeneration":
+ err = unpopulate(val, "HyperVGeneration", &v.HyperVGeneration)
+ delete(rawMsg, key)
+ case "maintenanceRedeployStatus":
+ err = unpopulate(val, "MaintenanceRedeployStatus", &v.MaintenanceRedeployStatus)
+ delete(rawMsg, key)
+ case "osName":
+ err = unpopulate(val, "OSName", &v.OSName)
+ delete(rawMsg, key)
+ case "osVersion":
+ err = unpopulate(val, "OSVersion", &v.OSVersion)
+ delete(rawMsg, key)
+ case "placementGroupId":
+ err = unpopulate(val, "PlacementGroupID", &v.PlacementGroupID)
+ delete(rawMsg, key)
+ case "platformFaultDomain":
+ err = unpopulate(val, "PlatformFaultDomain", &v.PlatformFaultDomain)
+ delete(rawMsg, key)
+ case "platformUpdateDomain":
+ err = unpopulate(val, "PlatformUpdateDomain", &v.PlatformUpdateDomain)
+ delete(rawMsg, key)
+ case "rdpThumbPrint":
+ err = unpopulate(val, "RdpThumbPrint", &v.RdpThumbPrint)
+ delete(rawMsg, key)
+ case "statuses":
+ err = unpopulate(val, "Statuses", &v.Statuses)
+ delete(rawMsg, key)
+ case "vmAgent":
+ err = unpopulate(val, "VMAgent", &v.VMAgent)
+ delete(rawMsg, key)
+ case "vmHealth":
+ err = unpopulate(val, "VMHealth", &v.VMHealth)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMListResult.
+func (v VirtualMachineScaleSetVMListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", v.NextLink)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMListResult.
+func (v *VirtualMachineScaleSetVMListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &v.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMNetworkProfileConfiguration.
+func (v VirtualMachineScaleSetVMNetworkProfileConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "networkInterfaceConfigurations", v.NetworkInterfaceConfigurations)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMNetworkProfileConfiguration.
+func (v *VirtualMachineScaleSetVMNetworkProfileConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "networkInterfaceConfigurations":
+ err = unpopulate(val, "NetworkInterfaceConfigurations", &v.NetworkInterfaceConfigurations)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProfile.
+func (v VirtualMachineScaleSetVMProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "applicationProfile", v.ApplicationProfile)
+ populate(objectMap, "billingProfile", v.BillingProfile)
+ populate(objectMap, "capacityReservation", v.CapacityReservation)
+ populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile)
+ populate(objectMap, "evictionPolicy", v.EvictionPolicy)
+ populate(objectMap, "extensionProfile", v.ExtensionProfile)
+ populate(objectMap, "hardwareProfile", v.HardwareProfile)
+ populate(objectMap, "licenseType", v.LicenseType)
+ populate(objectMap, "networkProfile", v.NetworkProfile)
+ populate(objectMap, "osProfile", v.OSProfile)
+ populate(objectMap, "priority", v.Priority)
+ populate(objectMap, "scheduledEventsProfile", v.ScheduledEventsProfile)
+ populate(objectMap, "securityPostureReference", v.SecurityPostureReference)
+ populate(objectMap, "securityProfile", v.SecurityProfile)
+ populate(objectMap, "serviceArtifactReference", v.ServiceArtifactReference)
+ populate(objectMap, "storageProfile", v.StorageProfile)
+ populate(objectMap, "userData", v.UserData)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProfile.
+func (v *VirtualMachineScaleSetVMProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "applicationProfile":
+ err = unpopulate(val, "ApplicationProfile", &v.ApplicationProfile)
+ delete(rawMsg, key)
+ case "billingProfile":
+ err = unpopulate(val, "BillingProfile", &v.BillingProfile)
+ delete(rawMsg, key)
+ case "capacityReservation":
+ err = unpopulate(val, "CapacityReservation", &v.CapacityReservation)
+ delete(rawMsg, key)
+ case "diagnosticsProfile":
+ err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile)
+ delete(rawMsg, key)
+ case "evictionPolicy":
+ err = unpopulate(val, "EvictionPolicy", &v.EvictionPolicy)
+ delete(rawMsg, key)
+ case "extensionProfile":
+ err = unpopulate(val, "ExtensionProfile", &v.ExtensionProfile)
+ delete(rawMsg, key)
+ case "hardwareProfile":
+ err = unpopulate(val, "HardwareProfile", &v.HardwareProfile)
+ delete(rawMsg, key)
+ case "licenseType":
+ err = unpopulate(val, "LicenseType", &v.LicenseType)
+ delete(rawMsg, key)
+ case "networkProfile":
+ err = unpopulate(val, "NetworkProfile", &v.NetworkProfile)
+ delete(rawMsg, key)
+ case "osProfile":
+ err = unpopulate(val, "OSProfile", &v.OSProfile)
+ delete(rawMsg, key)
+ case "priority":
+ err = unpopulate(val, "Priority", &v.Priority)
+ delete(rawMsg, key)
+ case "scheduledEventsProfile":
+ err = unpopulate(val, "ScheduledEventsProfile", &v.ScheduledEventsProfile)
+ delete(rawMsg, key)
+ case "securityPostureReference":
+ err = unpopulate(val, "SecurityPostureReference", &v.SecurityPostureReference)
+ delete(rawMsg, key)
+ case "securityProfile":
+ err = unpopulate(val, "SecurityProfile", &v.SecurityProfile)
+ delete(rawMsg, key)
+ case "serviceArtifactReference":
+ err = unpopulate(val, "ServiceArtifactReference", &v.ServiceArtifactReference)
+ delete(rawMsg, key)
+ case "storageProfile":
+ err = unpopulate(val, "StorageProfile", &v.StorageProfile)
+ delete(rawMsg, key)
+ case "userData":
+ err = unpopulate(val, "UserData", &v.UserData)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProperties.
+func (v VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "additionalCapabilities", v.AdditionalCapabilities)
+ populate(objectMap, "availabilitySet", v.AvailabilitySet)
+ populate(objectMap, "diagnosticsProfile", v.DiagnosticsProfile)
+ populate(objectMap, "hardwareProfile", v.HardwareProfile)
+ populate(objectMap, "instanceView", v.InstanceView)
+ populate(objectMap, "latestModelApplied", v.LatestModelApplied)
+ populate(objectMap, "licenseType", v.LicenseType)
+ populate(objectMap, "modelDefinitionApplied", v.ModelDefinitionApplied)
+ populate(objectMap, "networkProfile", v.NetworkProfile)
+ populate(objectMap, "networkProfileConfiguration", v.NetworkProfileConfiguration)
+ populate(objectMap, "osProfile", v.OSProfile)
+ populate(objectMap, "protectionPolicy", v.ProtectionPolicy)
+ populate(objectMap, "provisioningState", v.ProvisioningState)
+ populate(objectMap, "securityProfile", v.SecurityProfile)
+ populate(objectMap, "storageProfile", v.StorageProfile)
+ populateDateTimeRFC3339(objectMap, "timeCreated", v.TimeCreated)
+ populate(objectMap, "userData", v.UserData)
+ populate(objectMap, "vmId", v.VMID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProperties.
+func (v *VirtualMachineScaleSetVMProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "additionalCapabilities":
+ err = unpopulate(val, "AdditionalCapabilities", &v.AdditionalCapabilities)
+ delete(rawMsg, key)
+ case "availabilitySet":
+ err = unpopulate(val, "AvailabilitySet", &v.AvailabilitySet)
+ delete(rawMsg, key)
+ case "diagnosticsProfile":
+ err = unpopulate(val, "DiagnosticsProfile", &v.DiagnosticsProfile)
+ delete(rawMsg, key)
+ case "hardwareProfile":
+ err = unpopulate(val, "HardwareProfile", &v.HardwareProfile)
+ delete(rawMsg, key)
+ case "instanceView":
+ err = unpopulate(val, "InstanceView", &v.InstanceView)
+ delete(rawMsg, key)
+ case "latestModelApplied":
+ err = unpopulate(val, "LatestModelApplied", &v.LatestModelApplied)
+ delete(rawMsg, key)
+ case "licenseType":
+ err = unpopulate(val, "LicenseType", &v.LicenseType)
+ delete(rawMsg, key)
+ case "modelDefinitionApplied":
+ err = unpopulate(val, "ModelDefinitionApplied", &v.ModelDefinitionApplied)
+ delete(rawMsg, key)
+ case "networkProfile":
+ err = unpopulate(val, "NetworkProfile", &v.NetworkProfile)
+ delete(rawMsg, key)
+ case "networkProfileConfiguration":
+ err = unpopulate(val, "NetworkProfileConfiguration", &v.NetworkProfileConfiguration)
+ delete(rawMsg, key)
+ case "osProfile":
+ err = unpopulate(val, "OSProfile", &v.OSProfile)
+ delete(rawMsg, key)
+ case "protectionPolicy":
+ err = unpopulate(val, "ProtectionPolicy", &v.ProtectionPolicy)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &v.ProvisioningState)
+ delete(rawMsg, key)
+ case "securityProfile":
+ err = unpopulate(val, "SecurityProfile", &v.SecurityProfile)
+ delete(rawMsg, key)
+ case "storageProfile":
+ err = unpopulate(val, "StorageProfile", &v.StorageProfile)
+ delete(rawMsg, key)
+ case "timeCreated":
+ err = unpopulateDateTimeRFC3339(val, "TimeCreated", &v.TimeCreated)
+ delete(rawMsg, key)
+ case "userData":
+ err = unpopulate(val, "UserData", &v.UserData)
+ delete(rawMsg, key)
+ case "vmId":
+ err = unpopulate(val, "VMID", &v.VMID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMProtectionPolicy.
+func (v VirtualMachineScaleSetVMProtectionPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "protectFromScaleIn", v.ProtectFromScaleIn)
+ populate(objectMap, "protectFromScaleSetActions", v.ProtectFromScaleSetActions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMProtectionPolicy.
+func (v *VirtualMachineScaleSetVMProtectionPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "protectFromScaleIn":
+ err = unpopulate(val, "ProtectFromScaleIn", &v.ProtectFromScaleIn)
+ delete(rawMsg, key)
+ case "protectFromScaleSetActions":
+ err = unpopulate(val, "ProtectFromScaleSetActions", &v.ProtectFromScaleSetActions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineScaleSetVMReimageParameters.
+func (v VirtualMachineScaleSetVMReimageParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "exactVersion", v.ExactVersion)
+ populate(objectMap, "osProfile", v.OSProfile)
+ populate(objectMap, "tempDisk", v.TempDisk)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineScaleSetVMReimageParameters.
+func (v *VirtualMachineScaleSetVMReimageParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "exactVersion":
+ err = unpopulate(val, "ExactVersion", &v.ExactVersion)
+ delete(rawMsg, key)
+ case "osProfile":
+ err = unpopulate(val, "OSProfile", &v.OSProfile)
+ delete(rawMsg, key)
+ case "tempDisk":
+ err = unpopulate(val, "TempDisk", &v.TempDisk)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineSize.
+func (v VirtualMachineSize) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "maxDataDiskCount", v.MaxDataDiskCount)
+ populate(objectMap, "memoryInMB", v.MemoryInMB)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "numberOfCores", v.NumberOfCores)
+ populate(objectMap, "osDiskSizeInMB", v.OSDiskSizeInMB)
+ populate(objectMap, "resourceDiskSizeInMB", v.ResourceDiskSizeInMB)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSize.
+func (v *VirtualMachineSize) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "maxDataDiskCount":
+ err = unpopulate(val, "MaxDataDiskCount", &v.MaxDataDiskCount)
+ delete(rawMsg, key)
+ case "memoryInMB":
+ err = unpopulate(val, "MemoryInMB", &v.MemoryInMB)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "numberOfCores":
+ err = unpopulate(val, "NumberOfCores", &v.NumberOfCores)
+ delete(rawMsg, key)
+ case "osDiskSizeInMB":
+ err = unpopulate(val, "OSDiskSizeInMB", &v.OSDiskSizeInMB)
+ delete(rawMsg, key)
+ case "resourceDiskSizeInMB":
+ err = unpopulate(val, "ResourceDiskSizeInMB", &v.ResourceDiskSizeInMB)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineSizeListResult.
+func (v VirtualMachineSizeListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", v.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSizeListResult.
+func (v *VirtualMachineSizeListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &v.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineSoftwarePatchProperties.
+func (v VirtualMachineSoftwarePatchProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "activityId", v.ActivityID)
+ populate(objectMap, "assessmentState", v.AssessmentState)
+ populate(objectMap, "classifications", v.Classifications)
+ populate(objectMap, "kbId", v.KbID)
+ populateDateTimeRFC3339(objectMap, "lastModifiedDateTime", v.LastModifiedDateTime)
+ populate(objectMap, "name", v.Name)
+ populate(objectMap, "patchId", v.PatchID)
+ populateDateTimeRFC3339(objectMap, "publishedDate", v.PublishedDate)
+ populate(objectMap, "rebootBehavior", v.RebootBehavior)
+ populate(objectMap, "version", v.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineSoftwarePatchProperties.
+func (v *VirtualMachineSoftwarePatchProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "activityId":
+ err = unpopulate(val, "ActivityID", &v.ActivityID)
+ delete(rawMsg, key)
+ case "assessmentState":
+ err = unpopulate(val, "AssessmentState", &v.AssessmentState)
+ delete(rawMsg, key)
+ case "classifications":
+ err = unpopulate(val, "Classifications", &v.Classifications)
+ delete(rawMsg, key)
+ case "kbId":
+ err = unpopulate(val, "KbID", &v.KbID)
+ delete(rawMsg, key)
+ case "lastModifiedDateTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedDateTime", &v.LastModifiedDateTime)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &v.Name)
+ delete(rawMsg, key)
+ case "patchId":
+ err = unpopulate(val, "PatchID", &v.PatchID)
+ delete(rawMsg, key)
+ case "publishedDate":
+ err = unpopulateDateTimeRFC3339(val, "PublishedDate", &v.PublishedDate)
+ delete(rawMsg, key)
+ case "rebootBehavior":
+ err = unpopulate(val, "RebootBehavior", &v.RebootBehavior)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &v.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineStatusCodeCount.
+func (v VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "code", v.Code)
+ populate(objectMap, "count", v.Count)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineStatusCodeCount.
+func (v *VirtualMachineStatusCodeCount) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "code":
+ err = unpopulate(val, "Code", &v.Code)
+ delete(rawMsg, key)
+ case "count":
+ err = unpopulate(val, "Count", &v.Count)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualMachineUpdate.
+func (v VirtualMachineUpdate) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identity", v.Identity)
+ populate(objectMap, "plan", v.Plan)
+ populate(objectMap, "properties", v.Properties)
+ populate(objectMap, "tags", v.Tags)
+ populate(objectMap, "zones", v.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineUpdate.
+func (v *VirtualMachineUpdate) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identity":
+ err = unpopulate(val, "Identity", &v.Identity)
+ delete(rawMsg, key)
+ case "plan":
+ err = unpopulate(val, "Plan", &v.Plan)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &v.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &v.Tags)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &v.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WinRMConfiguration.
+func (w WinRMConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "listeners", w.Listeners)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WinRMConfiguration.
+func (w *WinRMConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "listeners":
+ err = unpopulate(val, "Listeners", &w.Listeners)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WinRMListener.
+func (w WinRMListener) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "certificateUrl", w.CertificateURL)
+ populate(objectMap, "protocol", w.Protocol)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WinRMListener.
+func (w *WinRMListener) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "certificateUrl":
+ err = unpopulate(val, "CertificateURL", &w.CertificateURL)
+ delete(rawMsg, key)
+ case "protocol":
+ err = unpopulate(val, "Protocol", &w.Protocol)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WindowsConfiguration.
+func (w WindowsConfiguration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "additionalUnattendContent", w.AdditionalUnattendContent)
+ populate(objectMap, "enableAutomaticUpdates", w.EnableAutomaticUpdates)
+ populate(objectMap, "enableVMAgentPlatformUpdates", w.EnableVMAgentPlatformUpdates)
+ populate(objectMap, "patchSettings", w.PatchSettings)
+ populate(objectMap, "provisionVMAgent", w.ProvisionVMAgent)
+ populate(objectMap, "timeZone", w.TimeZone)
+ populate(objectMap, "winRM", w.WinRM)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsConfiguration.
+func (w *WindowsConfiguration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "additionalUnattendContent":
+ err = unpopulate(val, "AdditionalUnattendContent", &w.AdditionalUnattendContent)
+ delete(rawMsg, key)
+ case "enableAutomaticUpdates":
+ err = unpopulate(val, "EnableAutomaticUpdates", &w.EnableAutomaticUpdates)
+ delete(rawMsg, key)
+ case "enableVMAgentPlatformUpdates":
+ err = unpopulate(val, "EnableVMAgentPlatformUpdates", &w.EnableVMAgentPlatformUpdates)
+ delete(rawMsg, key)
+ case "patchSettings":
+ err = unpopulate(val, "PatchSettings", &w.PatchSettings)
+ delete(rawMsg, key)
+ case "provisionVMAgent":
+ err = unpopulate(val, "ProvisionVMAgent", &w.ProvisionVMAgent)
+ delete(rawMsg, key)
+ case "timeZone":
+ err = unpopulate(val, "TimeZone", &w.TimeZone)
+ delete(rawMsg, key)
+ case "winRM":
+ err = unpopulate(val, "WinRM", &w.WinRM)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WindowsParameters.
+func (w WindowsParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "classificationsToInclude", w.ClassificationsToInclude)
+ populate(objectMap, "excludeKbsRequiringReboot", w.ExcludeKbsRequiringReboot)
+ populate(objectMap, "kbNumbersToExclude", w.KbNumbersToExclude)
+ populate(objectMap, "kbNumbersToInclude", w.KbNumbersToInclude)
+ populateDateTimeRFC3339(objectMap, "maxPatchPublishDate", w.MaxPatchPublishDate)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsParameters.
+func (w *WindowsParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "classificationsToInclude":
+ err = unpopulate(val, "ClassificationsToInclude", &w.ClassificationsToInclude)
+ delete(rawMsg, key)
+ case "excludeKbsRequiringReboot":
+ err = unpopulate(val, "ExcludeKbsRequiringReboot", &w.ExcludeKbsRequiringReboot)
+ delete(rawMsg, key)
+ case "kbNumbersToExclude":
+ err = unpopulate(val, "KbNumbersToExclude", &w.KbNumbersToExclude)
+ delete(rawMsg, key)
+ case "kbNumbersToInclude":
+ err = unpopulate(val, "KbNumbersToInclude", &w.KbNumbersToInclude)
+ delete(rawMsg, key)
+ case "maxPatchPublishDate":
+ err = unpopulateDateTimeRFC3339(val, "MaxPatchPublishDate", &w.MaxPatchPublishDate)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WindowsVMGuestPatchAutomaticByPlatformSettings.
+func (w WindowsVMGuestPatchAutomaticByPlatformSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "bypassPlatformSafetyChecksOnUserSchedule", w.BypassPlatformSafetyChecksOnUserSchedule)
+ populate(objectMap, "rebootSetting", w.RebootSetting)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsVMGuestPatchAutomaticByPlatformSettings.
+func (w *WindowsVMGuestPatchAutomaticByPlatformSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "bypassPlatformSafetyChecksOnUserSchedule":
+ err = unpopulate(val, "BypassPlatformSafetyChecksOnUserSchedule", &w.BypassPlatformSafetyChecksOnUserSchedule)
+ delete(rawMsg, key)
+ case "rebootSetting":
+ err = unpopulate(val, "RebootSetting", &w.RebootSetting)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+func populate(m map[string]any, k string, v any) {
+ if v == nil {
+ return
+ } else if azcore.IsNullValue(v) {
+ m[k] = nil
+ } else if !reflect.ValueOf(v).IsNil() {
+ m[k] = v
+ }
+}
+
+func populateAny(m map[string]any, k string, v any) {
+ if v == nil {
+ return
+ } else if azcore.IsNullValue(v) {
+ m[k] = nil
+ } else {
+ m[k] = v
+ }
+}
+
+func unpopulate(data json.RawMessage, fn string, v any) error {
+ if data == nil {
+ return nil
+ }
+ if err := json.Unmarshal(data, v); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ return nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.go
new file mode 100644
index 000000000..545c016fc
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.go
@@ -0,0 +1,89 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+)
+
+// OperationsClient contains the methods for the Operations group.
+// Don't use this type directly, use NewOperationsClient() instead.
+type OperationsClient struct {
+ internal *arm.Client
+}
+
+// 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 NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &OperationsClient{
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - Gets a list of compute operations.
+//
+// Generated from API version 2023-07-01
+// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{
+ More: func(page OperationsClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, options)
+ if err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return OperationsClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Compute/operations"
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) {
+ result := OperationsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.go
new file mode 100644
index 000000000..39d7b0f15
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.go
@@ -0,0 +1,1901 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+// AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate
+// method.
+type AvailabilitySetsClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method.
+type AvailabilitySetsClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method.
+type AvailabilitySetsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.NewListAvailableSizesPager
+// method.
+type AvailabilitySetsClientListAvailableSizesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager
+// method.
+type AvailabilitySetsClientListBySubscriptionOptions struct {
+ // The expand expression to apply to the operation. Allowed values are 'instanceView'.
+ Expand *string
+}
+
+// AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.NewListPager method.
+type AvailabilitySetsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method.
+type AvailabilitySetsClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate
+// method.
+type CapacityReservationGroupsClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete
+// method.
+type CapacityReservationGroupsClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get
+// method.
+type CapacityReservationGroupsClientGetOptions struct {
+ // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity
+ // reservations under the capacity reservation group which is a snapshot of the
+ // runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations.
+ Expand *CapacityReservationGroupInstanceViewTypes
+}
+
+// CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListByResourceGroupPager
+// method.
+type CapacityReservationGroupsClientListByResourceGroupOptions struct {
+ // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet
+ // VM Instance or both resource Ids which are associated to capacity
+ // reservation group in the response.
+ Expand *ExpandTypesForGetCapacityReservationGroups
+}
+
+// CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager
+// method.
+type CapacityReservationGroupsClientListBySubscriptionOptions struct {
+ // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet
+ // VM Instance or both resource Ids which are associated to capacity
+ // reservation group in the response.
+ Expand *ExpandTypesForGetCapacityReservationGroups
+}
+
+// CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update
+// method.
+type CapacityReservationGroupsClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate
+// method.
+type CapacityReservationsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete
+// method.
+type CapacityReservationsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate
+// method.
+type CapacityReservationsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get method.
+type CapacityReservationsClientGetOptions struct {
+ // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity
+ // reservation that is managed by the platform and can change outside of
+ // control plane operations.
+ Expand *CapacityReservationInstanceViewTypes
+}
+
+// CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.NewListByCapacityReservationGroupPager
+// method.
+type CapacityReservationsClientListByCapacityReservationGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily
+// method.
+type CloudServiceOperatingSystemsClientGetOSFamilyOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion
+// method.
+type CloudServiceOperatingSystemsClientGetOSVersionOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSFamiliesPager
+// method.
+type CloudServiceOperatingSystemsClientListOSFamiliesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSVersionsPager
+// method.
+type CloudServiceOperatingSystemsClientListOSVersionsOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete
+// method.
+type CloudServiceRoleInstancesClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild
+// method.
+type CloudServiceRoleInstancesClientBeginRebuildOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage
+// method.
+type CloudServiceRoleInstancesClientBeginReimageOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart
+// method.
+type CloudServiceRoleInstancesClientBeginRestartOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView
+// method.
+type CloudServiceRoleInstancesClientGetInstanceViewOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get
+// method.
+type CloudServiceRoleInstancesClientGetOptions struct {
+ // The expand expression to apply to the operation. 'UserData' is not supported for cloud services.
+ Expand *InstanceViewTypes
+}
+
+// CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile
+// method.
+type CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.NewListPager
+// method.
+type CloudServiceRoleInstancesClientListOptions struct {
+ // The expand expression to apply to the operation. 'UserData' is not supported for cloud services.
+ Expand *InstanceViewTypes
+}
+
+// CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method.
+type CloudServiceRolesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.NewListPager method.
+type CloudServiceRolesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate
+// method.
+type CloudServicesClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances
+// method.
+type CloudServicesClientBeginDeleteInstancesOptions struct {
+ // List of cloud service role instance names.
+ Parameters *RoleInstances
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete method.
+type CloudServicesClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff method.
+type CloudServicesClientBeginPowerOffOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild method.
+type CloudServicesClientBeginRebuildOptions struct {
+ // List of cloud service role instance names.
+ Parameters *RoleInstances
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage method.
+type CloudServicesClientBeginReimageOptions struct {
+ // List of cloud service role instance names.
+ Parameters *RoleInstances
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart method.
+type CloudServicesClientBeginRestartOptions struct {
+ // List of cloud service role instance names.
+ Parameters *RoleInstances
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart method.
+type CloudServicesClientBeginStartOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate method.
+type CloudServicesClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView
+// method.
+type CloudServicesClientGetInstanceViewOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method.
+type CloudServicesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.NewListAllPager method.
+type CloudServicesClientListAllOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.NewListPager method.
+type CloudServicesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain
+// method.
+type CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain
+// method.
+type CloudServicesUpdateDomainClientGetUpdateDomainOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.NewListUpdateDomainsPager
+// method.
+type CloudServicesUpdateDomainClientListUpdateDomainsOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method.
+type CommunityGalleriesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get
+// method.
+type CommunityGalleryImageVersionsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.NewListPager
+// method.
+type CommunityGalleryImageVersionsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get method.
+type CommunityGalleryImagesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.NewListPager
+// method.
+type CommunityGalleryImagesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate
+// method.
+type DedicatedHostGroupsClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete method.
+type DedicatedHostGroupsClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method.
+type DedicatedHostGroupsClientGetOptions struct {
+ // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated
+ // hosts under the dedicated host group. 'UserData' is not supported for
+ // dedicated host group.
+ Expand *InstanceViewTypes
+}
+
+// DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListByResourceGroupPager
+// method.
+type DedicatedHostGroupsClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListBySubscriptionPager
+// method.
+type DedicatedHostGroupsClientListBySubscriptionOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update method.
+type DedicatedHostGroupsClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate
+// method.
+type DedicatedHostsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete method.
+type DedicatedHostsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart method.
+type DedicatedHostsClientBeginRestartOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate method.
+type DedicatedHostsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method.
+type DedicatedHostsClientGetOptions struct {
+ // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated
+ // host. 'UserData' is not supported for dedicated host.
+ Expand *InstanceViewTypes
+}
+
+// DedicatedHostsClientListAvailableSizesOptions contains the optional parameters for the DedicatedHostsClient.NewListAvailableSizesPager
+// method.
+type DedicatedHostsClientListAvailableSizesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.NewListByHostGroupPager
+// method.
+type DedicatedHostsClientListByHostGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate
+// method.
+type DiskAccessesClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection
+// method.
+type DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete method.
+type DiskAccessesClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection
+// method.
+type DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate method.
+type DiskAccessesClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection
+// method.
+type DiskAccessesClientGetAPrivateEndpointConnectionOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method.
+type DiskAccessesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources
+// method.
+type DiskAccessesClientGetPrivateLinkResourcesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.NewListByResourceGroupPager
+// method.
+type DiskAccessesClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.NewListPager method.
+type DiskAccessesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.NewListPrivateEndpointConnectionsPager
+// method.
+type DiskAccessesClientListPrivateEndpointConnectionsOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate
+// method.
+type DiskEncryptionSetsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete
+// method.
+type DiskEncryptionSetsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate
+// method.
+type DiskEncryptionSetsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method.
+type DiskEncryptionSetsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListAssociatedResourcesPager
+// method.
+type DiskEncryptionSetsClientListAssociatedResourcesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListByResourceGroupPager
+// method.
+type DiskEncryptionSetsClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListPager method.
+type DiskEncryptionSetsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess
+// method.
+type DiskRestorePointClientBeginGrantAccessOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess
+// method.
+type DiskRestorePointClientBeginRevokeAccessOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method.
+type DiskRestorePointClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.NewListByRestorePointPager
+// method.
+type DiskRestorePointClientListByRestorePointOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate method.
+type DisksClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method.
+type DisksClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method.
+type DisksClientBeginGrantAccessOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method.
+type DisksClientBeginRevokeAccessOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method.
+type DisksClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DisksClientGetOptions contains the optional parameters for the DisksClient.Get method.
+type DisksClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.NewListByResourceGroupPager
+// method.
+type DisksClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DisksClientListOptions contains the optional parameters for the DisksClient.NewListPager method.
+type DisksClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate
+// method.
+type GalleriesClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method.
+type GalleriesClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method.
+type GalleriesClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method.
+type GalleriesClientGetOptions struct {
+ // The expand query option to apply on the operation.
+ Expand *GalleryExpandParams
+
+ // The select expression to apply on the operation.
+ Select *SelectPermissions
+}
+
+// GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.NewListByResourceGroupPager
+// method.
+type GalleriesClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// GalleriesClientListOptions contains the optional parameters for the GalleriesClient.NewListPager method.
+type GalleriesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate
+// method.
+type GalleryApplicationVersionsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete
+// method.
+type GalleryApplicationVersionsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate
+// method.
+type GalleryApplicationVersionsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get
+// method.
+type GalleryApplicationVersionsClientGetOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *ReplicationStatusTypes
+}
+
+// GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.NewListByGalleryApplicationPager
+// method.
+type GalleryApplicationVersionsClientListByGalleryApplicationOptions struct {
+ // placeholder for future optional parameters
+}
+
+// GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate
+// method.
+type GalleryApplicationsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete
+// method.
+type GalleryApplicationsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate
+// method.
+type GalleryApplicationsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method.
+type GalleryApplicationsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.NewListByGalleryPager
+// method.
+type GalleryApplicationsClientListByGalleryOptions struct {
+ // placeholder for future optional parameters
+}
+
+// GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate
+// method.
+type GalleryImageVersionsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete
+// method.
+type GalleryImageVersionsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate
+// method.
+type GalleryImageVersionsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get method.
+type GalleryImageVersionsClientGetOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *ReplicationStatusTypes
+}
+
+// GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.NewListByGalleryImagePager
+// method.
+type GalleryImageVersionsClientListByGalleryImageOptions struct {
+ // placeholder for future optional parameters
+}
+
+// GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate
+// method.
+type GalleryImagesClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete method.
+type GalleryImagesClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate method.
+type GalleryImagesClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method.
+type GalleryImagesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.NewListByGalleryPager
+// method.
+type GalleryImagesClientListByGalleryOptions struct {
+ // placeholder for future optional parameters
+}
+
+// GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate
+// method.
+type GallerySharingProfileClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate method.
+type ImagesClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method.
+type ImagesClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method.
+type ImagesClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method.
+type ImagesClientGetOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+}
+
+// ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.NewListByResourceGroupPager
+// method.
+type ImagesClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ImagesClientListOptions contains the optional parameters for the ImagesClient.NewListPager method.
+type ImagesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval
+// method.
+type LogAnalyticsClientBeginExportRequestRateByIntervalOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests
+// method.
+type LogAnalyticsClientBeginExportThrottledRequestsOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+type OperationsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate
+// method.
+type ProximityPlacementGroupsClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete
+// method.
+type ProximityPlacementGroupsClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get method.
+type ProximityPlacementGroupsClientGetOptions struct {
+ // includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group.
+ IncludeColocationStatus *string
+}
+
+// ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListByResourceGroupPager
+// method.
+type ProximityPlacementGroupsClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListBySubscriptionPager
+// method.
+type ProximityPlacementGroupsClientListBySubscriptionOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update
+// method.
+type ProximityPlacementGroupsClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method.
+type ResourceSKUsClientListOptions struct {
+ // The filter to apply on the operation. Only location filter is supported currently.
+ Filter *string
+
+ // To Include Extended Locations information or not in the response.
+ IncludeExtendedLocations *string
+}
+
+// RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete
+// method.
+type RestorePointCollectionsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate
+// method.
+type RestorePointCollectionsClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get method.
+type RestorePointCollectionsClientGetOptions struct {
+ // The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points
+ // in the restorePointCollection.
+ Expand *RestorePointCollectionExpandOptions
+}
+
+// RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.NewListAllPager
+// method.
+type RestorePointCollectionsClientListAllOptions struct {
+ // placeholder for future optional parameters
+}
+
+// RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.NewListPager
+// method.
+type RestorePointCollectionsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update
+// method.
+type RestorePointCollectionsClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method.
+type RestorePointsClientBeginCreateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete method.
+type RestorePointsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method.
+type RestorePointsClientGetOptions struct {
+ // The expand expression to apply on the operation. 'InstanceView' retrieves information about the run-time state of a restore
+ // point.
+ Expand *RestorePointExpandOptions
+}
+
+// SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method.
+type SSHPublicKeysClientCreateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method.
+type SSHPublicKeysClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair
+// method.
+type SSHPublicKeysClientGenerateKeyPairOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method.
+type SSHPublicKeysClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.NewListByResourceGroupPager
+// method.
+type SSHPublicKeysClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.NewListBySubscriptionPager
+// method.
+type SSHPublicKeysClientListBySubscriptionOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method.
+type SSHPublicKeysClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method.
+type SharedGalleriesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.NewListPager method.
+type SharedGalleriesClientListOptions struct {
+ // The query parameter to decide what shared galleries to fetch when doing listing operations.
+ SharedTo *SharedToValues
+}
+
+// SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get
+// method.
+type SharedGalleryImageVersionsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.NewListPager
+// method.
+type SharedGalleryImageVersionsClientListOptions struct {
+ // The query parameter to decide what shared galleries to fetch when doing listing operations.
+ SharedTo *SharedToValues
+}
+
+// SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method.
+type SharedGalleryImagesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.NewListPager method.
+type SharedGalleryImagesClientListOptions struct {
+ // The query parameter to decide what shared galleries to fetch when doing listing operations.
+ SharedTo *SharedToValues
+}
+
+// SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate
+// method.
+type SnapshotsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method.
+type SnapshotsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess method.
+type SnapshotsClientBeginGrantAccessOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess method.
+type SnapshotsClientBeginRevokeAccessOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method.
+type SnapshotsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method.
+type SnapshotsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager
+// method.
+type SnapshotsClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method.
+type SnapshotsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method.
+type UsageClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get
+// method.
+type VirtualMachineExtensionImagesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes
+// method.
+type VirtualMachineExtensionImagesClientListTypesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions
+// method.
+type VirtualMachineExtensionImagesClientListVersionsOptions struct {
+ // The filter to apply on the operation.
+ Filter *string
+ Orderby *string
+ Top *int32
+}
+
+// VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate
+// method.
+type VirtualMachineExtensionsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete
+// method.
+type VirtualMachineExtensionsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate
+// method.
+type VirtualMachineExtensionsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get method.
+type VirtualMachineExtensionsClientGetOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+}
+
+// VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List
+// method.
+type VirtualMachineExtensionsClientListOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+}
+
+// VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get method.
+type VirtualMachineImagesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineImagesClientListByEdgeZoneOptions contains the optional parameters for the VirtualMachineImagesClient.ListByEdgeZone
+// method.
+type VirtualMachineImagesClientListByEdgeZoneOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers
+// method.
+type VirtualMachineImagesClientListOffersOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List method.
+type VirtualMachineImagesClientListOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+ Orderby *string
+ Top *int32
+}
+
+// VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers
+// method.
+type VirtualMachineImagesClientListPublishersOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs
+// method.
+type VirtualMachineImagesClientListSKUsOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get
+// method.
+type VirtualMachineImagesEdgeZoneClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers
+// method.
+type VirtualMachineImagesEdgeZoneClientListOffersOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List
+// method.
+type VirtualMachineImagesEdgeZoneClientListOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+
+ // Specifies the order of the results returned. Formatted as an OData query.
+ Orderby *string
+
+ // An integer value specifying the number of images to return that matches supplied values.
+ Top *int32
+}
+
+// VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers
+// method.
+type VirtualMachineImagesEdgeZoneClientListPublishersOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs
+// method.
+type VirtualMachineImagesEdgeZoneClientListSKUsOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate
+// method.
+type VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete
+// method.
+type VirtualMachineRunCommandsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate
+// method.
+type VirtualMachineRunCommandsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine
+// method.
+type VirtualMachineRunCommandsClientGetByVirtualMachineOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+}
+
+// VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get
+// method.
+type VirtualMachineRunCommandsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListByVirtualMachinePager
+// method.
+type VirtualMachineRunCommandsClientListByVirtualMachineOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+}
+
+// VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListPager
+// method.
+type VirtualMachineRunCommandsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate
+// method.
+type VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete
+// method.
+type VirtualMachineScaleSetExtensionsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate
+// method.
+type VirtualMachineScaleSetExtensionsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get
+// method.
+type VirtualMachineScaleSetExtensionsClientGetOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+}
+
+// VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.NewListPager
+// method.
+type VirtualMachineScaleSetExtensionsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel
+// method.
+type VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade
+// method.
+type VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade
+// method.
+type VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest
+// method.
+type VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate
+// method.
+type VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete
+// method.
+type VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate
+// method.
+type VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get
+// method.
+type VirtualMachineScaleSetVMExtensionsClientGetOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+}
+
+// VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List
+// method.
+type VirtualMachineScaleSetVMExtensionsClientListOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+}
+
+// VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate
+// method.
+type VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete
+// method.
+type VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate
+// method.
+type VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get
+// method.
+type VirtualMachineScaleSetVMRunCommandsClientGetOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+}
+
+// VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.NewListPager
+// method.
+type VirtualMachineScaleSetVMRunCommandsClientListOptions struct {
+ // The expand expression to apply on the operation.
+ Expand *string
+}
+
+// VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate
+// method.
+type VirtualMachineScaleSetVMsClientBeginDeallocateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete
+// method.
+type VirtualMachineScaleSetVMsClientBeginDeleteOptions struct {
+ // Optional parameter to force delete a virtual machine from a VM scale set. (Feature in Preview)
+ ForceDeletion *bool
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance
+// method.
+type VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff
+// method.
+type VirtualMachineScaleSetVMsClientBeginPowerOffOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+
+ // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false
+ // indicates otherwise. Default value for this flag is false if not specified
+ SkipShutdown *bool
+}
+
+// VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy
+// method.
+type VirtualMachineScaleSetVMsClientBeginRedeployOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll
+// method.
+type VirtualMachineScaleSetVMsClientBeginReimageAllOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage
+// method.
+type VirtualMachineScaleSetVMsClientBeginReimageOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+
+ // Parameters for the Reimaging Virtual machine in ScaleSet.
+ VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters
+}
+
+// VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart
+// method.
+type VirtualMachineScaleSetVMsClientBeginRestartOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand
+// method.
+type VirtualMachineScaleSetVMsClientBeginRunCommandOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart
+// method.
+type VirtualMachineScaleSetVMsClientBeginStartOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate
+// method.
+type VirtualMachineScaleSetVMsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView
+// method.
+type VirtualMachineScaleSetVMsClientGetInstanceViewOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get
+// method.
+type VirtualMachineScaleSetVMsClientGetOptions struct {
+ // The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine.
+ // 'UserData' will retrieve the UserData of the virtual machine.
+ Expand *InstanceViewTypes
+}
+
+// VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.NewListPager
+// method.
+type VirtualMachineScaleSetVMsClientListOptions struct {
+ // The expand expression to apply to the operation. Allowed values are 'instanceView'.
+ Expand *string
+
+ // The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true',
+ // 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq
+ // false'.
+ Filter *string
+
+ // The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'.
+ Select *string
+}
+
+// VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData
+// method.
+type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions struct {
+ // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs
+ // will be generated with a default expiration duration of 120 minutes.
+ SasURIExpirationTimeInMinutes *int32
+}
+
+// VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction
+// method.
+type VirtualMachineScaleSetVMsClientSimulateEvictionOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate
+// method.
+type VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate
+// method.
+type VirtualMachineScaleSetsClientBeginDeallocateOptions struct {
+ // Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is available for VMSS with Flexible
+ // OrchestrationMode only)
+ Hibernate *bool
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+
+ // A list of virtual machine instance IDs from the VM scale set.
+ VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs
+}
+
+// VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances
+// method.
+type VirtualMachineScaleSetsClientBeginDeleteInstancesOptions struct {
+ // Optional parameter to force delete virtual machines from the VM scale set. (Feature in Preview)
+ ForceDeletion *bool
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete
+// method.
+type VirtualMachineScaleSetsClientBeginDeleteOptions struct {
+ // Optional parameter to force delete a VM scale set. (Feature in Preview)
+ ForceDeletion *bool
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance
+// method.
+type VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+
+ // A list of virtual machine instance IDs from the VM scale set.
+ VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs
+}
+
+// VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff
+// method.
+type VirtualMachineScaleSetsClientBeginPowerOffOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+
+ // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false
+ // indicates otherwise. Default value for this flag is false if not specified
+ SkipShutdown *bool
+
+ // A list of virtual machine instance IDs from the VM scale set.
+ VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs
+}
+
+// VirtualMachineScaleSetsClientBeginReapplyOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReapply
+// method.
+type VirtualMachineScaleSetsClientBeginReapplyOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy
+// method.
+type VirtualMachineScaleSetsClientBeginRedeployOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+
+ // A list of virtual machine instance IDs from the VM scale set.
+ VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs
+}
+
+// VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll
+// method.
+type VirtualMachineScaleSetsClientBeginReimageAllOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+
+ // A list of virtual machine instance IDs from the VM scale set.
+ VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs
+}
+
+// VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage
+// method.
+type VirtualMachineScaleSetsClientBeginReimageOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+
+ // Parameters for Reimaging VM ScaleSet.
+ VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters
+}
+
+// VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart
+// method.
+type VirtualMachineScaleSetsClientBeginRestartOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+
+ // A list of virtual machine instance IDs from the VM scale set.
+ VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs
+}
+
+// VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState
+// method.
+type VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart
+// method.
+type VirtualMachineScaleSetsClientBeginStartOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+
+ // A list of virtual machine instance IDs from the VM scale set.
+ VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs
+}
+
+// VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances
+// method.
+type VirtualMachineScaleSetsClientBeginUpdateInstancesOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate
+// method.
+type VirtualMachineScaleSetsClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup
+// method.
+type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional parameters
+// for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method.
+type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions struct {
+ // The placement group id for which the manual recovery walk is requested.
+ PlacementGroupID *string
+
+ // The zone in which the manual recovery walk is requested for cross zone virtual machine scale set
+ Zone *string
+}
+
+// VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView
+// method.
+type VirtualMachineScaleSetsClientGetInstanceViewOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager
+// method.
+type VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get method.
+type VirtualMachineScaleSetsClientGetOptions struct {
+ // The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was
+ // provided by the user during the VM scale set Create/Update operation
+ Expand *ExpandTypesForGetVMScaleSets
+}
+
+// VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListAllPager
+// method.
+type VirtualMachineScaleSetsClientListAllOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListByLocationPager
+// method.
+type VirtualMachineScaleSetsClientListByLocationOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListPager
+// method.
+type VirtualMachineScaleSetsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListSKUsPager
+// method.
+type VirtualMachineScaleSetsClientListSKUsOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.NewListPager method.
+type VirtualMachineSizesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches
+// method.
+type VirtualMachinesClientBeginAssessPatchesOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture method.
+type VirtualMachinesClientBeginCaptureOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks
+// method.
+type VirtualMachinesClientBeginConvertToManagedDisksOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate
+// method.
+type VirtualMachinesClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate
+// method.
+type VirtualMachinesClientBeginDeallocateOptions struct {
+ // Optional parameter to hibernate a virtual machine. (Feature in Preview)
+ Hibernate *bool
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete method.
+type VirtualMachinesClientBeginDeleteOptions struct {
+ // Optional parameter to force delete virtual machines.
+ ForceDeletion *bool
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches
+// method.
+type VirtualMachinesClientBeginInstallPatchesOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance
+// method.
+type VirtualMachinesClientBeginPerformMaintenanceOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff
+// method.
+type VirtualMachinesClientBeginPowerOffOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+
+ // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false
+ // indicates otherwise. Default value for this flag is false if not specified
+ SkipShutdown *bool
+}
+
+// VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply method.
+type VirtualMachinesClientBeginReapplyOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy
+// method.
+type VirtualMachinesClientBeginRedeployOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage method.
+type VirtualMachinesClientBeginReimageOptions struct {
+ // Parameters supplied to the Reimage Virtual Machine operation.
+ Parameters *VirtualMachineReimageParameters
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart method.
+type VirtualMachinesClientBeginRestartOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand
+// method.
+type VirtualMachinesClientBeginRunCommandOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart method.
+type VirtualMachinesClientBeginStartOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate method.
+type VirtualMachinesClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize method.
+type VirtualMachinesClientGeneralizeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method.
+type VirtualMachinesClientGetOptions struct {
+ // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual
+ // machine that is managed by the platform and can change outside of control
+ // plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user
+ // during the VM Create/Update operation.
+ Expand *InstanceViewTypes
+}
+
+// VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView method.
+type VirtualMachinesClientInstanceViewOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.NewListAllPager method.
+type VirtualMachinesClientListAllOptions struct {
+ // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this
+ // can only be specified if a valid $filter option is specified
+ Expand *ExpandTypesForListVMs
+
+ // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq
+ // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'
+ Filter *string
+
+ // statusOnly=true enables fetching run time status of all Virtual Machines in the subscription.
+ StatusOnly *string
+}
+
+// VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.NewListAvailableSizesPager
+// method.
+type VirtualMachinesClientListAvailableSizesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.NewListByLocationPager
+// method.
+type VirtualMachinesClientListByLocationOptions struct {
+ // placeholder for future optional parameters
+}
+
+// VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager method.
+type VirtualMachinesClientListOptions struct {
+ // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this
+ // can only be specified if a valid $filter option is specified
+ Expand *ExpandTypeForListVMs
+
+ // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq
+ // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}'
+ Filter *string
+}
+
+// VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData
+// method.
+type VirtualMachinesClientRetrieveBootDiagnosticsDataOptions struct {
+ // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs
+ // will be generated with a default expiration duration of 120 minutes.
+ SasURIExpirationTimeInMinutes *int32
+}
+
+// VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction
+// method.
+type VirtualMachinesClientSimulateEvictionOptions struct {
+ // placeholder for future optional parameters
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.go
new file mode 100644
index 000000000..7dbfd8f5b
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.go
@@ -0,0 +1,421 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// ProximityPlacementGroupsClient contains the methods for the ProximityPlacementGroups group.
+// Don't use this type directly, use NewProximityPlacementGroupsClient() instead.
+type ProximityPlacementGroupsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewProximityPlacementGroupsClient creates a new instance of ProximityPlacementGroupsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewProximityPlacementGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProximityPlacementGroupsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &ProximityPlacementGroupsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Create or update a proximity placement group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - proximityPlacementGroupName - The name of the proximity placement group.
+// - parameters - Parameters supplied to the Create Proximity Placement Group operation.
+// - options - ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate
+// method.
+func (client *ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup, options *ProximityPlacementGroupsClientCreateOrUpdateOptions) (ProximityPlacementGroupsClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "ProximityPlacementGroupsClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, parameters, options)
+ if err != nil {
+ return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *ProximityPlacementGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup, options *ProximityPlacementGroupsClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if proximityPlacementGroupName == "" {
+ return nil, errors.New("parameter proximityPlacementGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *ProximityPlacementGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientCreateOrUpdateResponse, error) {
+ result := ProximityPlacementGroupsClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil {
+ return ProximityPlacementGroupsClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Delete a proximity placement group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - proximityPlacementGroupName - The name of the proximity placement group.
+// - options - ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete
+// method.
+func (client *ProximityPlacementGroupsClient) Delete(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientDeleteOptions) (ProximityPlacementGroupsClientDeleteResponse, error) {
+ var err error
+ const operationName = "ProximityPlacementGroupsClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, options)
+ if err != nil {
+ return ProximityPlacementGroupsClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ProximityPlacementGroupsClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ProximityPlacementGroupsClientDeleteResponse{}, err
+ }
+ return ProximityPlacementGroupsClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *ProximityPlacementGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if proximityPlacementGroupName == "" {
+ return nil, errors.New("parameter proximityPlacementGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Retrieves information about a proximity placement group .
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - proximityPlacementGroupName - The name of the proximity placement group.
+// - options - ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get
+// method.
+func (client *ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientGetOptions) (ProximityPlacementGroupsClientGetResponse, error) {
+ var err error
+ const operationName = "ProximityPlacementGroupsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, options)
+ if err != nil {
+ return ProximityPlacementGroupsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ProximityPlacementGroupsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ProximityPlacementGroupsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *ProximityPlacementGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, options *ProximityPlacementGroupsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if proximityPlacementGroupName == "" {
+ return nil, errors.New("parameter proximityPlacementGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.IncludeColocationStatus != nil {
+ reqQP.Set("includeColocationStatus", *options.IncludeColocationStatus)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *ProximityPlacementGroupsClient) getHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientGetResponse, error) {
+ result := ProximityPlacementGroupsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil {
+ return ProximityPlacementGroupsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Lists all proximity placement groups in a resource group.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - options - ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListByResourceGroupPager
+// method.
+func (client *ProximityPlacementGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *ProximityPlacementGroupsClientListByResourceGroupOptions) *runtime.Pager[ProximityPlacementGroupsClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ProximityPlacementGroupsClientListByResourceGroupResponse]{
+ More: func(page ProximityPlacementGroupsClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *ProximityPlacementGroupsClientListByResourceGroupResponse) (ProximityPlacementGroupsClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ProximityPlacementGroupsClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return ProximityPlacementGroupsClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *ProximityPlacementGroupsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ProximityPlacementGroupsClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *ProximityPlacementGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientListByResourceGroupResponse, error) {
+ result := ProximityPlacementGroupsClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroupListResult); err != nil {
+ return ProximityPlacementGroupsClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListBySubscriptionPager - Lists all proximity placement groups in a subscription.
+//
+// Generated from API version 2023-07-01
+// - options - ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListBySubscriptionPager
+// method.
+func (client *ProximityPlacementGroupsClient) NewListBySubscriptionPager(options *ProximityPlacementGroupsClientListBySubscriptionOptions) *runtime.Pager[ProximityPlacementGroupsClientListBySubscriptionResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ProximityPlacementGroupsClientListBySubscriptionResponse]{
+ More: func(page ProximityPlacementGroupsClientListBySubscriptionResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *ProximityPlacementGroupsClientListBySubscriptionResponse) (ProximityPlacementGroupsClientListBySubscriptionResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ProximityPlacementGroupsClient.NewListBySubscriptionPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listBySubscriptionCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return ProximityPlacementGroupsClientListBySubscriptionResponse{}, err
+ }
+ return client.listBySubscriptionHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listBySubscriptionCreateRequest creates the ListBySubscription request.
+func (client *ProximityPlacementGroupsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ProximityPlacementGroupsClientListBySubscriptionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listBySubscriptionHandleResponse handles the ListBySubscription response.
+func (client *ProximityPlacementGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientListBySubscriptionResponse, error) {
+ result := ProximityPlacementGroupsClientListBySubscriptionResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroupListResult); err != nil {
+ return ProximityPlacementGroupsClientListBySubscriptionResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - Update a proximity placement group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - proximityPlacementGroupName - The name of the proximity placement group.
+// - parameters - Parameters supplied to the Update Proximity Placement Group operation.
+// - options - ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update
+// method.
+func (client *ProximityPlacementGroupsClient) Update(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate, options *ProximityPlacementGroupsClientUpdateOptions) (ProximityPlacementGroupsClientUpdateResponse, error) {
+ var err error
+ const operationName = "ProximityPlacementGroupsClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, proximityPlacementGroupName, parameters, options)
+ if err != nil {
+ return ProximityPlacementGroupsClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ProximityPlacementGroupsClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ProximityPlacementGroupsClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *ProximityPlacementGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate, options *ProximityPlacementGroupsClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if proximityPlacementGroupName == "" {
+ return nil, errors.New("parameter proximityPlacementGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{proximityPlacementGroupName}", url.PathEscape(proximityPlacementGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *ProximityPlacementGroupsClient) updateHandleResponse(resp *http.Response) (ProximityPlacementGroupsClientUpdateResponse, error) {
+ result := ProximityPlacementGroupsClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ProximityPlacementGroup); err != nil {
+ return ProximityPlacementGroupsClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.go
new file mode 100644
index 000000000..e0dd1afa4
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.go
@@ -0,0 +1,105 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// ResourceSKUsClient contains the methods for the ResourceSKUs group.
+// Don't use this type directly, use NewResourceSKUsClient() instead.
+type ResourceSKUsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewResourceSKUsClient creates a new instance of ResourceSKUsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewResourceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceSKUsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &ResourceSKUsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - Gets the list of Microsoft.Compute SKUs available for your Subscription.
+//
+// Generated from API version 2021-07-01
+// - options - ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method.
+func (client *ResourceSKUsClient) NewListPager(options *ResourceSKUsClientListOptions) *runtime.Pager[ResourceSKUsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ResourceSKUsClientListResponse]{
+ More: func(page ResourceSKUsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *ResourceSKUsClientListResponse) (ResourceSKUsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ResourceSKUsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return ResourceSKUsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *ResourceSKUsClient) listCreateRequest(ctx context.Context, options *ResourceSKUsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-07-01")
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.IncludeExtendedLocations != nil {
+ reqQP.Set("includeExtendedLocations", *options.IncludeExtendedLocations)
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *ResourceSKUsClient) listHandleResponse(resp *http.Response) (ResourceSKUsClientListResponse, error) {
+ result := ResourceSKUsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ResourceSKUsResult); err != nil {
+ return ResourceSKUsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/response_types.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/response_types.go
new file mode 100644
index 000000000..360dfc34b
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/response_types.go
@@ -0,0 +1,1646 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import "io"
+
+// AvailabilitySetsClientCreateOrUpdateResponse contains the response from method AvailabilitySetsClient.CreateOrUpdate.
+type AvailabilitySetsClientCreateOrUpdateResponse struct {
+ // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified
+ // in the same availability set are allocated to different nodes to maximize availability. For more information about availability
+ // sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For
+ // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates).
+ // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability
+ // set.
+ AvailabilitySet
+}
+
+// AvailabilitySetsClientDeleteResponse contains the response from method AvailabilitySetsClient.Delete.
+type AvailabilitySetsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// AvailabilitySetsClientGetResponse contains the response from method AvailabilitySetsClient.Get.
+type AvailabilitySetsClientGetResponse struct {
+ // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified
+ // in the same availability set are allocated to different nodes to maximize availability. For more information about availability
+ // sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For
+ // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates).
+ // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability
+ // set.
+ AvailabilitySet
+}
+
+// AvailabilitySetsClientListAvailableSizesResponse contains the response from method AvailabilitySetsClient.NewListAvailableSizesPager.
+type AvailabilitySetsClientListAvailableSizesResponse struct {
+ // The List Virtual Machine operation response.
+ VirtualMachineSizeListResult
+}
+
+// AvailabilitySetsClientListBySubscriptionResponse contains the response from method AvailabilitySetsClient.NewListBySubscriptionPager.
+type AvailabilitySetsClientListBySubscriptionResponse struct {
+ // The List Availability Set operation response.
+ AvailabilitySetListResult
+}
+
+// AvailabilitySetsClientListResponse contains the response from method AvailabilitySetsClient.NewListPager.
+type AvailabilitySetsClientListResponse struct {
+ // The List Availability Set operation response.
+ AvailabilitySetListResult
+}
+
+// AvailabilitySetsClientUpdateResponse contains the response from method AvailabilitySetsClient.Update.
+type AvailabilitySetsClientUpdateResponse struct {
+ // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified
+ // in the same availability set are allocated to different nodes to maximize availability. For more information about availability
+ // sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For
+ // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates).
+ // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability
+ // set.
+ AvailabilitySet
+}
+
+// CapacityReservationGroupsClientCreateOrUpdateResponse contains the response from method CapacityReservationGroupsClient.CreateOrUpdate.
+type CapacityReservationGroupsClientCreateOrUpdateResponse struct {
+ // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently,
+ // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation
+ // cannot be added or moved to another capacity reservation group.
+ CapacityReservationGroup
+}
+
+// CapacityReservationGroupsClientDeleteResponse contains the response from method CapacityReservationGroupsClient.Delete.
+type CapacityReservationGroupsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// CapacityReservationGroupsClientGetResponse contains the response from method CapacityReservationGroupsClient.Get.
+type CapacityReservationGroupsClientGetResponse struct {
+ // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently,
+ // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation
+ // cannot be added or moved to another capacity reservation group.
+ CapacityReservationGroup
+}
+
+// CapacityReservationGroupsClientListByResourceGroupResponse contains the response from method CapacityReservationGroupsClient.NewListByResourceGroupPager.
+type CapacityReservationGroupsClientListByResourceGroupResponse struct {
+ // The List capacity reservation group with resource group response.
+ CapacityReservationGroupListResult
+}
+
+// CapacityReservationGroupsClientListBySubscriptionResponse contains the response from method CapacityReservationGroupsClient.NewListBySubscriptionPager.
+type CapacityReservationGroupsClientListBySubscriptionResponse struct {
+ // The List capacity reservation group with resource group response.
+ CapacityReservationGroupListResult
+}
+
+// CapacityReservationGroupsClientUpdateResponse contains the response from method CapacityReservationGroupsClient.Update.
+type CapacityReservationGroupsClientUpdateResponse struct {
+ // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently,
+ // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation
+ // cannot be added or moved to another capacity reservation group.
+ CapacityReservationGroup
+}
+
+// CapacityReservationsClientCreateOrUpdateResponse contains the response from method CapacityReservationsClient.BeginCreateOrUpdate.
+type CapacityReservationsClientCreateOrUpdateResponse struct {
+ // Specifies information about the capacity reservation.
+ CapacityReservation
+}
+
+// CapacityReservationsClientDeleteResponse contains the response from method CapacityReservationsClient.BeginDelete.
+type CapacityReservationsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// CapacityReservationsClientGetResponse contains the response from method CapacityReservationsClient.Get.
+type CapacityReservationsClientGetResponse struct {
+ // Specifies information about the capacity reservation.
+ CapacityReservation
+}
+
+// CapacityReservationsClientListByCapacityReservationGroupResponse contains the response from method CapacityReservationsClient.NewListByCapacityReservationGroupPager.
+type CapacityReservationsClientListByCapacityReservationGroupResponse struct {
+ // The list capacity reservation operation response.
+ CapacityReservationListResult
+}
+
+// CapacityReservationsClientUpdateResponse contains the response from method CapacityReservationsClient.BeginUpdate.
+type CapacityReservationsClientUpdateResponse struct {
+ // Specifies information about the capacity reservation.
+ CapacityReservation
+}
+
+// CloudServiceOperatingSystemsClientGetOSFamilyResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSFamily.
+type CloudServiceOperatingSystemsClientGetOSFamilyResponse struct {
+ // Describes a cloud service OS family.
+ OSFamily
+}
+
+// CloudServiceOperatingSystemsClientGetOSVersionResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSVersion.
+type CloudServiceOperatingSystemsClientGetOSVersionResponse struct {
+ // Describes a cloud service OS version.
+ OSVersion
+}
+
+// CloudServiceOperatingSystemsClientListOSFamiliesResponse contains the response from method CloudServiceOperatingSystemsClient.NewListOSFamiliesPager.
+type CloudServiceOperatingSystemsClientListOSFamiliesResponse struct {
+ // The list operation result.
+ OSFamilyListResult
+}
+
+// CloudServiceOperatingSystemsClientListOSVersionsResponse contains the response from method CloudServiceOperatingSystemsClient.NewListOSVersionsPager.
+type CloudServiceOperatingSystemsClientListOSVersionsResponse struct {
+ // The list operation result.
+ OSVersionListResult
+}
+
+// CloudServiceRoleInstancesClientDeleteResponse contains the response from method CloudServiceRoleInstancesClient.BeginDelete.
+type CloudServiceRoleInstancesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// CloudServiceRoleInstancesClientGetInstanceViewResponse contains the response from method CloudServiceRoleInstancesClient.GetInstanceView.
+type CloudServiceRoleInstancesClientGetInstanceViewResponse struct {
+ // The instance view of the role instance.
+ RoleInstanceView
+}
+
+// CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse contains the response from method CloudServiceRoleInstancesClient.GetRemoteDesktopFile.
+type CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse struct {
+ // Body contains the streaming response.
+ Body io.ReadCloser
+}
+
+// CloudServiceRoleInstancesClientGetResponse contains the response from method CloudServiceRoleInstancesClient.Get.
+type CloudServiceRoleInstancesClientGetResponse struct {
+ // Describes the cloud service role instance.
+ RoleInstance
+}
+
+// CloudServiceRoleInstancesClientListResponse contains the response from method CloudServiceRoleInstancesClient.NewListPager.
+type CloudServiceRoleInstancesClientListResponse struct {
+ // The list operation result.
+ RoleInstanceListResult
+}
+
+// CloudServiceRoleInstancesClientRebuildResponse contains the response from method CloudServiceRoleInstancesClient.BeginRebuild.
+type CloudServiceRoleInstancesClientRebuildResponse struct {
+ // placeholder for future response values
+}
+
+// CloudServiceRoleInstancesClientReimageResponse contains the response from method CloudServiceRoleInstancesClient.BeginReimage.
+type CloudServiceRoleInstancesClientReimageResponse struct {
+ // placeholder for future response values
+}
+
+// CloudServiceRoleInstancesClientRestartResponse contains the response from method CloudServiceRoleInstancesClient.BeginRestart.
+type CloudServiceRoleInstancesClientRestartResponse struct {
+ // placeholder for future response values
+}
+
+// CloudServiceRolesClientGetResponse contains the response from method CloudServiceRolesClient.Get.
+type CloudServiceRolesClientGetResponse struct {
+ // Describes a role of the cloud service.
+ CloudServiceRole
+}
+
+// CloudServiceRolesClientListResponse contains the response from method CloudServiceRolesClient.NewListPager.
+type CloudServiceRolesClientListResponse struct {
+ // The list operation result.
+ CloudServiceRoleListResult
+}
+
+// CloudServicesClientCreateOrUpdateResponse contains the response from method CloudServicesClient.BeginCreateOrUpdate.
+type CloudServicesClientCreateOrUpdateResponse struct {
+ // Describes the cloud service.
+ CloudService
+}
+
+// CloudServicesClientDeleteInstancesResponse contains the response from method CloudServicesClient.BeginDeleteInstances.
+type CloudServicesClientDeleteInstancesResponse struct {
+ // placeholder for future response values
+}
+
+// CloudServicesClientDeleteResponse contains the response from method CloudServicesClient.BeginDelete.
+type CloudServicesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// CloudServicesClientGetInstanceViewResponse contains the response from method CloudServicesClient.GetInstanceView.
+type CloudServicesClientGetInstanceViewResponse struct {
+ // InstanceView of CloudService as a whole
+ CloudServiceInstanceView
+}
+
+// CloudServicesClientGetResponse contains the response from method CloudServicesClient.Get.
+type CloudServicesClientGetResponse struct {
+ // Describes the cloud service.
+ CloudService
+}
+
+// CloudServicesClientListAllResponse contains the response from method CloudServicesClient.NewListAllPager.
+type CloudServicesClientListAllResponse struct {
+ // The list operation result.
+ CloudServiceListResult
+}
+
+// CloudServicesClientListResponse contains the response from method CloudServicesClient.NewListPager.
+type CloudServicesClientListResponse struct {
+ // The list operation result.
+ CloudServiceListResult
+}
+
+// CloudServicesClientPowerOffResponse contains the response from method CloudServicesClient.BeginPowerOff.
+type CloudServicesClientPowerOffResponse struct {
+ // placeholder for future response values
+}
+
+// CloudServicesClientRebuildResponse contains the response from method CloudServicesClient.BeginRebuild.
+type CloudServicesClientRebuildResponse struct {
+ // placeholder for future response values
+}
+
+// CloudServicesClientReimageResponse contains the response from method CloudServicesClient.BeginReimage.
+type CloudServicesClientReimageResponse struct {
+ // placeholder for future response values
+}
+
+// CloudServicesClientRestartResponse contains the response from method CloudServicesClient.BeginRestart.
+type CloudServicesClientRestartResponse struct {
+ // placeholder for future response values
+}
+
+// CloudServicesClientStartResponse contains the response from method CloudServicesClient.BeginStart.
+type CloudServicesClientStartResponse struct {
+ // placeholder for future response values
+}
+
+// CloudServicesClientUpdateResponse contains the response from method CloudServicesClient.BeginUpdate.
+type CloudServicesClientUpdateResponse struct {
+ // Describes the cloud service.
+ CloudService
+}
+
+// CloudServicesUpdateDomainClientGetUpdateDomainResponse contains the response from method CloudServicesUpdateDomainClient.GetUpdateDomain.
+type CloudServicesUpdateDomainClientGetUpdateDomainResponse struct {
+ // Defines an update domain for the cloud service.
+ UpdateDomain
+}
+
+// CloudServicesUpdateDomainClientListUpdateDomainsResponse contains the response from method CloudServicesUpdateDomainClient.NewListUpdateDomainsPager.
+type CloudServicesUpdateDomainClientListUpdateDomainsResponse struct {
+ // The list operation result.
+ UpdateDomainListResult
+}
+
+// CloudServicesUpdateDomainClientWalkUpdateDomainResponse contains the response from method CloudServicesUpdateDomainClient.BeginWalkUpdateDomain.
+type CloudServicesUpdateDomainClientWalkUpdateDomainResponse struct {
+ // placeholder for future response values
+}
+
+// CommunityGalleriesClientGetResponse contains the response from method CommunityGalleriesClient.Get.
+type CommunityGalleriesClientGetResponse struct {
+ // Specifies information about the Community Gallery that you want to create or update.
+ CommunityGallery
+}
+
+// CommunityGalleryImageVersionsClientGetResponse contains the response from method CommunityGalleryImageVersionsClient.Get.
+type CommunityGalleryImageVersionsClientGetResponse struct {
+ // Specifies information about the gallery image version that you want to create or update.
+ CommunityGalleryImageVersion
+}
+
+// CommunityGalleryImageVersionsClientListResponse contains the response from method CommunityGalleryImageVersionsClient.NewListPager.
+type CommunityGalleryImageVersionsClientListResponse struct {
+ // The List Community Gallery Image versions operation response.
+ CommunityGalleryImageVersionList
+}
+
+// CommunityGalleryImagesClientGetResponse contains the response from method CommunityGalleryImagesClient.Get.
+type CommunityGalleryImagesClientGetResponse struct {
+ // Specifies information about the gallery image definition that you want to create or update.
+ CommunityGalleryImage
+}
+
+// CommunityGalleryImagesClientListResponse contains the response from method CommunityGalleryImagesClient.NewListPager.
+type CommunityGalleryImagesClientListResponse struct {
+ // The List Community Gallery Images operation response.
+ CommunityGalleryImageList
+}
+
+// DedicatedHostGroupsClientCreateOrUpdateResponse contains the response from method DedicatedHostGroupsClient.CreateOrUpdate.
+type DedicatedHostGroupsClientCreateOrUpdateResponse struct {
+ // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated
+ // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another
+ // dedicated host group.
+ DedicatedHostGroup
+}
+
+// DedicatedHostGroupsClientDeleteResponse contains the response from method DedicatedHostGroupsClient.Delete.
+type DedicatedHostGroupsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// DedicatedHostGroupsClientGetResponse contains the response from method DedicatedHostGroupsClient.Get.
+type DedicatedHostGroupsClientGetResponse struct {
+ // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated
+ // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another
+ // dedicated host group.
+ DedicatedHostGroup
+}
+
+// DedicatedHostGroupsClientListByResourceGroupResponse contains the response from method DedicatedHostGroupsClient.NewListByResourceGroupPager.
+type DedicatedHostGroupsClientListByResourceGroupResponse struct {
+ // The List Dedicated Host Group with resource group response.
+ DedicatedHostGroupListResult
+}
+
+// DedicatedHostGroupsClientListBySubscriptionResponse contains the response from method DedicatedHostGroupsClient.NewListBySubscriptionPager.
+type DedicatedHostGroupsClientListBySubscriptionResponse struct {
+ // The List Dedicated Host Group with resource group response.
+ DedicatedHostGroupListResult
+}
+
+// DedicatedHostGroupsClientUpdateResponse contains the response from method DedicatedHostGroupsClient.Update.
+type DedicatedHostGroupsClientUpdateResponse struct {
+ // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated
+ // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another
+ // dedicated host group.
+ DedicatedHostGroup
+}
+
+// DedicatedHostsClientCreateOrUpdateResponse contains the response from method DedicatedHostsClient.BeginCreateOrUpdate.
+type DedicatedHostsClientCreateOrUpdateResponse struct {
+ // Specifies information about the Dedicated host.
+ DedicatedHost
+}
+
+// DedicatedHostsClientDeleteResponse contains the response from method DedicatedHostsClient.BeginDelete.
+type DedicatedHostsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// DedicatedHostsClientGetResponse contains the response from method DedicatedHostsClient.Get.
+type DedicatedHostsClientGetResponse struct {
+ // Specifies information about the Dedicated host.
+ DedicatedHost
+}
+
+// DedicatedHostsClientListAvailableSizesResponse contains the response from method DedicatedHostsClient.NewListAvailableSizesPager.
+type DedicatedHostsClientListAvailableSizesResponse struct {
+ // The List Dedicated Host sizes operation response.
+ DedicatedHostSizeListResult
+}
+
+// DedicatedHostsClientListByHostGroupResponse contains the response from method DedicatedHostsClient.NewListByHostGroupPager.
+type DedicatedHostsClientListByHostGroupResponse struct {
+ // The list dedicated host operation response.
+ DedicatedHostListResult
+}
+
+// DedicatedHostsClientRestartResponse contains the response from method DedicatedHostsClient.BeginRestart.
+type DedicatedHostsClientRestartResponse struct {
+ // placeholder for future response values
+}
+
+// DedicatedHostsClientUpdateResponse contains the response from method DedicatedHostsClient.BeginUpdate.
+type DedicatedHostsClientUpdateResponse struct {
+ // Specifies information about the Dedicated host.
+ DedicatedHost
+}
+
+// DiskAccessesClientCreateOrUpdateResponse contains the response from method DiskAccessesClient.BeginCreateOrUpdate.
+type DiskAccessesClientCreateOrUpdateResponse struct {
+ // disk access resource.
+ DiskAccess
+}
+
+// DiskAccessesClientDeleteAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.BeginDeleteAPrivateEndpointConnection.
+type DiskAccessesClientDeleteAPrivateEndpointConnectionResponse struct {
+ // placeholder for future response values
+}
+
+// DiskAccessesClientDeleteResponse contains the response from method DiskAccessesClient.BeginDelete.
+type DiskAccessesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// DiskAccessesClientGetAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.GetAPrivateEndpointConnection.
+type DiskAccessesClientGetAPrivateEndpointConnectionResponse struct {
+ // The Private Endpoint Connection resource.
+ PrivateEndpointConnection
+}
+
+// DiskAccessesClientGetPrivateLinkResourcesResponse contains the response from method DiskAccessesClient.GetPrivateLinkResources.
+type DiskAccessesClientGetPrivateLinkResourcesResponse struct {
+ // A list of private link resources
+ PrivateLinkResourceListResult
+}
+
+// DiskAccessesClientGetResponse contains the response from method DiskAccessesClient.Get.
+type DiskAccessesClientGetResponse struct {
+ // disk access resource.
+ DiskAccess
+}
+
+// DiskAccessesClientListByResourceGroupResponse contains the response from method DiskAccessesClient.NewListByResourceGroupPager.
+type DiskAccessesClientListByResourceGroupResponse struct {
+ // The List disk access operation response.
+ DiskAccessList
+}
+
+// DiskAccessesClientListPrivateEndpointConnectionsResponse contains the response from method DiskAccessesClient.NewListPrivateEndpointConnectionsPager.
+type DiskAccessesClientListPrivateEndpointConnectionsResponse struct {
+ // A list of private link resources
+ PrivateEndpointConnectionListResult
+}
+
+// DiskAccessesClientListResponse contains the response from method DiskAccessesClient.NewListPager.
+type DiskAccessesClientListResponse struct {
+ // The List disk access operation response.
+ DiskAccessList
+}
+
+// DiskAccessesClientUpdateAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.BeginUpdateAPrivateEndpointConnection.
+type DiskAccessesClientUpdateAPrivateEndpointConnectionResponse struct {
+ // The Private Endpoint Connection resource.
+ PrivateEndpointConnection
+}
+
+// DiskAccessesClientUpdateResponse contains the response from method DiskAccessesClient.BeginUpdate.
+type DiskAccessesClientUpdateResponse struct {
+ // disk access resource.
+ DiskAccess
+}
+
+// DiskEncryptionSetsClientCreateOrUpdateResponse contains the response from method DiskEncryptionSetsClient.BeginCreateOrUpdate.
+type DiskEncryptionSetsClientCreateOrUpdateResponse struct {
+ // disk encryption set resource.
+ DiskEncryptionSet
+}
+
+// DiskEncryptionSetsClientDeleteResponse contains the response from method DiskEncryptionSetsClient.BeginDelete.
+type DiskEncryptionSetsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// DiskEncryptionSetsClientGetResponse contains the response from method DiskEncryptionSetsClient.Get.
+type DiskEncryptionSetsClientGetResponse struct {
+ // disk encryption set resource.
+ DiskEncryptionSet
+}
+
+// DiskEncryptionSetsClientListAssociatedResourcesResponse contains the response from method DiskEncryptionSetsClient.NewListAssociatedResourcesPager.
+type DiskEncryptionSetsClientListAssociatedResourcesResponse struct {
+ // The List resources which are encrypted with the disk encryption set.
+ ResourceURIList
+}
+
+// DiskEncryptionSetsClientListByResourceGroupResponse contains the response from method DiskEncryptionSetsClient.NewListByResourceGroupPager.
+type DiskEncryptionSetsClientListByResourceGroupResponse struct {
+ // The List disk encryption set operation response.
+ DiskEncryptionSetList
+}
+
+// DiskEncryptionSetsClientListResponse contains the response from method DiskEncryptionSetsClient.NewListPager.
+type DiskEncryptionSetsClientListResponse struct {
+ // The List disk encryption set operation response.
+ DiskEncryptionSetList
+}
+
+// DiskEncryptionSetsClientUpdateResponse contains the response from method DiskEncryptionSetsClient.BeginUpdate.
+type DiskEncryptionSetsClientUpdateResponse struct {
+ // disk encryption set resource.
+ DiskEncryptionSet
+}
+
+// DiskRestorePointClientGetResponse contains the response from method DiskRestorePointClient.Get.
+type DiskRestorePointClientGetResponse struct {
+ // Properties of disk restore point
+ DiskRestorePoint
+}
+
+// DiskRestorePointClientGrantAccessResponse contains the response from method DiskRestorePointClient.BeginGrantAccess.
+type DiskRestorePointClientGrantAccessResponse struct {
+ // A disk access SAS uri.
+ AccessURI
+}
+
+// DiskRestorePointClientListByRestorePointResponse contains the response from method DiskRestorePointClient.NewListByRestorePointPager.
+type DiskRestorePointClientListByRestorePointResponse struct {
+ // The List Disk Restore Points operation response.
+ DiskRestorePointList
+}
+
+// DiskRestorePointClientRevokeAccessResponse contains the response from method DiskRestorePointClient.BeginRevokeAccess.
+type DiskRestorePointClientRevokeAccessResponse struct {
+ // placeholder for future response values
+}
+
+// DisksClientCreateOrUpdateResponse contains the response from method DisksClient.BeginCreateOrUpdate.
+type DisksClientCreateOrUpdateResponse struct {
+ // Disk resource.
+ Disk
+}
+
+// DisksClientDeleteResponse contains the response from method DisksClient.BeginDelete.
+type DisksClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// DisksClientGetResponse contains the response from method DisksClient.Get.
+type DisksClientGetResponse struct {
+ // Disk resource.
+ Disk
+}
+
+// DisksClientGrantAccessResponse contains the response from method DisksClient.BeginGrantAccess.
+type DisksClientGrantAccessResponse struct {
+ // A disk access SAS uri.
+ AccessURI
+}
+
+// DisksClientListByResourceGroupResponse contains the response from method DisksClient.NewListByResourceGroupPager.
+type DisksClientListByResourceGroupResponse struct {
+ // The List Disks operation response.
+ DiskList
+}
+
+// DisksClientListResponse contains the response from method DisksClient.NewListPager.
+type DisksClientListResponse struct {
+ // The List Disks operation response.
+ DiskList
+}
+
+// DisksClientRevokeAccessResponse contains the response from method DisksClient.BeginRevokeAccess.
+type DisksClientRevokeAccessResponse struct {
+ // placeholder for future response values
+}
+
+// DisksClientUpdateResponse contains the response from method DisksClient.BeginUpdate.
+type DisksClientUpdateResponse struct {
+ // Disk resource.
+ Disk
+}
+
+// GalleriesClientCreateOrUpdateResponse contains the response from method GalleriesClient.BeginCreateOrUpdate.
+type GalleriesClientCreateOrUpdateResponse struct {
+ // Specifies information about the Shared Image Gallery that you want to create or update.
+ Gallery
+}
+
+// GalleriesClientDeleteResponse contains the response from method GalleriesClient.BeginDelete.
+type GalleriesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// GalleriesClientGetResponse contains the response from method GalleriesClient.Get.
+type GalleriesClientGetResponse struct {
+ // Specifies information about the Shared Image Gallery that you want to create or update.
+ Gallery
+}
+
+// GalleriesClientListByResourceGroupResponse contains the response from method GalleriesClient.NewListByResourceGroupPager.
+type GalleriesClientListByResourceGroupResponse struct {
+ // The List Galleries operation response.
+ GalleryList
+}
+
+// GalleriesClientListResponse contains the response from method GalleriesClient.NewListPager.
+type GalleriesClientListResponse struct {
+ // The List Galleries operation response.
+ GalleryList
+}
+
+// GalleriesClientUpdateResponse contains the response from method GalleriesClient.BeginUpdate.
+type GalleriesClientUpdateResponse struct {
+ // Specifies information about the Shared Image Gallery that you want to create or update.
+ Gallery
+}
+
+// GalleryApplicationVersionsClientCreateOrUpdateResponse contains the response from method GalleryApplicationVersionsClient.BeginCreateOrUpdate.
+type GalleryApplicationVersionsClientCreateOrUpdateResponse struct {
+ // Specifies information about the gallery Application Version that you want to create or update.
+ GalleryApplicationVersion
+}
+
+// GalleryApplicationVersionsClientDeleteResponse contains the response from method GalleryApplicationVersionsClient.BeginDelete.
+type GalleryApplicationVersionsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// GalleryApplicationVersionsClientGetResponse contains the response from method GalleryApplicationVersionsClient.Get.
+type GalleryApplicationVersionsClientGetResponse struct {
+ // Specifies information about the gallery Application Version that you want to create or update.
+ GalleryApplicationVersion
+}
+
+// GalleryApplicationVersionsClientListByGalleryApplicationResponse contains the response from method GalleryApplicationVersionsClient.NewListByGalleryApplicationPager.
+type GalleryApplicationVersionsClientListByGalleryApplicationResponse struct {
+ // The List Gallery Application version operation response.
+ GalleryApplicationVersionList
+}
+
+// GalleryApplicationVersionsClientUpdateResponse contains the response from method GalleryApplicationVersionsClient.BeginUpdate.
+type GalleryApplicationVersionsClientUpdateResponse struct {
+ // Specifies information about the gallery Application Version that you want to create or update.
+ GalleryApplicationVersion
+}
+
+// GalleryApplicationsClientCreateOrUpdateResponse contains the response from method GalleryApplicationsClient.BeginCreateOrUpdate.
+type GalleryApplicationsClientCreateOrUpdateResponse struct {
+ // Specifies information about the gallery Application Definition that you want to create or update.
+ GalleryApplication
+}
+
+// GalleryApplicationsClientDeleteResponse contains the response from method GalleryApplicationsClient.BeginDelete.
+type GalleryApplicationsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// GalleryApplicationsClientGetResponse contains the response from method GalleryApplicationsClient.Get.
+type GalleryApplicationsClientGetResponse struct {
+ // Specifies information about the gallery Application Definition that you want to create or update.
+ GalleryApplication
+}
+
+// GalleryApplicationsClientListByGalleryResponse contains the response from method GalleryApplicationsClient.NewListByGalleryPager.
+type GalleryApplicationsClientListByGalleryResponse struct {
+ // The List Gallery Applications operation response.
+ GalleryApplicationList
+}
+
+// GalleryApplicationsClientUpdateResponse contains the response from method GalleryApplicationsClient.BeginUpdate.
+type GalleryApplicationsClientUpdateResponse struct {
+ // Specifies information about the gallery Application Definition that you want to create or update.
+ GalleryApplication
+}
+
+// GalleryImageVersionsClientCreateOrUpdateResponse contains the response from method GalleryImageVersionsClient.BeginCreateOrUpdate.
+type GalleryImageVersionsClientCreateOrUpdateResponse struct {
+ // Specifies information about the gallery image version that you want to create or update.
+ GalleryImageVersion
+}
+
+// GalleryImageVersionsClientDeleteResponse contains the response from method GalleryImageVersionsClient.BeginDelete.
+type GalleryImageVersionsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// GalleryImageVersionsClientGetResponse contains the response from method GalleryImageVersionsClient.Get.
+type GalleryImageVersionsClientGetResponse struct {
+ // Specifies information about the gallery image version that you want to create or update.
+ GalleryImageVersion
+}
+
+// GalleryImageVersionsClientListByGalleryImageResponse contains the response from method GalleryImageVersionsClient.NewListByGalleryImagePager.
+type GalleryImageVersionsClientListByGalleryImageResponse struct {
+ // The List Gallery Image version operation response.
+ GalleryImageVersionList
+}
+
+// GalleryImageVersionsClientUpdateResponse contains the response from method GalleryImageVersionsClient.BeginUpdate.
+type GalleryImageVersionsClientUpdateResponse struct {
+ // Specifies information about the gallery image version that you want to create or update.
+ GalleryImageVersion
+}
+
+// GalleryImagesClientCreateOrUpdateResponse contains the response from method GalleryImagesClient.BeginCreateOrUpdate.
+type GalleryImagesClientCreateOrUpdateResponse struct {
+ // Specifies information about the gallery image definition that you want to create or update.
+ GalleryImage
+}
+
+// GalleryImagesClientDeleteResponse contains the response from method GalleryImagesClient.BeginDelete.
+type GalleryImagesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// GalleryImagesClientGetResponse contains the response from method GalleryImagesClient.Get.
+type GalleryImagesClientGetResponse struct {
+ // Specifies information about the gallery image definition that you want to create or update.
+ GalleryImage
+}
+
+// GalleryImagesClientListByGalleryResponse contains the response from method GalleryImagesClient.NewListByGalleryPager.
+type GalleryImagesClientListByGalleryResponse struct {
+ // The List Gallery Images operation response.
+ GalleryImageList
+}
+
+// GalleryImagesClientUpdateResponse contains the response from method GalleryImagesClient.BeginUpdate.
+type GalleryImagesClientUpdateResponse struct {
+ // Specifies information about the gallery image definition that you want to create or update.
+ GalleryImage
+}
+
+// GallerySharingProfileClientUpdateResponse contains the response from method GallerySharingProfileClient.BeginUpdate.
+type GallerySharingProfileClientUpdateResponse struct {
+ // Specifies information about the gallery sharing profile update.
+ SharingUpdate
+}
+
+// ImagesClientCreateOrUpdateResponse contains the response from method ImagesClient.BeginCreateOrUpdate.
+type ImagesClientCreateOrUpdateResponse struct {
+ // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine.
+ // If SourceImage is provided, the destination virtual hard drive must not exist.
+ Image
+}
+
+// ImagesClientDeleteResponse contains the response from method ImagesClient.BeginDelete.
+type ImagesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// ImagesClientGetResponse contains the response from method ImagesClient.Get.
+type ImagesClientGetResponse struct {
+ // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine.
+ // If SourceImage is provided, the destination virtual hard drive must not exist.
+ Image
+}
+
+// ImagesClientListByResourceGroupResponse contains the response from method ImagesClient.NewListByResourceGroupPager.
+type ImagesClientListByResourceGroupResponse struct {
+ // The List Image operation response.
+ ImageListResult
+}
+
+// ImagesClientListResponse contains the response from method ImagesClient.NewListPager.
+type ImagesClientListResponse struct {
+ // The List Image operation response.
+ ImageListResult
+}
+
+// ImagesClientUpdateResponse contains the response from method ImagesClient.BeginUpdate.
+type ImagesClientUpdateResponse struct {
+ // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine.
+ // If SourceImage is provided, the destination virtual hard drive must not exist.
+ Image
+}
+
+// LogAnalyticsClientExportRequestRateByIntervalResponse contains the response from method LogAnalyticsClient.BeginExportRequestRateByInterval.
+type LogAnalyticsClientExportRequestRateByIntervalResponse struct {
+ // LogAnalytics operation status response
+ LogAnalyticsOperationResult
+}
+
+// LogAnalyticsClientExportThrottledRequestsResponse contains the response from method LogAnalyticsClient.BeginExportThrottledRequests.
+type LogAnalyticsClientExportThrottledRequestsResponse struct {
+ // LogAnalytics operation status response
+ LogAnalyticsOperationResult
+}
+
+// OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
+type OperationsClientListResponse struct {
+ // The List Compute Operation operation response.
+ OperationListResult
+}
+
+// ProximityPlacementGroupsClientCreateOrUpdateResponse contains the response from method ProximityPlacementGroupsClient.CreateOrUpdate.
+type ProximityPlacementGroupsClientCreateOrUpdateResponse struct {
+ // Specifies information about the proximity placement group.
+ ProximityPlacementGroup
+}
+
+// ProximityPlacementGroupsClientDeleteResponse contains the response from method ProximityPlacementGroupsClient.Delete.
+type ProximityPlacementGroupsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// ProximityPlacementGroupsClientGetResponse contains the response from method ProximityPlacementGroupsClient.Get.
+type ProximityPlacementGroupsClientGetResponse struct {
+ // Specifies information about the proximity placement group.
+ ProximityPlacementGroup
+}
+
+// ProximityPlacementGroupsClientListByResourceGroupResponse contains the response from method ProximityPlacementGroupsClient.NewListByResourceGroupPager.
+type ProximityPlacementGroupsClientListByResourceGroupResponse struct {
+ // The List Proximity Placement Group operation response.
+ ProximityPlacementGroupListResult
+}
+
+// ProximityPlacementGroupsClientListBySubscriptionResponse contains the response from method ProximityPlacementGroupsClient.NewListBySubscriptionPager.
+type ProximityPlacementGroupsClientListBySubscriptionResponse struct {
+ // The List Proximity Placement Group operation response.
+ ProximityPlacementGroupListResult
+}
+
+// ProximityPlacementGroupsClientUpdateResponse contains the response from method ProximityPlacementGroupsClient.Update.
+type ProximityPlacementGroupsClientUpdateResponse struct {
+ // Specifies information about the proximity placement group.
+ ProximityPlacementGroup
+}
+
+// ResourceSKUsClientListResponse contains the response from method ResourceSKUsClient.NewListPager.
+type ResourceSKUsClientListResponse struct {
+ // The List Resource Skus operation response.
+ ResourceSKUsResult
+}
+
+// RestorePointCollectionsClientCreateOrUpdateResponse contains the response from method RestorePointCollectionsClient.CreateOrUpdate.
+type RestorePointCollectionsClientCreateOrUpdateResponse struct {
+ // Create or update Restore Point collection parameters.
+ RestorePointCollection
+}
+
+// RestorePointCollectionsClientDeleteResponse contains the response from method RestorePointCollectionsClient.BeginDelete.
+type RestorePointCollectionsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// RestorePointCollectionsClientGetResponse contains the response from method RestorePointCollectionsClient.Get.
+type RestorePointCollectionsClientGetResponse struct {
+ // Create or update Restore Point collection parameters.
+ RestorePointCollection
+}
+
+// RestorePointCollectionsClientListAllResponse contains the response from method RestorePointCollectionsClient.NewListAllPager.
+type RestorePointCollectionsClientListAllResponse struct {
+ // The List restore point collection operation response.
+ RestorePointCollectionListResult
+}
+
+// RestorePointCollectionsClientListResponse contains the response from method RestorePointCollectionsClient.NewListPager.
+type RestorePointCollectionsClientListResponse struct {
+ // The List restore point collection operation response.
+ RestorePointCollectionListResult
+}
+
+// RestorePointCollectionsClientUpdateResponse contains the response from method RestorePointCollectionsClient.Update.
+type RestorePointCollectionsClientUpdateResponse struct {
+ // Create or update Restore Point collection parameters.
+ RestorePointCollection
+}
+
+// RestorePointsClientCreateResponse contains the response from method RestorePointsClient.BeginCreate.
+type RestorePointsClientCreateResponse struct {
+ // Restore Point details.
+ RestorePoint
+}
+
+// RestorePointsClientDeleteResponse contains the response from method RestorePointsClient.BeginDelete.
+type RestorePointsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// RestorePointsClientGetResponse contains the response from method RestorePointsClient.Get.
+type RestorePointsClientGetResponse struct {
+ // Restore Point details.
+ RestorePoint
+}
+
+// SSHPublicKeysClientCreateResponse contains the response from method SSHPublicKeysClient.Create.
+type SSHPublicKeysClientCreateResponse struct {
+ // Specifies information about the SSH public key.
+ SSHPublicKeyResource
+}
+
+// SSHPublicKeysClientDeleteResponse contains the response from method SSHPublicKeysClient.Delete.
+type SSHPublicKeysClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// SSHPublicKeysClientGenerateKeyPairResponse contains the response from method SSHPublicKeysClient.GenerateKeyPair.
+type SSHPublicKeysClientGenerateKeyPairResponse struct {
+ // Response from generation of an SSH key pair.
+ SSHPublicKeyGenerateKeyPairResult
+}
+
+// SSHPublicKeysClientGetResponse contains the response from method SSHPublicKeysClient.Get.
+type SSHPublicKeysClientGetResponse struct {
+ // Specifies information about the SSH public key.
+ SSHPublicKeyResource
+}
+
+// SSHPublicKeysClientListByResourceGroupResponse contains the response from method SSHPublicKeysClient.NewListByResourceGroupPager.
+type SSHPublicKeysClientListByResourceGroupResponse struct {
+ // The list SSH public keys operation response.
+ SSHPublicKeysGroupListResult
+}
+
+// SSHPublicKeysClientListBySubscriptionResponse contains the response from method SSHPublicKeysClient.NewListBySubscriptionPager.
+type SSHPublicKeysClientListBySubscriptionResponse struct {
+ // The list SSH public keys operation response.
+ SSHPublicKeysGroupListResult
+}
+
+// SSHPublicKeysClientUpdateResponse contains the response from method SSHPublicKeysClient.Update.
+type SSHPublicKeysClientUpdateResponse struct {
+ // Specifies information about the SSH public key.
+ SSHPublicKeyResource
+}
+
+// SharedGalleriesClientGetResponse contains the response from method SharedGalleriesClient.Get.
+type SharedGalleriesClientGetResponse struct {
+ // Specifies information about the Shared Gallery that you want to create or update.
+ SharedGallery
+}
+
+// SharedGalleriesClientListResponse contains the response from method SharedGalleriesClient.NewListPager.
+type SharedGalleriesClientListResponse struct {
+ // The List Shared Galleries operation response.
+ SharedGalleryList
+}
+
+// SharedGalleryImageVersionsClientGetResponse contains the response from method SharedGalleryImageVersionsClient.Get.
+type SharedGalleryImageVersionsClientGetResponse struct {
+ // Specifies information about the gallery image version that you want to create or update.
+ SharedGalleryImageVersion
+}
+
+// SharedGalleryImageVersionsClientListResponse contains the response from method SharedGalleryImageVersionsClient.NewListPager.
+type SharedGalleryImageVersionsClientListResponse struct {
+ // The List Shared Gallery Image versions operation response.
+ SharedGalleryImageVersionList
+}
+
+// SharedGalleryImagesClientGetResponse contains the response from method SharedGalleryImagesClient.Get.
+type SharedGalleryImagesClientGetResponse struct {
+ // Specifies information about the gallery image definition that you want to create or update.
+ SharedGalleryImage
+}
+
+// SharedGalleryImagesClientListResponse contains the response from method SharedGalleryImagesClient.NewListPager.
+type SharedGalleryImagesClientListResponse struct {
+ // The List Shared Gallery Images operation response.
+ SharedGalleryImageList
+}
+
+// SnapshotsClientCreateOrUpdateResponse contains the response from method SnapshotsClient.BeginCreateOrUpdate.
+type SnapshotsClientCreateOrUpdateResponse struct {
+ // Snapshot resource.
+ Snapshot
+}
+
+// SnapshotsClientDeleteResponse contains the response from method SnapshotsClient.BeginDelete.
+type SnapshotsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// SnapshotsClientGetResponse contains the response from method SnapshotsClient.Get.
+type SnapshotsClientGetResponse struct {
+ // Snapshot resource.
+ Snapshot
+}
+
+// SnapshotsClientGrantAccessResponse contains the response from method SnapshotsClient.BeginGrantAccess.
+type SnapshotsClientGrantAccessResponse struct {
+ // A disk access SAS uri.
+ AccessURI
+}
+
+// SnapshotsClientListByResourceGroupResponse contains the response from method SnapshotsClient.NewListByResourceGroupPager.
+type SnapshotsClientListByResourceGroupResponse struct {
+ // The List Snapshots operation response.
+ SnapshotList
+}
+
+// SnapshotsClientListResponse contains the response from method SnapshotsClient.NewListPager.
+type SnapshotsClientListResponse struct {
+ // The List Snapshots operation response.
+ SnapshotList
+}
+
+// SnapshotsClientRevokeAccessResponse contains the response from method SnapshotsClient.BeginRevokeAccess.
+type SnapshotsClientRevokeAccessResponse struct {
+ // placeholder for future response values
+}
+
+// SnapshotsClientUpdateResponse contains the response from method SnapshotsClient.BeginUpdate.
+type SnapshotsClientUpdateResponse struct {
+ // Snapshot resource.
+ Snapshot
+}
+
+// UsageClientListResponse contains the response from method UsageClient.NewListPager.
+type UsageClientListResponse struct {
+ // The List Usages operation response.
+ ListUsagesResult
+}
+
+// VirtualMachineExtensionImagesClientGetResponse contains the response from method VirtualMachineExtensionImagesClient.Get.
+type VirtualMachineExtensionImagesClientGetResponse struct {
+ // Describes a Virtual Machine Extension Image.
+ VirtualMachineExtensionImage
+}
+
+// VirtualMachineExtensionImagesClientListTypesResponse contains the response from method VirtualMachineExtensionImagesClient.ListTypes.
+type VirtualMachineExtensionImagesClientListTypesResponse struct {
+ // Array of VirtualMachineExtensionImage
+ VirtualMachineExtensionImageArray []*VirtualMachineExtensionImage
+}
+
+// VirtualMachineExtensionImagesClientListVersionsResponse contains the response from method VirtualMachineExtensionImagesClient.ListVersions.
+type VirtualMachineExtensionImagesClientListVersionsResponse struct {
+ // Array of VirtualMachineExtensionImage
+ VirtualMachineExtensionImageArray []*VirtualMachineExtensionImage
+}
+
+// VirtualMachineExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineExtensionsClient.BeginCreateOrUpdate.
+type VirtualMachineExtensionsClientCreateOrUpdateResponse struct {
+ // Describes a Virtual Machine Extension.
+ VirtualMachineExtension
+}
+
+// VirtualMachineExtensionsClientDeleteResponse contains the response from method VirtualMachineExtensionsClient.BeginDelete.
+type VirtualMachineExtensionsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineExtensionsClientGetResponse contains the response from method VirtualMachineExtensionsClient.Get.
+type VirtualMachineExtensionsClientGetResponse struct {
+ // Describes a Virtual Machine Extension.
+ VirtualMachineExtension
+}
+
+// VirtualMachineExtensionsClientListResponse contains the response from method VirtualMachineExtensionsClient.List.
+type VirtualMachineExtensionsClientListResponse struct {
+ // The List Extension operation response
+ VirtualMachineExtensionsListResult
+}
+
+// VirtualMachineExtensionsClientUpdateResponse contains the response from method VirtualMachineExtensionsClient.BeginUpdate.
+type VirtualMachineExtensionsClientUpdateResponse struct {
+ // Describes a Virtual Machine Extension.
+ VirtualMachineExtension
+}
+
+// VirtualMachineImagesClientGetResponse contains the response from method VirtualMachineImagesClient.Get.
+type VirtualMachineImagesClientGetResponse struct {
+ // Describes a Virtual Machine Image.
+ VirtualMachineImage
+}
+
+// VirtualMachineImagesClientListByEdgeZoneResponse contains the response from method VirtualMachineImagesClient.ListByEdgeZone.
+type VirtualMachineImagesClientListByEdgeZoneResponse struct {
+ // The List VmImages in EdgeZone operation response.
+ VMImagesInEdgeZoneListResult
+}
+
+// VirtualMachineImagesClientListOffersResponse contains the response from method VirtualMachineImagesClient.ListOffers.
+type VirtualMachineImagesClientListOffersResponse struct {
+ // Array of VirtualMachineImageResource
+ VirtualMachineImageResourceArray []*VirtualMachineImageResource
+}
+
+// VirtualMachineImagesClientListPublishersResponse contains the response from method VirtualMachineImagesClient.ListPublishers.
+type VirtualMachineImagesClientListPublishersResponse struct {
+ // Array of VirtualMachineImageResource
+ VirtualMachineImageResourceArray []*VirtualMachineImageResource
+}
+
+// VirtualMachineImagesClientListResponse contains the response from method VirtualMachineImagesClient.List.
+type VirtualMachineImagesClientListResponse struct {
+ // Array of VirtualMachineImageResource
+ VirtualMachineImageResourceArray []*VirtualMachineImageResource
+}
+
+// VirtualMachineImagesClientListSKUsResponse contains the response from method VirtualMachineImagesClient.ListSKUs.
+type VirtualMachineImagesClientListSKUsResponse struct {
+ // Array of VirtualMachineImageResource
+ VirtualMachineImageResourceArray []*VirtualMachineImageResource
+}
+
+// VirtualMachineImagesEdgeZoneClientGetResponse contains the response from method VirtualMachineImagesEdgeZoneClient.Get.
+type VirtualMachineImagesEdgeZoneClientGetResponse struct {
+ // Describes a Virtual Machine Image.
+ VirtualMachineImage
+}
+
+// VirtualMachineImagesEdgeZoneClientListOffersResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListOffers.
+type VirtualMachineImagesEdgeZoneClientListOffersResponse struct {
+ // Array of VirtualMachineImageResource
+ VirtualMachineImageResourceArray []*VirtualMachineImageResource
+}
+
+// VirtualMachineImagesEdgeZoneClientListPublishersResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListPublishers.
+type VirtualMachineImagesEdgeZoneClientListPublishersResponse struct {
+ // Array of VirtualMachineImageResource
+ VirtualMachineImageResourceArray []*VirtualMachineImageResource
+}
+
+// VirtualMachineImagesEdgeZoneClientListResponse contains the response from method VirtualMachineImagesEdgeZoneClient.List.
+type VirtualMachineImagesEdgeZoneClientListResponse struct {
+ // Array of VirtualMachineImageResource
+ VirtualMachineImageResourceArray []*VirtualMachineImageResource
+}
+
+// VirtualMachineImagesEdgeZoneClientListSKUsResponse contains the response from method VirtualMachineImagesEdgeZoneClient.ListSKUs.
+type VirtualMachineImagesEdgeZoneClientListSKUsResponse struct {
+ // Array of VirtualMachineImageResource
+ VirtualMachineImageResourceArray []*VirtualMachineImageResource
+}
+
+// VirtualMachineRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineRunCommandsClient.BeginCreateOrUpdate.
+type VirtualMachineRunCommandsClientCreateOrUpdateResponse struct {
+ // Describes a Virtual Machine run command.
+ VirtualMachineRunCommand
+}
+
+// VirtualMachineRunCommandsClientDeleteResponse contains the response from method VirtualMachineRunCommandsClient.BeginDelete.
+type VirtualMachineRunCommandsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineRunCommandsClientGetByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.GetByVirtualMachine.
+type VirtualMachineRunCommandsClientGetByVirtualMachineResponse struct {
+ // Describes a Virtual Machine run command.
+ VirtualMachineRunCommand
+}
+
+// VirtualMachineRunCommandsClientGetResponse contains the response from method VirtualMachineRunCommandsClient.Get.
+type VirtualMachineRunCommandsClientGetResponse struct {
+ // Describes the properties of a Run Command.
+ RunCommandDocument
+}
+
+// VirtualMachineRunCommandsClientListByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.NewListByVirtualMachinePager.
+type VirtualMachineRunCommandsClientListByVirtualMachineResponse struct {
+ // The List run command operation response
+ VirtualMachineRunCommandsListResult
+}
+
+// VirtualMachineRunCommandsClientListResponse contains the response from method VirtualMachineRunCommandsClient.NewListPager.
+type VirtualMachineRunCommandsClientListResponse struct {
+ // The List Virtual Machine operation response.
+ RunCommandListResult
+}
+
+// VirtualMachineRunCommandsClientUpdateResponse contains the response from method VirtualMachineRunCommandsClient.BeginUpdate.
+type VirtualMachineRunCommandsClientUpdateResponse struct {
+ // Describes a Virtual Machine run command.
+ VirtualMachineRunCommand
+}
+
+// VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate.
+type VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse struct {
+ // Describes a Virtual Machine Scale Set Extension.
+ VirtualMachineScaleSetExtension
+}
+
+// VirtualMachineScaleSetExtensionsClientDeleteResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginDelete.
+type VirtualMachineScaleSetExtensionsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetExtensionsClient.Get.
+type VirtualMachineScaleSetExtensionsClientGetResponse struct {
+ // Describes a Virtual Machine Scale Set Extension.
+ VirtualMachineScaleSetExtension
+}
+
+// VirtualMachineScaleSetExtensionsClientListResponse contains the response from method VirtualMachineScaleSetExtensionsClient.NewListPager.
+type VirtualMachineScaleSetExtensionsClientListResponse struct {
+ // The List VM scale set extension operation response.
+ VirtualMachineScaleSetExtensionListResult
+}
+
+// VirtualMachineScaleSetExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginUpdate.
+type VirtualMachineScaleSetExtensionsClientUpdateResponse struct {
+ // Describes a Virtual Machine Scale Set Extension.
+ VirtualMachineScaleSetExtension
+}
+
+// VirtualMachineScaleSetRollingUpgradesClientCancelResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginCancel.
+type VirtualMachineScaleSetRollingUpgradesClientCancelResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.GetLatest.
+type VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse struct {
+ // The status of the latest virtual machine scale set rolling upgrade.
+ RollingUpgradeStatusInfo
+}
+
+// VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade.
+type VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade.
+type VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate.
+type VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse struct {
+ // Describes a VMSS VM Extension.
+ VirtualMachineScaleSetVMExtension
+}
+
+// VirtualMachineScaleSetVMExtensionsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginDelete.
+type VirtualMachineScaleSetVMExtensionsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.Get.
+type VirtualMachineScaleSetVMExtensionsClientGetResponse struct {
+ // Describes a VMSS VM Extension.
+ VirtualMachineScaleSetVMExtension
+}
+
+// VirtualMachineScaleSetVMExtensionsClientListResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.List.
+type VirtualMachineScaleSetVMExtensionsClientListResponse struct {
+ // The List VMSS VM Extension operation response
+ VirtualMachineScaleSetVMExtensionsListResult
+}
+
+// VirtualMachineScaleSetVMExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginUpdate.
+type VirtualMachineScaleSetVMExtensionsClientUpdateResponse struct {
+ // Describes a VMSS VM Extension.
+ VirtualMachineScaleSetVMExtension
+}
+
+// VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate.
+type VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse struct {
+ // Describes a Virtual Machine run command.
+ VirtualMachineRunCommand
+}
+
+// VirtualMachineScaleSetVMRunCommandsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginDelete.
+type VirtualMachineScaleSetVMRunCommandsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMRunCommandsClientGetResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.Get.
+type VirtualMachineScaleSetVMRunCommandsClientGetResponse struct {
+ // Describes a Virtual Machine run command.
+ VirtualMachineRunCommand
+}
+
+// VirtualMachineScaleSetVMRunCommandsClientListResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.NewListPager.
+type VirtualMachineScaleSetVMRunCommandsClientListResponse struct {
+ // The List run command operation response
+ VirtualMachineRunCommandsListResult
+}
+
+// VirtualMachineScaleSetVMRunCommandsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate.
+type VirtualMachineScaleSetVMRunCommandsClientUpdateResponse struct {
+ // Describes a Virtual Machine run command.
+ VirtualMachineRunCommand
+}
+
+// VirtualMachineScaleSetVMsClientDeallocateResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginDeallocate.
+type VirtualMachineScaleSetVMsClientDeallocateResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMsClientDeleteResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginDelete.
+type VirtualMachineScaleSetVMsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetVMsClient.GetInstanceView.
+type VirtualMachineScaleSetVMsClientGetInstanceViewResponse struct {
+ // The instance view of a virtual machine scale set VM.
+ VirtualMachineScaleSetVMInstanceView
+}
+
+// VirtualMachineScaleSetVMsClientGetResponse contains the response from method VirtualMachineScaleSetVMsClient.Get.
+type VirtualMachineScaleSetVMsClientGetResponse struct {
+ // Describes a virtual machine scale set virtual machine.
+ VirtualMachineScaleSetVM
+}
+
+// VirtualMachineScaleSetVMsClientListResponse contains the response from method VirtualMachineScaleSetVMsClient.NewListPager.
+type VirtualMachineScaleSetVMsClientListResponse struct {
+ // The List Virtual Machine Scale Set VMs operation response.
+ VirtualMachineScaleSetVMListResult
+}
+
+// VirtualMachineScaleSetVMsClientPerformMaintenanceResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginPerformMaintenance.
+type VirtualMachineScaleSetVMsClientPerformMaintenanceResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMsClientPowerOffResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginPowerOff.
+type VirtualMachineScaleSetVMsClientPowerOffResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMsClientRedeployResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRedeploy.
+type VirtualMachineScaleSetVMsClientRedeployResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMsClientReimageAllResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginReimageAll.
+type VirtualMachineScaleSetVMsClientReimageAllResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMsClientReimageResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginReimage.
+type VirtualMachineScaleSetVMsClientReimageResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMsClientRestartResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRestart.
+type VirtualMachineScaleSetVMsClientRestartResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData.
+type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse struct {
+ // The SAS URIs of the console screenshot and serial log blobs.
+ RetrieveBootDiagnosticsDataResult
+}
+
+// VirtualMachineScaleSetVMsClientRunCommandResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginRunCommand.
+type VirtualMachineScaleSetVMsClientRunCommandResponse struct {
+ RunCommandResult
+}
+
+// VirtualMachineScaleSetVMsClientSimulateEvictionResponse contains the response from method VirtualMachineScaleSetVMsClient.SimulateEviction.
+type VirtualMachineScaleSetVMsClientSimulateEvictionResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMsClientStartResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginStart.
+type VirtualMachineScaleSetVMsClientStartResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetVMsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginUpdate.
+type VirtualMachineScaleSetVMsClientUpdateResponse struct {
+ // Describes a virtual machine scale set virtual machine.
+ VirtualMachineScaleSetVM
+}
+
+// VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse contains the response from method VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup.
+type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetsClient.BeginCreateOrUpdate.
+type VirtualMachineScaleSetsClientCreateOrUpdateResponse struct {
+ // Describes a Virtual Machine Scale Set.
+ VirtualMachineScaleSet
+}
+
+// VirtualMachineScaleSetsClientDeallocateResponse contains the response from method VirtualMachineScaleSetsClient.BeginDeallocate.
+type VirtualMachineScaleSetsClientDeallocateResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientDeleteInstancesResponse contains the response from method VirtualMachineScaleSetsClient.BeginDeleteInstances.
+type VirtualMachineScaleSetsClientDeleteInstancesResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientDeleteResponse contains the response from method VirtualMachineScaleSetsClient.BeginDelete.
+type VirtualMachineScaleSetsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse contains the response from method
+// VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk.
+type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse struct {
+ // Response after calling a manual recovery walk
+ RecoveryWalkResponse
+}
+
+// VirtualMachineScaleSetsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetsClient.GetInstanceView.
+type VirtualMachineScaleSetsClientGetInstanceViewResponse struct {
+ // The instance view of a virtual machine scale set.
+ VirtualMachineScaleSetInstanceView
+}
+
+// VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse contains the response from method VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager.
+type VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse struct {
+ // List of Virtual Machine Scale Set OS Upgrade History operation response.
+ VirtualMachineScaleSetListOSUpgradeHistory
+}
+
+// VirtualMachineScaleSetsClientGetResponse contains the response from method VirtualMachineScaleSetsClient.Get.
+type VirtualMachineScaleSetsClientGetResponse struct {
+ // Describes a Virtual Machine Scale Set.
+ VirtualMachineScaleSet
+}
+
+// VirtualMachineScaleSetsClientListAllResponse contains the response from method VirtualMachineScaleSetsClient.NewListAllPager.
+type VirtualMachineScaleSetsClientListAllResponse struct {
+ // The List Virtual Machine operation response.
+ VirtualMachineScaleSetListWithLinkResult
+}
+
+// VirtualMachineScaleSetsClientListByLocationResponse contains the response from method VirtualMachineScaleSetsClient.NewListByLocationPager.
+type VirtualMachineScaleSetsClientListByLocationResponse struct {
+ // The List Virtual Machine operation response.
+ VirtualMachineScaleSetListResult
+}
+
+// VirtualMachineScaleSetsClientListResponse contains the response from method VirtualMachineScaleSetsClient.NewListPager.
+type VirtualMachineScaleSetsClientListResponse struct {
+ // The List Virtual Machine operation response.
+ VirtualMachineScaleSetListResult
+}
+
+// VirtualMachineScaleSetsClientListSKUsResponse contains the response from method VirtualMachineScaleSetsClient.NewListSKUsPager.
+type VirtualMachineScaleSetsClientListSKUsResponse struct {
+ // The Virtual Machine Scale Set List Skus operation response.
+ VirtualMachineScaleSetListSKUsResult
+}
+
+// VirtualMachineScaleSetsClientPerformMaintenanceResponse contains the response from method VirtualMachineScaleSetsClient.BeginPerformMaintenance.
+type VirtualMachineScaleSetsClientPerformMaintenanceResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientPowerOffResponse contains the response from method VirtualMachineScaleSetsClient.BeginPowerOff.
+type VirtualMachineScaleSetsClientPowerOffResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientReapplyResponse contains the response from method VirtualMachineScaleSetsClient.BeginReapply.
+type VirtualMachineScaleSetsClientReapplyResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientRedeployResponse contains the response from method VirtualMachineScaleSetsClient.BeginRedeploy.
+type VirtualMachineScaleSetsClientRedeployResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientReimageAllResponse contains the response from method VirtualMachineScaleSetsClient.BeginReimageAll.
+type VirtualMachineScaleSetsClientReimageAllResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientReimageResponse contains the response from method VirtualMachineScaleSetsClient.BeginReimage.
+type VirtualMachineScaleSetsClientReimageResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientRestartResponse contains the response from method VirtualMachineScaleSetsClient.BeginRestart.
+type VirtualMachineScaleSetsClientRestartResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse contains the response from method VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState.
+type VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientStartResponse contains the response from method VirtualMachineScaleSetsClient.BeginStart.
+type VirtualMachineScaleSetsClientStartResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientUpdateInstancesResponse contains the response from method VirtualMachineScaleSetsClient.BeginUpdateInstances.
+type VirtualMachineScaleSetsClientUpdateInstancesResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachineScaleSetsClientUpdateResponse contains the response from method VirtualMachineScaleSetsClient.BeginUpdate.
+type VirtualMachineScaleSetsClientUpdateResponse struct {
+ // Describes a Virtual Machine Scale Set.
+ VirtualMachineScaleSet
+}
+
+// VirtualMachineSizesClientListResponse contains the response from method VirtualMachineSizesClient.NewListPager.
+type VirtualMachineSizesClientListResponse struct {
+ // The List Virtual Machine operation response.
+ VirtualMachineSizeListResult
+}
+
+// VirtualMachinesClientAssessPatchesResponse contains the response from method VirtualMachinesClient.BeginAssessPatches.
+type VirtualMachinesClientAssessPatchesResponse struct {
+ // Describes the properties of an AssessPatches result.
+ VirtualMachineAssessPatchesResult
+}
+
+// VirtualMachinesClientCaptureResponse contains the response from method VirtualMachinesClient.BeginCapture.
+type VirtualMachinesClientCaptureResponse struct {
+ // Output of virtual machine capture operation.
+ VirtualMachineCaptureResult
+}
+
+// VirtualMachinesClientConvertToManagedDisksResponse contains the response from method VirtualMachinesClient.BeginConvertToManagedDisks.
+type VirtualMachinesClientConvertToManagedDisksResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientCreateOrUpdateResponse contains the response from method VirtualMachinesClient.BeginCreateOrUpdate.
+type VirtualMachinesClientCreateOrUpdateResponse struct {
+ // Describes a Virtual Machine.
+ VirtualMachine
+}
+
+// VirtualMachinesClientDeallocateResponse contains the response from method VirtualMachinesClient.BeginDeallocate.
+type VirtualMachinesClientDeallocateResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientDeleteResponse contains the response from method VirtualMachinesClient.BeginDelete.
+type VirtualMachinesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientGeneralizeResponse contains the response from method VirtualMachinesClient.Generalize.
+type VirtualMachinesClientGeneralizeResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientGetResponse contains the response from method VirtualMachinesClient.Get.
+type VirtualMachinesClientGetResponse struct {
+ // Describes a Virtual Machine.
+ VirtualMachine
+}
+
+// VirtualMachinesClientInstallPatchesResponse contains the response from method VirtualMachinesClient.BeginInstallPatches.
+type VirtualMachinesClientInstallPatchesResponse struct {
+ // The result summary of an installation operation.
+ VirtualMachineInstallPatchesResult
+}
+
+// VirtualMachinesClientInstanceViewResponse contains the response from method VirtualMachinesClient.InstanceView.
+type VirtualMachinesClientInstanceViewResponse struct {
+ // The instance view of a virtual machine.
+ VirtualMachineInstanceView
+}
+
+// VirtualMachinesClientListAllResponse contains the response from method VirtualMachinesClient.NewListAllPager.
+type VirtualMachinesClientListAllResponse struct {
+ // The List Virtual Machine operation response.
+ VirtualMachineListResult
+}
+
+// VirtualMachinesClientListAvailableSizesResponse contains the response from method VirtualMachinesClient.NewListAvailableSizesPager.
+type VirtualMachinesClientListAvailableSizesResponse struct {
+ // The List Virtual Machine operation response.
+ VirtualMachineSizeListResult
+}
+
+// VirtualMachinesClientListByLocationResponse contains the response from method VirtualMachinesClient.NewListByLocationPager.
+type VirtualMachinesClientListByLocationResponse struct {
+ // The List Virtual Machine operation response.
+ VirtualMachineListResult
+}
+
+// VirtualMachinesClientListResponse contains the response from method VirtualMachinesClient.NewListPager.
+type VirtualMachinesClientListResponse struct {
+ // The List Virtual Machine operation response.
+ VirtualMachineListResult
+}
+
+// VirtualMachinesClientPerformMaintenanceResponse contains the response from method VirtualMachinesClient.BeginPerformMaintenance.
+type VirtualMachinesClientPerformMaintenanceResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientPowerOffResponse contains the response from method VirtualMachinesClient.BeginPowerOff.
+type VirtualMachinesClientPowerOffResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientReapplyResponse contains the response from method VirtualMachinesClient.BeginReapply.
+type VirtualMachinesClientReapplyResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientRedeployResponse contains the response from method VirtualMachinesClient.BeginRedeploy.
+type VirtualMachinesClientRedeployResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientReimageResponse contains the response from method VirtualMachinesClient.BeginReimage.
+type VirtualMachinesClientReimageResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientRestartResponse contains the response from method VirtualMachinesClient.BeginRestart.
+type VirtualMachinesClientRestartResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachinesClient.RetrieveBootDiagnosticsData.
+type VirtualMachinesClientRetrieveBootDiagnosticsDataResponse struct {
+ // The SAS URIs of the console screenshot and serial log blobs.
+ RetrieveBootDiagnosticsDataResult
+}
+
+// VirtualMachinesClientRunCommandResponse contains the response from method VirtualMachinesClient.BeginRunCommand.
+type VirtualMachinesClientRunCommandResponse struct {
+ RunCommandResult
+}
+
+// VirtualMachinesClientSimulateEvictionResponse contains the response from method VirtualMachinesClient.SimulateEviction.
+type VirtualMachinesClientSimulateEvictionResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientStartResponse contains the response from method VirtualMachinesClient.BeginStart.
+type VirtualMachinesClientStartResponse struct {
+ // placeholder for future response values
+}
+
+// VirtualMachinesClientUpdateResponse contains the response from method VirtualMachinesClient.BeginUpdate.
+type VirtualMachinesClientUpdateResponse struct {
+ // Describes a Virtual Machine.
+ VirtualMachine
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.go
new file mode 100644
index 000000000..343e99867
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.go
@@ -0,0 +1,447 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// RestorePointCollectionsClient contains the methods for the RestorePointCollections group.
+// Don't use this type directly, use NewRestorePointCollectionsClient() instead.
+type RestorePointCollectionsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewRestorePointCollectionsClient creates a new instance of RestorePointCollectionsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewRestorePointCollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorePointCollectionsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &RestorePointCollectionsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - The operation to create or update the restore point collection. Please refer to https://aka.ms/RestorePoints
+// for more details. When updating a restore point collection, only tags may be modified.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - restorePointCollectionName - The name of the restore point collection.
+// - parameters - Parameters supplied to the Create or Update restore point collection operation.
+// - options - RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate
+// method.
+func (client *RestorePointCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection, options *RestorePointCollectionsClientCreateOrUpdateOptions) (RestorePointCollectionsClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "RestorePointCollectionsClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, restorePointCollectionName, parameters, options)
+ if err != nil {
+ return RestorePointCollectionsClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return RestorePointCollectionsClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return RestorePointCollectionsClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *RestorePointCollectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection, options *RestorePointCollectionsClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if restorePointCollectionName == "" {
+ return nil, errors.New("parameter restorePointCollectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *RestorePointCollectionsClient) createOrUpdateHandleResponse(resp *http.Response) (RestorePointCollectionsClientCreateOrUpdateResponse, error) {
+ result := RestorePointCollectionsClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil {
+ return RestorePointCollectionsClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginDelete - The operation to delete the restore point collection. This operation will also delete all the contained restore
+// points.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - restorePointCollectionName - The name of the Restore Point Collection.
+// - options - RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete
+// method.
+func (client *RestorePointCollectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*runtime.Poller[RestorePointCollectionsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, restorePointCollectionName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RestorePointCollectionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RestorePointCollectionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - The operation to delete the restore point collection. This operation will also delete all the contained restore
+// points.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *RestorePointCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "RestorePointCollectionsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, restorePointCollectionName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *RestorePointCollectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if restorePointCollectionName == "" {
+ return nil, errors.New("parameter restorePointCollectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - The operation to get the restore point collection.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - restorePointCollectionName - The name of the restore point collection.
+// - options - RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get
+// method.
+func (client *RestorePointCollectionsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientGetOptions) (RestorePointCollectionsClientGetResponse, error) {
+ var err error
+ const operationName = "RestorePointCollectionsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, options)
+ if err != nil {
+ return RestorePointCollectionsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return RestorePointCollectionsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return RestorePointCollectionsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *RestorePointCollectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if restorePointCollectionName == "" {
+ return nil, errors.New("parameter restorePointCollectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *RestorePointCollectionsClient) getHandleResponse(resp *http.Response) (RestorePointCollectionsClientGetResponse, error) {
+ result := RestorePointCollectionsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil {
+ return RestorePointCollectionsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets the list of restore point collections in a resource group.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - options - RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.NewListPager
+// method.
+func (client *RestorePointCollectionsClient) NewListPager(resourceGroupName string, options *RestorePointCollectionsClientListOptions) *runtime.Pager[RestorePointCollectionsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[RestorePointCollectionsClientListResponse]{
+ More: func(page RestorePointCollectionsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *RestorePointCollectionsClientListResponse) (RestorePointCollectionsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RestorePointCollectionsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return RestorePointCollectionsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *RestorePointCollectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *RestorePointCollectionsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *RestorePointCollectionsClient) listHandleResponse(resp *http.Response) (RestorePointCollectionsClientListResponse, error) {
+ result := RestorePointCollectionsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollectionListResult); err != nil {
+ return RestorePointCollectionsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAllPager - Gets the list of restore point collections in the subscription. Use nextLink property in the response
+// to get the next page of restore point collections. Do this till nextLink is not null to fetch all
+// the restore point collections.
+//
+// Generated from API version 2023-07-01
+// - options - RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.NewListAllPager
+// method.
+func (client *RestorePointCollectionsClient) NewListAllPager(options *RestorePointCollectionsClientListAllOptions) *runtime.Pager[RestorePointCollectionsClientListAllResponse] {
+ return runtime.NewPager(runtime.PagingHandler[RestorePointCollectionsClientListAllResponse]{
+ More: func(page RestorePointCollectionsClientListAllResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *RestorePointCollectionsClientListAllResponse) (RestorePointCollectionsClientListAllResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "RestorePointCollectionsClient.NewListAllPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAllCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return RestorePointCollectionsClientListAllResponse{}, err
+ }
+ return client.listAllHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAllCreateRequest creates the ListAll request.
+func (client *RestorePointCollectionsClient) listAllCreateRequest(ctx context.Context, options *RestorePointCollectionsClientListAllOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/restorePointCollections"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAllHandleResponse handles the ListAll response.
+func (client *RestorePointCollectionsClient) listAllHandleResponse(resp *http.Response) (RestorePointCollectionsClientListAllResponse, error) {
+ result := RestorePointCollectionsClientListAllResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollectionListResult); err != nil {
+ return RestorePointCollectionsClientListAllResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - The operation to update the restore point collection.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - restorePointCollectionName - The name of the restore point collection.
+// - parameters - Parameters supplied to the Update restore point collection operation.
+// - options - RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update
+// method.
+func (client *RestorePointCollectionsClient) Update(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate, options *RestorePointCollectionsClientUpdateOptions) (RestorePointCollectionsClientUpdateResponse, error) {
+ var err error
+ const operationName = "RestorePointCollectionsClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, restorePointCollectionName, parameters, options)
+ if err != nil {
+ return RestorePointCollectionsClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return RestorePointCollectionsClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return RestorePointCollectionsClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *RestorePointCollectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate, options *RestorePointCollectionsClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if restorePointCollectionName == "" {
+ return nil, errors.New("parameter restorePointCollectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *RestorePointCollectionsClient) updateHandleResponse(resp *http.Response) (RestorePointCollectionsClientUpdateResponse, error) {
+ result := RestorePointCollectionsClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RestorePointCollection); err != nil {
+ return RestorePointCollectionsClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.go
new file mode 100644
index 000000000..a04794bbb
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.go
@@ -0,0 +1,283 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// RestorePointsClient contains the methods for the RestorePoints group.
+// Don't use this type directly, use NewRestorePointsClient() instead.
+type RestorePointsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewRestorePointsClient creates a new instance of RestorePointsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewRestorePointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorePointsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &RestorePointsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreate - The operation to create the restore point. Updating properties of an existing restore point is not allowed
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - restorePointCollectionName - The name of the restore point collection.
+// - restorePointName - The name of the restore point.
+// - parameters - Parameters supplied to the Create restore point operation.
+// - options - RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate
+// method.
+func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*runtime.Poller[RestorePointsClientCreateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.create(ctx, resourceGroupName, restorePointCollectionName, restorePointName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RestorePointsClientCreateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RestorePointsClientCreateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Create - The operation to create the restore point. Updating properties of an existing restore point is not allowed
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *RestorePointsClient) create(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "RestorePointsClient.BeginCreate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createCreateRequest creates the Create request.
+func (client *RestorePointsClient) createCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if restorePointCollectionName == "" {
+ return nil, errors.New("parameter restorePointCollectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName))
+ if restorePointName == "" {
+ return nil, errors.New("parameter restorePointName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - The operation to delete the restore point.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - restorePointCollectionName - The name of the Restore Point Collection.
+// - restorePointName - The name of the restore point.
+// - options - RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete
+// method.
+func (client *RestorePointsClient) BeginDelete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*runtime.Poller[RestorePointsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RestorePointsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[RestorePointsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - The operation to delete the restore point.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *RestorePointsClient) deleteOperation(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "RestorePointsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *RestorePointsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if restorePointCollectionName == "" {
+ return nil, errors.New("parameter restorePointCollectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName))
+ if restorePointName == "" {
+ return nil, errors.New("parameter restorePointName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - The operation to get the restore point.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - restorePointCollectionName - The name of the restore point collection.
+// - restorePointName - The name of the restore point.
+// - options - RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method.
+func (client *RestorePointsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientGetOptions) (RestorePointsClientGetResponse, error) {
+ var err error
+ const operationName = "RestorePointsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, restorePointCollectionName, restorePointName, options)
+ if err != nil {
+ return RestorePointsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return RestorePointsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return RestorePointsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *RestorePointsClient) getCreateRequest(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if restorePointCollectionName == "" {
+ return nil, errors.New("parameter restorePointCollectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointCollectionName}", url.PathEscape(restorePointCollectionName))
+ if restorePointName == "" {
+ return nil, errors.New("parameter restorePointName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{restorePointName}", url.PathEscape(restorePointName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *RestorePointsClient) getHandleResponse(resp *http.Response) (RestorePointsClientGetResponse, error) {
+ result := RestorePointsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RestorePoint); err != nil {
+ return RestorePointsClientGetResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.go
new file mode 100644
index 000000000..b1239fadd
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.go
@@ -0,0 +1,172 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// SharedGalleriesClient contains the methods for the SharedGalleries group.
+// Don't use this type directly, use NewSharedGalleriesClient() instead.
+type SharedGalleriesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewSharedGalleriesClient creates a new instance of SharedGalleriesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewSharedGalleriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleriesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &SharedGalleriesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Get a shared gallery by subscription id or tenant id.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - location - Resource location.
+// - galleryUniqueName - The unique name of the Shared Gallery.
+// - options - SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method.
+func (client *SharedGalleriesClient) Get(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleriesClientGetOptions) (SharedGalleriesClientGetResponse, error) {
+ var err error
+ const operationName = "SharedGalleriesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, location, galleryUniqueName, options)
+ if err != nil {
+ return SharedGalleriesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SharedGalleriesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return SharedGalleriesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *SharedGalleriesClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleriesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if galleryUniqueName == "" {
+ return nil, errors.New("parameter galleryUniqueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *SharedGalleriesClient) getHandleResponse(resp *http.Response) (SharedGalleriesClientGetResponse, error) {
+ result := SharedGalleriesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SharedGallery); err != nil {
+ return SharedGalleriesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List shared galleries by subscription id or tenant id.
+//
+// Generated from API version 2022-03-03
+// - location - Resource location.
+// - options - SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.NewListPager
+// method.
+func (client *SharedGalleriesClient) NewListPager(location string, options *SharedGalleriesClientListOptions) *runtime.Pager[SharedGalleriesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[SharedGalleriesClientListResponse]{
+ More: func(page SharedGalleriesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *SharedGalleriesClientListResponse) (SharedGalleriesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SharedGalleriesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, location, options)
+ }, nil)
+ if err != nil {
+ return SharedGalleriesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *SharedGalleriesClient) listCreateRequest(ctx context.Context, location string, options *SharedGalleriesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ if options != nil && options.SharedTo != nil {
+ reqQP.Set("sharedTo", string(*options.SharedTo))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *SharedGalleriesClient) listHandleResponse(resp *http.Response) (SharedGalleriesClientListResponse, error) {
+ result := SharedGalleriesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryList); err != nil {
+ return SharedGalleriesClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.go
new file mode 100644
index 000000000..461801f26
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.go
@@ -0,0 +1,182 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// SharedGalleryImagesClient contains the methods for the SharedGalleryImages group.
+// Don't use this type directly, use NewSharedGalleryImagesClient() instead.
+type SharedGalleryImagesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewSharedGalleryImagesClient creates a new instance of SharedGalleryImagesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewSharedGalleryImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleryImagesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &SharedGalleryImagesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Get a shared gallery image by subscription id or tenant id.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - location - Resource location.
+// - galleryUniqueName - The unique name of the Shared Gallery.
+// - galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed.
+// - options - SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method.
+func (client *SharedGalleryImagesClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImagesClientGetOptions) (SharedGalleryImagesClientGetResponse, error) {
+ var err error
+ const operationName = "SharedGalleryImagesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, location, galleryUniqueName, galleryImageName, options)
+ if err != nil {
+ return SharedGalleryImagesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SharedGalleryImagesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return SharedGalleryImagesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *SharedGalleryImagesClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImagesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if galleryUniqueName == "" {
+ return nil, errors.New("parameter galleryUniqueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *SharedGalleryImagesClient) getHandleResponse(resp *http.Response) (SharedGalleryImagesClientGetResponse, error) {
+ result := SharedGalleryImagesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImage); err != nil {
+ return SharedGalleryImagesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List shared gallery images by subscription id or tenant id.
+//
+// Generated from API version 2022-03-03
+// - location - Resource location.
+// - galleryUniqueName - The unique name of the Shared Gallery.
+// - options - SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.NewListPager
+// method.
+func (client *SharedGalleryImagesClient) NewListPager(location string, galleryUniqueName string, options *SharedGalleryImagesClientListOptions) *runtime.Pager[SharedGalleryImagesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[SharedGalleryImagesClientListResponse]{
+ More: func(page SharedGalleryImagesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *SharedGalleryImagesClientListResponse) (SharedGalleryImagesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SharedGalleryImagesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, location, galleryUniqueName, options)
+ }, nil)
+ if err != nil {
+ return SharedGalleryImagesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *SharedGalleryImagesClient) listCreateRequest(ctx context.Context, location string, galleryUniqueName string, options *SharedGalleryImagesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if galleryUniqueName == "" {
+ return nil, errors.New("parameter galleryUniqueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ if options != nil && options.SharedTo != nil {
+ reqQP.Set("sharedTo", string(*options.SharedTo))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *SharedGalleryImagesClient) listHandleResponse(resp *http.Response) (SharedGalleryImagesClientListResponse, error) {
+ result := SharedGalleryImagesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageList); err != nil {
+ return SharedGalleryImagesClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.go
new file mode 100644
index 000000000..2f0c5b048
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.go
@@ -0,0 +1,195 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// SharedGalleryImageVersionsClient contains the methods for the SharedGalleryImageVersions group.
+// Don't use this type directly, use NewSharedGalleryImageVersionsClient() instead.
+type SharedGalleryImageVersionsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewSharedGalleryImageVersionsClient creates a new instance of SharedGalleryImageVersionsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewSharedGalleryImageVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedGalleryImageVersionsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &SharedGalleryImageVersionsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Get a shared gallery image version by subscription id or tenant id.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2022-03-03
+// - location - Resource location.
+// - galleryUniqueName - The unique name of the Shared Gallery.
+// - galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed.
+// - galleryImageVersionName - The name of the gallery image version to be created. Needs to follow semantic version name pattern:
+// The allowed characters are digit and period. Digits must be within the range of a 32-bit integer.
+// Format: ..
+// - options - SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get
+// method.
+func (client *SharedGalleryImageVersionsClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string, options *SharedGalleryImageVersionsClientGetOptions) (SharedGalleryImageVersionsClientGetResponse, error) {
+ var err error
+ const operationName = "SharedGalleryImageVersionsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, location, galleryUniqueName, galleryImageName, galleryImageVersionName, options)
+ if err != nil {
+ return SharedGalleryImageVersionsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SharedGalleryImageVersionsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return SharedGalleryImageVersionsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *SharedGalleryImageVersionsClient) getCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string, options *SharedGalleryImageVersionsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if galleryUniqueName == "" {
+ return nil, errors.New("parameter galleryUniqueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ if galleryImageVersionName == "" {
+ return nil, errors.New("parameter galleryImageVersionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageVersionName}", url.PathEscape(galleryImageVersionName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *SharedGalleryImageVersionsClient) getHandleResponse(resp *http.Response) (SharedGalleryImageVersionsClientGetResponse, error) {
+ result := SharedGalleryImageVersionsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageVersion); err != nil {
+ return SharedGalleryImageVersionsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List shared gallery image versions by subscription id or tenant id.
+//
+// Generated from API version 2022-03-03
+// - location - Resource location.
+// - galleryUniqueName - The unique name of the Shared Gallery.
+// - galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed.
+// - options - SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.NewListPager
+// method.
+func (client *SharedGalleryImageVersionsClient) NewListPager(location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImageVersionsClientListOptions) *runtime.Pager[SharedGalleryImageVersionsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[SharedGalleryImageVersionsClientListResponse]{
+ More: func(page SharedGalleryImageVersionsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *SharedGalleryImageVersionsClientListResponse) (SharedGalleryImageVersionsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SharedGalleryImageVersionsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, location, galleryUniqueName, galleryImageName, options)
+ }, nil)
+ if err != nil {
+ return SharedGalleryImageVersionsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *SharedGalleryImageVersionsClient) listCreateRequest(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, options *SharedGalleryImageVersionsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if galleryUniqueName == "" {
+ return nil, errors.New("parameter galleryUniqueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryUniqueName}", url.PathEscape(galleryUniqueName))
+ if galleryImageName == "" {
+ return nil, errors.New("parameter galleryImageName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2022-03-03")
+ if options != nil && options.SharedTo != nil {
+ reqQP.Set("sharedTo", string(*options.SharedTo))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *SharedGalleryImageVersionsClient) listHandleResponse(resp *http.Response) (SharedGalleryImageVersionsClientListResponse, error) {
+ result := SharedGalleryImageVersionsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SharedGalleryImageVersionList); err != nil {
+ return SharedGalleryImageVersionsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.go
new file mode 100644
index 000000000..a0d263613
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.go
@@ -0,0 +1,625 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// SnapshotsClient contains the methods for the Snapshots group.
+// Don't use this type directly, use NewSnapshotsClient() instead.
+type SnapshotsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewSnapshotsClient creates a new instance of SnapshotsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SnapshotsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &SnapshotsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - Creates or updates a snapshot.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created.
+// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80
+// characters.
+// - snapshot - Snapshot object supplied in the body of the Put disk operation.
+// - options - SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate
+// method.
+func (client *SnapshotsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SnapshotsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, snapshotName, snapshot, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Creates or updates a snapshot.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *SnapshotsClient) createOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "SnapshotsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, snapshotName, snapshot, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *SnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot, options *SnapshotsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if snapshotName == "" {
+ return nil, errors.New("parameter snapshotName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, snapshot); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a snapshot.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created.
+// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80
+// characters.
+// - options - SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method.
+func (client *SnapshotsClient) BeginDelete(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*runtime.Poller[SnapshotsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, snapshotName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a snapshot.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *SnapshotsClient) deleteOperation(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "SnapshotsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, snapshotName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if snapshotName == "" {
+ return nil, errors.New("parameter snapshotName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// Get - Gets information about a snapshot.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created.
+// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80
+// characters.
+// - options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method.
+func (client *SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientGetOptions) (SnapshotsClientGetResponse, error) {
+ var err error
+ const operationName = "SnapshotsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, snapshotName, options)
+ if err != nil {
+ return SnapshotsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SnapshotsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return SnapshotsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if snapshotName == "" {
+ return nil, errors.New("parameter snapshotName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (SnapshotsClientGetResponse, error) {
+ result := SnapshotsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Snapshot); err != nil {
+ return SnapshotsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginGrantAccess - Grants access to a snapshot.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created.
+// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80
+// characters.
+// - grantAccessData - Access data object supplied in the body of the get snapshot access operation.
+// - options - SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess
+// method.
+func (client *SnapshotsClient) BeginGrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*runtime.Poller[SnapshotsClientGrantAccessResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.grantAccess(ctx, resourceGroupName, snapshotName, grantAccessData, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientGrantAccessResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientGrantAccessResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// GrantAccess - Grants access to a snapshot.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *SnapshotsClient) grantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*http.Response, error) {
+ var err error
+ const operationName = "SnapshotsClient.BeginGrantAccess"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.grantAccessCreateRequest(ctx, resourceGroupName, snapshotName, grantAccessData, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// grantAccessCreateRequest creates the GrantAccess request.
+func (client *SnapshotsClient) grantAccessCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, options *SnapshotsClientBeginGrantAccessOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if snapshotName == "" {
+ return nil, errors.New("parameter snapshotName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, grantAccessData); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// NewListPager - Lists snapshots under a subscription.
+//
+// Generated from API version 2023-04-02
+// - options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method.
+func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListResponse]{
+ More: func(page SnapshotsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *SnapshotsClientListResponse) (SnapshotsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SnapshotsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return SnapshotsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *SnapshotsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (SnapshotsClientListResponse, error) {
+ result := SnapshotsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotList); err != nil {
+ return SnapshotsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Lists snapshots under a resource group.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager
+// method.
+func (client *SnapshotsClient) NewListByResourceGroupPager(resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) *runtime.Pager[SnapshotsClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListByResourceGroupResponse]{
+ More: func(page SnapshotsClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *SnapshotsClientListByResourceGroupResponse) (SnapshotsClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SnapshotsClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return SnapshotsClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SnapshotsClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *SnapshotsClient) listByResourceGroupHandleResponse(resp *http.Response) (SnapshotsClientListByResourceGroupResponse, error) {
+ result := SnapshotsClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotList); err != nil {
+ return SnapshotsClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginRevokeAccess - Revokes access to a snapshot.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created.
+// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80
+// characters.
+// - options - SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess
+// method.
+func (client *SnapshotsClient) BeginRevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*runtime.Poller[SnapshotsClientRevokeAccessResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.revokeAccess(ctx, resourceGroupName, snapshotName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientRevokeAccessResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientRevokeAccessResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// RevokeAccess - Revokes access to a snapshot.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *SnapshotsClient) revokeAccess(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*http.Response, error) {
+ var err error
+ const operationName = "SnapshotsClient.BeginRevokeAccess"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.revokeAccessCreateRequest(ctx, resourceGroupName, snapshotName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// revokeAccessCreateRequest creates the RevokeAccess request.
+func (client *SnapshotsClient) revokeAccessCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, options *SnapshotsClientBeginRevokeAccessOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if snapshotName == "" {
+ return nil, errors.New("parameter snapshotName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// BeginUpdate - Updates (patches) a snapshot.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+// - resourceGroupName - The name of the resource group.
+// - snapshotName - The name of the snapshot that is being created. The name can't be changed after the snapshot is created.
+// Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80
+// characters.
+// - snapshot - Snapshot object supplied in the body of the Patch snapshot operation.
+// - options - SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method.
+func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*runtime.Poller[SnapshotsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, snapshotName, snapshot, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[SnapshotsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Updates (patches) a snapshot.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-04-02
+func (client *SnapshotsClient) update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "SnapshotsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, snapshotName, snapshot, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *SnapshotsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, options *SnapshotsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if snapshotName == "" {
+ return nil, errors.New("parameter snapshotName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{snapshotName}", url.PathEscape(snapshotName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-04-02")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, snapshot); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.go
new file mode 100644
index 000000000..5d08d5596
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.go
@@ -0,0 +1,483 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// SSHPublicKeysClient contains the methods for the SSHPublicKeys group.
+// Don't use this type directly, use NewSSHPublicKeysClient() instead.
+type SSHPublicKeysClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewSSHPublicKeysClient creates a new instance of SSHPublicKeysClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewSSHPublicKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SSHPublicKeysClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &SSHPublicKeysClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Create - Creates a new SSH public key resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - sshPublicKeyName - The name of the SSH public key.
+// - parameters - Parameters supplied to create the SSH public key.
+// - options - SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method.
+func (client *SSHPublicKeysClient) Create(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyResource, options *SSHPublicKeysClientCreateOptions) (SSHPublicKeysClientCreateResponse, error) {
+ var err error
+ const operationName = "SSHPublicKeysClient.Create"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, sshPublicKeyName, parameters, options)
+ if err != nil {
+ return SSHPublicKeysClientCreateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SSHPublicKeysClientCreateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return SSHPublicKeysClientCreateResponse{}, err
+ }
+ resp, err := client.createHandleResponse(httpResp)
+ return resp, err
+}
+
+// createCreateRequest creates the Create request.
+func (client *SSHPublicKeysClient) createCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyResource, options *SSHPublicKeysClientCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if sshPublicKeyName == "" {
+ return nil, errors.New("parameter sshPublicKeyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createHandleResponse handles the Create response.
+func (client *SSHPublicKeysClient) createHandleResponse(resp *http.Response) (SSHPublicKeysClientCreateResponse, error) {
+ result := SSHPublicKeysClientCreateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil {
+ return SSHPublicKeysClientCreateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Delete an SSH public key.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - sshPublicKeyName - The name of the SSH public key.
+// - options - SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method.
+func (client *SSHPublicKeysClient) Delete(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientDeleteOptions) (SSHPublicKeysClientDeleteResponse, error) {
+ var err error
+ const operationName = "SSHPublicKeysClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options)
+ if err != nil {
+ return SSHPublicKeysClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SSHPublicKeysClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return SSHPublicKeysClientDeleteResponse{}, err
+ }
+ return SSHPublicKeysClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *SSHPublicKeysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if sshPublicKeyName == "" {
+ return nil, errors.New("parameter sshPublicKeyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// GenerateKeyPair - Generates and returns a public/private key pair and populates the SSH public key resource with the public
+// key. The length of the key will be 3072 bits. This operation can only be performed once per
+// SSH public key resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - sshPublicKeyName - The name of the SSH public key.
+// - options - SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair
+// method.
+func (client *SSHPublicKeysClient) GenerateKeyPair(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGenerateKeyPairOptions) (SSHPublicKeysClientGenerateKeyPairResponse, error) {
+ var err error
+ const operationName = "SSHPublicKeysClient.GenerateKeyPair"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.generateKeyPairCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options)
+ if err != nil {
+ return SSHPublicKeysClientGenerateKeyPairResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SSHPublicKeysClientGenerateKeyPairResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return SSHPublicKeysClientGenerateKeyPairResponse{}, err
+ }
+ resp, err := client.generateKeyPairHandleResponse(httpResp)
+ return resp, err
+}
+
+// generateKeyPairCreateRequest creates the GenerateKeyPair request.
+func (client *SSHPublicKeysClient) generateKeyPairCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGenerateKeyPairOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if sshPublicKeyName == "" {
+ return nil, errors.New("parameter sshPublicKeyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// generateKeyPairHandleResponse handles the GenerateKeyPair response.
+func (client *SSHPublicKeysClient) generateKeyPairHandleResponse(resp *http.Response) (SSHPublicKeysClientGenerateKeyPairResponse, error) {
+ result := SSHPublicKeysClientGenerateKeyPairResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyGenerateKeyPairResult); err != nil {
+ return SSHPublicKeysClientGenerateKeyPairResponse{}, err
+ }
+ return result, nil
+}
+
+// Get - Retrieves information about an SSH public key.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - sshPublicKeyName - The name of the SSH public key.
+// - options - SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method.
+func (client *SSHPublicKeysClient) Get(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGetOptions) (SSHPublicKeysClientGetResponse, error) {
+ var err error
+ const operationName = "SSHPublicKeysClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, sshPublicKeyName, options)
+ if err != nil {
+ return SSHPublicKeysClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SSHPublicKeysClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return SSHPublicKeysClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *SSHPublicKeysClient) getCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, options *SSHPublicKeysClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if sshPublicKeyName == "" {
+ return nil, errors.New("parameter sshPublicKeyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *SSHPublicKeysClient) getHandleResponse(resp *http.Response) (SSHPublicKeysClientGetResponse, error) {
+ result := SSHPublicKeysClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil {
+ return SSHPublicKeysClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Lists all of the SSH public keys in the specified resource group. Use the nextLink property
+// in the response to get the next page of SSH public keys.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - options - SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.NewListByResourceGroupPager
+// method.
+func (client *SSHPublicKeysClient) NewListByResourceGroupPager(resourceGroupName string, options *SSHPublicKeysClientListByResourceGroupOptions) *runtime.Pager[SSHPublicKeysClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[SSHPublicKeysClientListByResourceGroupResponse]{
+ More: func(page SSHPublicKeysClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *SSHPublicKeysClientListByResourceGroupResponse) (SSHPublicKeysClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SSHPublicKeysClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return SSHPublicKeysClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *SSHPublicKeysClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *SSHPublicKeysClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *SSHPublicKeysClient) listByResourceGroupHandleResponse(resp *http.Response) (SSHPublicKeysClientListByResourceGroupResponse, error) {
+ result := SSHPublicKeysClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeysGroupListResult); err != nil {
+ return SSHPublicKeysClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListBySubscriptionPager - Lists all of the SSH public keys in the subscription. Use the nextLink property in the response
+// to get the next page of SSH public keys.
+//
+// Generated from API version 2023-07-01
+// - options - SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.NewListBySubscriptionPager
+// method.
+func (client *SSHPublicKeysClient) NewListBySubscriptionPager(options *SSHPublicKeysClientListBySubscriptionOptions) *runtime.Pager[SSHPublicKeysClientListBySubscriptionResponse] {
+ return runtime.NewPager(runtime.PagingHandler[SSHPublicKeysClientListBySubscriptionResponse]{
+ More: func(page SSHPublicKeysClientListBySubscriptionResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *SSHPublicKeysClientListBySubscriptionResponse) (SSHPublicKeysClientListBySubscriptionResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SSHPublicKeysClient.NewListBySubscriptionPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listBySubscriptionCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return SSHPublicKeysClientListBySubscriptionResponse{}, err
+ }
+ return client.listBySubscriptionHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listBySubscriptionCreateRequest creates the ListBySubscription request.
+func (client *SSHPublicKeysClient) listBySubscriptionCreateRequest(ctx context.Context, options *SSHPublicKeysClientListBySubscriptionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listBySubscriptionHandleResponse handles the ListBySubscription response.
+func (client *SSHPublicKeysClient) listBySubscriptionHandleResponse(resp *http.Response) (SSHPublicKeysClientListBySubscriptionResponse, error) {
+ result := SSHPublicKeysClientListBySubscriptionResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeysGroupListResult); err != nil {
+ return SSHPublicKeysClientListBySubscriptionResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - Updates a new SSH public key resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - sshPublicKeyName - The name of the SSH public key.
+// - parameters - Parameters supplied to update the SSH public key.
+// - options - SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method.
+func (client *SSHPublicKeysClient) Update(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyUpdateResource, options *SSHPublicKeysClientUpdateOptions) (SSHPublicKeysClientUpdateResponse, error) {
+ var err error
+ const operationName = "SSHPublicKeysClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, sshPublicKeyName, parameters, options)
+ if err != nil {
+ return SSHPublicKeysClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SSHPublicKeysClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return SSHPublicKeysClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *SSHPublicKeysClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sshPublicKeyName string, parameters SSHPublicKeyUpdateResource, options *SSHPublicKeysClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if sshPublicKeyName == "" {
+ return nil, errors.New("parameter sshPublicKeyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{sshPublicKeyName}", url.PathEscape(sshPublicKeyName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *SSHPublicKeysClient) updateHandleResponse(resp *http.Response) (SSHPublicKeysClientUpdateResponse, error) {
+ result := SSHPublicKeysClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SSHPublicKeyResource); err != nil {
+ return SSHPublicKeysClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.go
new file mode 100644
index 000000000..4f75ccd6f
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.go
@@ -0,0 +1,86 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+ "regexp"
+ "strings"
+ "time"
+)
+
+// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases.
+var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`)
+
+const (
+ utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"`
+ utcDateTime = "2006-01-02T15:04:05.999999999"
+ dateTimeJSON = `"` + time.RFC3339Nano + `"`
+)
+
+type dateTimeRFC3339 time.Time
+
+func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalJSON()
+}
+
+func (t dateTimeRFC3339) MarshalText() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalText()
+}
+
+func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error {
+ layout := utcDateTimeJSON
+ if tzOffsetRegex.Match(data) {
+ layout = dateTimeJSON
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) UnmarshalText(data []byte) error {
+ layout := utcDateTime
+ if tzOffsetRegex.Match(data) {
+ layout = time.RFC3339Nano
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) Parse(layout, value string) error {
+ p, err := time.Parse(layout, strings.ToUpper(value))
+ *t = dateTimeRFC3339(p)
+ return err
+}
+
+func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) {
+ if t == nil {
+ return
+ } else if azcore.IsNullValue(t) {
+ m[k] = nil
+ return
+ } else if reflect.ValueOf(t).IsNil() {
+ return
+ }
+ m[k] = (*dateTimeRFC3339)(t)
+}
+
+func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error {
+ if data == nil || strings.EqualFold(string(data), "null") {
+ return nil
+ }
+ var aux dateTimeRFC3339
+ if err := json.Unmarshal(data, &aux); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ *t = (*time.Time)(&aux)
+ return nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.go
new file mode 100644
index 000000000..2ea544447
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.go
@@ -0,0 +1,105 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// UsageClient contains the methods for the Usage group.
+// Don't use this type directly, use NewUsageClient() instead.
+type UsageClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewUsageClient creates a new instance of UsageClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewUsageClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsageClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &UsageClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - Gets, for the specified location, the current compute resource usage information as well as the limits for
+// compute resources under the subscription.
+//
+// Generated from API version 2023-07-01
+// - location - The location for which resource usage is queried.
+// - options - UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method.
+func (client *UsageClient) NewListPager(location string, options *UsageClientListOptions) *runtime.Pager[UsageClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[UsageClientListResponse]{
+ More: func(page UsageClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *UsageClientListResponse) (UsageClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "UsageClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, location, options)
+ }, nil)
+ if err != nil {
+ return UsageClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *UsageClient) listCreateRequest(ctx context.Context, location string, options *UsageClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *UsageClient) listHandleResponse(resp *http.Response) (UsageClientListResponse, error) {
+ result := UsageClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListUsagesResult); err != nil {
+ return UsageClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.go
new file mode 100644
index 000000000..0e0b62612
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.go
@@ -0,0 +1,259 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// VirtualMachineExtensionImagesClient contains the methods for the VirtualMachineExtensionImages group.
+// Don't use this type directly, use NewVirtualMachineExtensionImagesClient() instead.
+type VirtualMachineExtensionImagesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineExtensionImagesClient creates a new instance of VirtualMachineExtensionImagesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineExtensionImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineExtensionImagesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineExtensionImagesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Gets a virtual machine extension image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - options - VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get
+// method.
+func (client *VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParam string, version string, options *VirtualMachineExtensionImagesClientGetOptions) (VirtualMachineExtensionImagesClientGetResponse, error) {
+ var err error
+ const operationName = "VirtualMachineExtensionImagesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, location, publisherName, typeParam, version, options)
+ if err != nil {
+ return VirtualMachineExtensionImagesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineExtensionImagesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineExtensionImagesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *VirtualMachineExtensionImagesClient) getCreateRequest(ctx context.Context, location string, publisherName string, typeParam string, version string, options *VirtualMachineExtensionImagesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publisherName == "" {
+ return nil, errors.New("parameter publisherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName))
+ if typeParam == "" {
+ return nil, errors.New("parameter typeParam cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{type}", url.PathEscape(typeParam))
+ if version == "" {
+ return nil, errors.New("parameter version cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *VirtualMachineExtensionImagesClient) getHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientGetResponse, error) {
+ result := VirtualMachineExtensionImagesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImage); err != nil {
+ return VirtualMachineExtensionImagesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// ListTypes - Gets a list of virtual machine extension image types.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - options - VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes
+// method.
+func (client *VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string, options *VirtualMachineExtensionImagesClientListTypesOptions) (VirtualMachineExtensionImagesClientListTypesResponse, error) {
+ var err error
+ const operationName = "VirtualMachineExtensionImagesClient.ListTypes"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listTypesCreateRequest(ctx, location, publisherName, options)
+ if err != nil {
+ return VirtualMachineExtensionImagesClientListTypesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineExtensionImagesClientListTypesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineExtensionImagesClientListTypesResponse{}, err
+ }
+ resp, err := client.listTypesHandleResponse(httpResp)
+ return resp, err
+}
+
+// listTypesCreateRequest creates the ListTypes request.
+func (client *VirtualMachineExtensionImagesClient) listTypesCreateRequest(ctx context.Context, location string, publisherName string, options *VirtualMachineExtensionImagesClientListTypesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publisherName == "" {
+ return nil, errors.New("parameter publisherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listTypesHandleResponse handles the ListTypes response.
+func (client *VirtualMachineExtensionImagesClient) listTypesHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientListTypesResponse, error) {
+ result := VirtualMachineExtensionImagesClientListTypesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImageArray); err != nil {
+ return VirtualMachineExtensionImagesClientListTypesResponse{}, err
+ }
+ return result, nil
+}
+
+// ListVersions - Gets a list of virtual machine extension image versions.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - options - VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions
+// method.
+func (client *VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParam string, options *VirtualMachineExtensionImagesClientListVersionsOptions) (VirtualMachineExtensionImagesClientListVersionsResponse, error) {
+ var err error
+ const operationName = "VirtualMachineExtensionImagesClient.ListVersions"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listVersionsCreateRequest(ctx, location, publisherName, typeParam, options)
+ if err != nil {
+ return VirtualMachineExtensionImagesClientListVersionsResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineExtensionImagesClientListVersionsResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineExtensionImagesClientListVersionsResponse{}, err
+ }
+ resp, err := client.listVersionsHandleResponse(httpResp)
+ return resp, err
+}
+
+// listVersionsCreateRequest creates the ListVersions request.
+func (client *VirtualMachineExtensionImagesClient) listVersionsCreateRequest(ctx context.Context, location string, publisherName string, typeParam string, options *VirtualMachineExtensionImagesClientListVersionsOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publisherName == "" {
+ return nil, errors.New("parameter publisherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName))
+ if typeParam == "" {
+ return nil, errors.New("parameter typeParam cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{type}", url.PathEscape(typeParam))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ if options != nil && options.Orderby != nil {
+ reqQP.Set("$orderby", *options.Orderby)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listVersionsHandleResponse handles the ListVersions response.
+func (client *VirtualMachineExtensionImagesClient) listVersionsHandleResponse(resp *http.Response) (VirtualMachineExtensionImagesClientListVersionsResponse, error) {
+ result := VirtualMachineExtensionImagesClientListVersionsResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionImageArray); err != nil {
+ return VirtualMachineExtensionImagesClientListVersionsResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.go
new file mode 100644
index 000000000..f1cba272c
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.go
@@ -0,0 +1,437 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// VirtualMachineExtensionsClient contains the methods for the VirtualMachineExtensions group.
+// Don't use this type directly, use NewVirtualMachineExtensionsClient() instead.
+type VirtualMachineExtensionsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineExtensionsClient creates a new instance of VirtualMachineExtensionsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineExtensionsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineExtensionsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - The operation to create or update the extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine where the extension should be created or updated.
+// - vmExtensionName - The name of the virtual machine extension.
+// - extensionParameters - Parameters supplied to the Create Virtual Machine Extension operation.
+// - options - VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate
+// method.
+func (client *VirtualMachineExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineExtensionsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineExtensionsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineExtensionsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - The operation to create or update the extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineExtensionsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *VirtualMachineExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if vmExtensionName == "" {
+ return nil, errors.New("parameter vmExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - The operation to delete the extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine where the extension should be deleted.
+// - vmExtensionName - The name of the virtual machine extension.
+// - options - VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete
+// method.
+func (client *VirtualMachineExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineExtensionsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, vmExtensionName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineExtensionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineExtensionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - The operation to delete the extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineExtensionsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *VirtualMachineExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if vmExtensionName == "" {
+ return nil, errors.New("parameter vmExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - The operation to get the extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine containing the extension.
+// - vmExtensionName - The name of the virtual machine extension.
+// - options - VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get
+// method.
+func (client *VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientGetOptions) (VirtualMachineExtensionsClientGetResponse, error) {
+ var err error
+ const operationName = "VirtualMachineExtensionsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, options)
+ if err != nil {
+ return VirtualMachineExtensionsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineExtensionsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineExtensionsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *VirtualMachineExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if vmExtensionName == "" {
+ return nil, errors.New("parameter vmExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *VirtualMachineExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineExtensionsClientGetResponse, error) {
+ result := VirtualMachineExtensionsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtension); err != nil {
+ return VirtualMachineExtensionsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// List - The operation to get all extensions of a Virtual Machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine containing the extension.
+// - options - VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List
+// method.
+func (client *VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineExtensionsClientListOptions) (VirtualMachineExtensionsClientListResponse, error) {
+ var err error
+ const operationName = "VirtualMachineExtensionsClient.List"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return VirtualMachineExtensionsClientListResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineExtensionsClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineExtensionsClientListResponse{}, err
+ }
+ resp, err := client.listHandleResponse(httpResp)
+ return resp, err
+}
+
+// listCreateRequest creates the List request.
+func (client *VirtualMachineExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineExtensionsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *VirtualMachineExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineExtensionsClientListResponse, error) {
+ result := VirtualMachineExtensionsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineExtensionsListResult); err != nil {
+ return VirtualMachineExtensionsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - The operation to update the extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine where the extension should be updated.
+// - vmExtensionName - The name of the virtual machine extension.
+// - extensionParameters - Parameters supplied to the Update Virtual Machine Extension operation.
+// - options - VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate
+// method.
+func (client *VirtualMachineExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineExtensionsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineExtensionsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineExtensionsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - The operation to update the extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineExtensionsClient) update(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineExtensionsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, vmExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *VirtualMachineExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if vmExtensionName == "" {
+ return nil, errors.New("parameter vmExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.go
new file mode 100644
index 000000000..42f941766
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.go
@@ -0,0 +1,470 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// VirtualMachineImagesClient contains the methods for the VirtualMachineImages group.
+// Don't use this type directly, use NewVirtualMachineImagesClient() instead.
+type VirtualMachineImagesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineImagesClient creates a new instance of VirtualMachineImagesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineImagesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineImagesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Gets a virtual machine image.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - publisherName - A valid image publisher.
+// - offer - A valid image publisher offer.
+// - skus - A valid image SKU.
+// - version - A valid image SKU version.
+// - options - VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get
+// method.
+func (client *VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesClientGetOptions) (VirtualMachineImagesClientGetResponse, error) {
+ var err error
+ const operationName = "VirtualMachineImagesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, location, publisherName, offer, skus, version, options)
+ if err != nil {
+ return VirtualMachineImagesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineImagesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineImagesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *VirtualMachineImagesClient) getCreateRequest(ctx context.Context, location string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publisherName == "" {
+ return nil, errors.New("parameter publisherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName))
+ if offer == "" {
+ return nil, errors.New("parameter offer cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer))
+ if skus == "" {
+ return nil, errors.New("parameter skus cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus))
+ if version == "" {
+ return nil, errors.New("parameter version cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *VirtualMachineImagesClient) getHandleResponse(resp *http.Response) (VirtualMachineImagesClientGetResponse, error) {
+ result := VirtualMachineImagesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImage); err != nil {
+ return VirtualMachineImagesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// List - Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - publisherName - A valid image publisher.
+// - offer - A valid image publisher offer.
+// - skus - A valid image SKU.
+// - options - VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List
+// method.
+func (client *VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, options *VirtualMachineImagesClientListOptions) (VirtualMachineImagesClientListResponse, error) {
+ var err error
+ const operationName = "VirtualMachineImagesClient.List"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listCreateRequest(ctx, location, publisherName, offer, skus, options)
+ if err != nil {
+ return VirtualMachineImagesClientListResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineImagesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineImagesClientListResponse{}, err
+ }
+ resp, err := client.listHandleResponse(httpResp)
+ return resp, err
+}
+
+// listCreateRequest creates the List request.
+func (client *VirtualMachineImagesClient) listCreateRequest(ctx context.Context, location string, publisherName string, offer string, skus string, options *VirtualMachineImagesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publisherName == "" {
+ return nil, errors.New("parameter publisherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName))
+ if offer == "" {
+ return nil, errors.New("parameter offer cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer))
+ if skus == "" {
+ return nil, errors.New("parameter skus cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ if options != nil && options.Orderby != nil {
+ reqQP.Set("$orderby", *options.Orderby)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *VirtualMachineImagesClient) listHandleResponse(resp *http.Response) (VirtualMachineImagesClientListResponse, error) {
+ result := VirtualMachineImagesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil {
+ return VirtualMachineImagesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// ListByEdgeZone - Gets a list of all virtual machine image versions for the specified edge zone
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - edgeZone - The name of the edge zone.
+// - options - VirtualMachineImagesClientListByEdgeZoneOptions contains the optional parameters for the VirtualMachineImagesClient.ListByEdgeZone
+// method.
+func (client *VirtualMachineImagesClient) ListByEdgeZone(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesClientListByEdgeZoneOptions) (VirtualMachineImagesClientListByEdgeZoneResponse, error) {
+ var err error
+ const operationName = "VirtualMachineImagesClient.ListByEdgeZone"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listByEdgeZoneCreateRequest(ctx, location, edgeZone, options)
+ if err != nil {
+ return VirtualMachineImagesClientListByEdgeZoneResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineImagesClientListByEdgeZoneResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineImagesClientListByEdgeZoneResponse{}, err
+ }
+ resp, err := client.listByEdgeZoneHandleResponse(httpResp)
+ return resp, err
+}
+
+// listByEdgeZoneCreateRequest creates the ListByEdgeZone request.
+func (client *VirtualMachineImagesClient) listByEdgeZoneCreateRequest(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesClientListByEdgeZoneOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/vmimages"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if edgeZone == "" {
+ return nil, errors.New("parameter edgeZone cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByEdgeZoneHandleResponse handles the ListByEdgeZone response.
+func (client *VirtualMachineImagesClient) listByEdgeZoneHandleResponse(resp *http.Response) (VirtualMachineImagesClientListByEdgeZoneResponse, error) {
+ result := VirtualMachineImagesClientListByEdgeZoneResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VMImagesInEdgeZoneListResult); err != nil {
+ return VirtualMachineImagesClientListByEdgeZoneResponse{}, err
+ }
+ return result, nil
+}
+
+// ListOffers - Gets a list of virtual machine image offers for the specified location and publisher.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - publisherName - A valid image publisher.
+// - options - VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers
+// method.
+func (client *VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string, options *VirtualMachineImagesClientListOffersOptions) (VirtualMachineImagesClientListOffersResponse, error) {
+ var err error
+ const operationName = "VirtualMachineImagesClient.ListOffers"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listOffersCreateRequest(ctx, location, publisherName, options)
+ if err != nil {
+ return VirtualMachineImagesClientListOffersResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineImagesClientListOffersResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineImagesClientListOffersResponse{}, err
+ }
+ resp, err := client.listOffersHandleResponse(httpResp)
+ return resp, err
+}
+
+// listOffersCreateRequest creates the ListOffers request.
+func (client *VirtualMachineImagesClient) listOffersCreateRequest(ctx context.Context, location string, publisherName string, options *VirtualMachineImagesClientListOffersOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publisherName == "" {
+ return nil, errors.New("parameter publisherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listOffersHandleResponse handles the ListOffers response.
+func (client *VirtualMachineImagesClient) listOffersHandleResponse(resp *http.Response) (VirtualMachineImagesClientListOffersResponse, error) {
+ result := VirtualMachineImagesClientListOffersResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil {
+ return VirtualMachineImagesClientListOffersResponse{}, err
+ }
+ return result, nil
+}
+
+// ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - options - VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers
+// method.
+func (client *VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string, options *VirtualMachineImagesClientListPublishersOptions) (VirtualMachineImagesClientListPublishersResponse, error) {
+ var err error
+ const operationName = "VirtualMachineImagesClient.ListPublishers"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listPublishersCreateRequest(ctx, location, options)
+ if err != nil {
+ return VirtualMachineImagesClientListPublishersResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineImagesClientListPublishersResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineImagesClientListPublishersResponse{}, err
+ }
+ resp, err := client.listPublishersHandleResponse(httpResp)
+ return resp, err
+}
+
+// listPublishersCreateRequest creates the ListPublishers request.
+func (client *VirtualMachineImagesClient) listPublishersCreateRequest(ctx context.Context, location string, options *VirtualMachineImagesClientListPublishersOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listPublishersHandleResponse handles the ListPublishers response.
+func (client *VirtualMachineImagesClient) listPublishersHandleResponse(resp *http.Response) (VirtualMachineImagesClientListPublishersResponse, error) {
+ result := VirtualMachineImagesClientListPublishersResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil {
+ return VirtualMachineImagesClientListPublishersResponse{}, err
+ }
+ return result, nil
+}
+
+// ListSKUs - Gets a list of virtual machine image SKUs for the specified location, publisher, and offer.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - publisherName - A valid image publisher.
+// - offer - A valid image publisher offer.
+// - options - VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs
+// method.
+func (client *VirtualMachineImagesClient) ListSKUs(ctx context.Context, location string, publisherName string, offer string, options *VirtualMachineImagesClientListSKUsOptions) (VirtualMachineImagesClientListSKUsResponse, error) {
+ var err error
+ const operationName = "VirtualMachineImagesClient.ListSKUs"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listSKUsCreateRequest(ctx, location, publisherName, offer, options)
+ if err != nil {
+ return VirtualMachineImagesClientListSKUsResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineImagesClientListSKUsResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineImagesClientListSKUsResponse{}, err
+ }
+ resp, err := client.listSKUsHandleResponse(httpResp)
+ return resp, err
+}
+
+// listSKUsCreateRequest creates the ListSKUs request.
+func (client *VirtualMachineImagesClient) listSKUsCreateRequest(ctx context.Context, location string, publisherName string, offer string, options *VirtualMachineImagesClientListSKUsOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if publisherName == "" {
+ return nil, errors.New("parameter publisherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName))
+ if offer == "" {
+ return nil, errors.New("parameter offer cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listSKUsHandleResponse handles the ListSKUs response.
+func (client *VirtualMachineImagesClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineImagesClientListSKUsResponse, error) {
+ result := VirtualMachineImagesClientListSKUsResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil {
+ return VirtualMachineImagesClientListSKUsResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.go
new file mode 100644
index 000000000..f946cd4d8
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.go
@@ -0,0 +1,430 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// VirtualMachineImagesEdgeZoneClient contains the methods for the VirtualMachineImagesEdgeZone group.
+// Don't use this type directly, use NewVirtualMachineImagesEdgeZoneClient() instead.
+type VirtualMachineImagesEdgeZoneClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineImagesEdgeZoneClient creates a new instance of VirtualMachineImagesEdgeZoneClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineImagesEdgeZoneClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineImagesEdgeZoneClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineImagesEdgeZoneClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Gets a virtual machine image in an edge zone.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - edgeZone - The name of the edge zone.
+// - publisherName - A valid image publisher.
+// - offer - A valid image publisher offer.
+// - skus - A valid image SKU.
+// - version - A valid image SKU version.
+// - options - VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get
+// method.
+func (client *VirtualMachineImagesEdgeZoneClient) Get(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesEdgeZoneClientGetOptions) (VirtualMachineImagesEdgeZoneClientGetResponse, error) {
+ var err error
+ const operationName = "VirtualMachineImagesEdgeZoneClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, location, edgeZone, publisherName, offer, skus, version, options)
+ if err != nil {
+ return VirtualMachineImagesEdgeZoneClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineImagesEdgeZoneClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineImagesEdgeZoneClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *VirtualMachineImagesEdgeZoneClient) getCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string, options *VirtualMachineImagesEdgeZoneClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if edgeZone == "" {
+ return nil, errors.New("parameter edgeZone cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone))
+ if publisherName == "" {
+ return nil, errors.New("parameter publisherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName))
+ if offer == "" {
+ return nil, errors.New("parameter offer cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer))
+ if skus == "" {
+ return nil, errors.New("parameter skus cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus))
+ if version == "" {
+ return nil, errors.New("parameter version cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *VirtualMachineImagesEdgeZoneClient) getHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientGetResponse, error) {
+ result := VirtualMachineImagesEdgeZoneClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImage); err != nil {
+ return VirtualMachineImagesEdgeZoneClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// List - Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - edgeZone - The name of the edge zone.
+// - publisherName - A valid image publisher.
+// - offer - A valid image publisher offer.
+// - skus - A valid image SKU.
+// - options - VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List
+// method.
+func (client *VirtualMachineImagesEdgeZoneClient) List(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, options *VirtualMachineImagesEdgeZoneClientListOptions) (VirtualMachineImagesEdgeZoneClientListResponse, error) {
+ var err error
+ const operationName = "VirtualMachineImagesEdgeZoneClient.List"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listCreateRequest(ctx, location, edgeZone, publisherName, offer, skus, options)
+ if err != nil {
+ return VirtualMachineImagesEdgeZoneClientListResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineImagesEdgeZoneClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineImagesEdgeZoneClientListResponse{}, err
+ }
+ resp, err := client.listHandleResponse(httpResp)
+ return resp, err
+}
+
+// listCreateRequest creates the List request.
+func (client *VirtualMachineImagesEdgeZoneClient) listCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, options *VirtualMachineImagesEdgeZoneClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if edgeZone == "" {
+ return nil, errors.New("parameter edgeZone cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone))
+ if publisherName == "" {
+ return nil, errors.New("parameter publisherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName))
+ if offer == "" {
+ return nil, errors.New("parameter offer cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer))
+ if skus == "" {
+ return nil, errors.New("parameter skus cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{skus}", url.PathEscape(skus))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ if options != nil && options.Orderby != nil {
+ reqQP.Set("$orderby", *options.Orderby)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *VirtualMachineImagesEdgeZoneClient) listHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListResponse, error) {
+ result := VirtualMachineImagesEdgeZoneClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil {
+ return VirtualMachineImagesEdgeZoneClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// ListOffers - Gets a list of virtual machine image offers for the specified location, edge zone and publisher.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - edgeZone - The name of the edge zone.
+// - publisherName - A valid image publisher.
+// - options - VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers
+// method.
+func (client *VirtualMachineImagesEdgeZoneClient) ListOffers(ctx context.Context, location string, edgeZone string, publisherName string, options *VirtualMachineImagesEdgeZoneClientListOffersOptions) (VirtualMachineImagesEdgeZoneClientListOffersResponse, error) {
+ var err error
+ const operationName = "VirtualMachineImagesEdgeZoneClient.ListOffers"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listOffersCreateRequest(ctx, location, edgeZone, publisherName, options)
+ if err != nil {
+ return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err
+ }
+ resp, err := client.listOffersHandleResponse(httpResp)
+ return resp, err
+}
+
+// listOffersCreateRequest creates the ListOffers request.
+func (client *VirtualMachineImagesEdgeZoneClient) listOffersCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, options *VirtualMachineImagesEdgeZoneClientListOffersOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if edgeZone == "" {
+ return nil, errors.New("parameter edgeZone cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone))
+ if publisherName == "" {
+ return nil, errors.New("parameter publisherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listOffersHandleResponse handles the ListOffers response.
+func (client *VirtualMachineImagesEdgeZoneClient) listOffersHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListOffersResponse, error) {
+ result := VirtualMachineImagesEdgeZoneClientListOffersResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil {
+ return VirtualMachineImagesEdgeZoneClientListOffersResponse{}, err
+ }
+ return result, nil
+}
+
+// ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location and edge zone.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - edgeZone - The name of the edge zone.
+// - options - VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers
+// method.
+func (client *VirtualMachineImagesEdgeZoneClient) ListPublishers(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesEdgeZoneClientListPublishersOptions) (VirtualMachineImagesEdgeZoneClientListPublishersResponse, error) {
+ var err error
+ const operationName = "VirtualMachineImagesEdgeZoneClient.ListPublishers"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listPublishersCreateRequest(ctx, location, edgeZone, options)
+ if err != nil {
+ return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err
+ }
+ resp, err := client.listPublishersHandleResponse(httpResp)
+ return resp, err
+}
+
+// listPublishersCreateRequest creates the ListPublishers request.
+func (client *VirtualMachineImagesEdgeZoneClient) listPublishersCreateRequest(ctx context.Context, location string, edgeZone string, options *VirtualMachineImagesEdgeZoneClientListPublishersOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if edgeZone == "" {
+ return nil, errors.New("parameter edgeZone cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listPublishersHandleResponse handles the ListPublishers response.
+func (client *VirtualMachineImagesEdgeZoneClient) listPublishersHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListPublishersResponse, error) {
+ result := VirtualMachineImagesEdgeZoneClientListPublishersResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil {
+ return VirtualMachineImagesEdgeZoneClientListPublishersResponse{}, err
+ }
+ return result, nil
+}
+
+// ListSKUs - Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The name of a supported Azure region.
+// - edgeZone - The name of the edge zone.
+// - publisherName - A valid image publisher.
+// - offer - A valid image publisher offer.
+// - options - VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs
+// method.
+func (client *VirtualMachineImagesEdgeZoneClient) ListSKUs(ctx context.Context, location string, edgeZone string, publisherName string, offer string, options *VirtualMachineImagesEdgeZoneClientListSKUsOptions) (VirtualMachineImagesEdgeZoneClientListSKUsResponse, error) {
+ var err error
+ const operationName = "VirtualMachineImagesEdgeZoneClient.ListSKUs"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listSKUsCreateRequest(ctx, location, edgeZone, publisherName, offer, options)
+ if err != nil {
+ return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err
+ }
+ resp, err := client.listSKUsHandleResponse(httpResp)
+ return resp, err
+}
+
+// listSKUsCreateRequest creates the ListSKUs request.
+func (client *VirtualMachineImagesEdgeZoneClient) listSKUsCreateRequest(ctx context.Context, location string, edgeZone string, publisherName string, offer string, options *VirtualMachineImagesEdgeZoneClientListSKUsOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if edgeZone == "" {
+ return nil, errors.New("parameter edgeZone cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{edgeZone}", url.PathEscape(edgeZone))
+ if publisherName == "" {
+ return nil, errors.New("parameter publisherName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{publisherName}", url.PathEscape(publisherName))
+ if offer == "" {
+ return nil, errors.New("parameter offer cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{offer}", url.PathEscape(offer))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listSKUsHandleResponse handles the ListSKUs response.
+func (client *VirtualMachineImagesEdgeZoneClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineImagesEdgeZoneClientListSKUsResponse, error) {
+ result := VirtualMachineImagesEdgeZoneClientListSKUsResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineImageResourceArray); err != nil {
+ return VirtualMachineImagesEdgeZoneClientListSKUsResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.go
new file mode 100644
index 000000000..6b40675ef
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.go
@@ -0,0 +1,562 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// VirtualMachineRunCommandsClient contains the methods for the VirtualMachineRunCommands group.
+// Don't use this type directly, use NewVirtualMachineRunCommandsClient() instead.
+type VirtualMachineRunCommandsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineRunCommandsClient creates a new instance of VirtualMachineRunCommandsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineRunCommandsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineRunCommandsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineRunCommandsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - The operation to create or update the run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine where the run command should be created or updated.
+// - runCommandName - The name of the virtual machine run command.
+// - runCommand - Parameters supplied to the Create Virtual Machine RunCommand operation.
+// - options - VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate
+// method.
+func (client *VirtualMachineRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineRunCommandsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, runCommandName, runCommand, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineRunCommandsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineRunCommandsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - The operation to create or update the run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineRunCommandsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineRunCommandsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, runCommandName, runCommand, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *VirtualMachineRunCommandsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if runCommandName == "" {
+ return nil, errors.New("parameter runCommandName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ if err := runtime.MarshalAsJSON(req, runCommand); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - The operation to delete the run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine where the run command should be deleted.
+// - runCommandName - The name of the virtual machine run command.
+// - options - VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete
+// method.
+func (client *VirtualMachineRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineRunCommandsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, runCommandName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineRunCommandsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineRunCommandsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - The operation to delete the run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineRunCommandsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineRunCommandsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, runCommandName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *VirtualMachineRunCommandsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if runCommandName == "" {
+ return nil, errors.New("parameter runCommandName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ return req, nil
+}
+
+// Get - Gets specific run command for a subscription in a location.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - location - The location upon which run commands is queried.
+// - commandID - The command id.
+// - options - VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get
+// method.
+func (client *VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string, options *VirtualMachineRunCommandsClientGetOptions) (VirtualMachineRunCommandsClientGetResponse, error) {
+ var err error
+ const operationName = "VirtualMachineRunCommandsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, location, commandID, options)
+ if err != nil {
+ return VirtualMachineRunCommandsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineRunCommandsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineRunCommandsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *VirtualMachineRunCommandsClient) getCreateRequest(ctx context.Context, location string, commandID string, options *VirtualMachineRunCommandsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if commandID == "" {
+ return nil, errors.New("parameter commandID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{commandId}", url.PathEscape(commandID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *VirtualMachineRunCommandsClient) getHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientGetResponse, error) {
+ result := VirtualMachineRunCommandsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RunCommandDocument); err != nil {
+ return VirtualMachineRunCommandsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetByVirtualMachine - The operation to get the run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine containing the run command.
+// - runCommandName - The name of the virtual machine run command.
+// - options - VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine
+// method.
+func (client *VirtualMachineRunCommandsClient) GetByVirtualMachine(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientGetByVirtualMachineOptions) (VirtualMachineRunCommandsClientGetByVirtualMachineResponse, error) {
+ var err error
+ const operationName = "VirtualMachineRunCommandsClient.GetByVirtualMachine"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getByVirtualMachineCreateRequest(ctx, resourceGroupName, vmName, runCommandName, options)
+ if err != nil {
+ return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err
+ }
+ resp, err := client.getByVirtualMachineHandleResponse(httpResp)
+ return resp, err
+}
+
+// getByVirtualMachineCreateRequest creates the GetByVirtualMachine request.
+func (client *VirtualMachineRunCommandsClient) getByVirtualMachineCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientGetByVirtualMachineOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if runCommandName == "" {
+ return nil, errors.New("parameter runCommandName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ return req, nil
+}
+
+// getByVirtualMachineHandleResponse handles the GetByVirtualMachine response.
+func (client *VirtualMachineRunCommandsClient) getByVirtualMachineHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientGetByVirtualMachineResponse, error) {
+ result := VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommand); err != nil {
+ return VirtualMachineRunCommandsClientGetByVirtualMachineResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists all available run commands for a subscription in a location.
+//
+// Generated from API version 2023-07-01
+// - location - The location upon which run commands is queried.
+// - options - VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListPager
+// method.
+func (client *VirtualMachineRunCommandsClient) NewListPager(location string, options *VirtualMachineRunCommandsClientListOptions) *runtime.Pager[VirtualMachineRunCommandsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachineRunCommandsClientListResponse]{
+ More: func(page VirtualMachineRunCommandsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachineRunCommandsClientListResponse) (VirtualMachineRunCommandsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineRunCommandsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, location, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachineRunCommandsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *VirtualMachineRunCommandsClient) listCreateRequest(ctx context.Context, location string, options *VirtualMachineRunCommandsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *VirtualMachineRunCommandsClient) listHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientListResponse, error) {
+ result := VirtualMachineRunCommandsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RunCommandListResult); err != nil {
+ return VirtualMachineRunCommandsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByVirtualMachinePager - The operation to get all run commands of a Virtual Machine.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine containing the run command.
+// - options - VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListByVirtualMachinePager
+// method.
+func (client *VirtualMachineRunCommandsClient) NewListByVirtualMachinePager(resourceGroupName string, vmName string, options *VirtualMachineRunCommandsClientListByVirtualMachineOptions) *runtime.Pager[VirtualMachineRunCommandsClientListByVirtualMachineResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachineRunCommandsClientListByVirtualMachineResponse]{
+ More: func(page VirtualMachineRunCommandsClientListByVirtualMachineResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachineRunCommandsClientListByVirtualMachineResponse) (VirtualMachineRunCommandsClientListByVirtualMachineResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineRunCommandsClient.NewListByVirtualMachinePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByVirtualMachineCreateRequest(ctx, resourceGroupName, vmName, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachineRunCommandsClientListByVirtualMachineResponse{}, err
+ }
+ return client.listByVirtualMachineHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByVirtualMachineCreateRequest creates the ListByVirtualMachine request.
+func (client *VirtualMachineRunCommandsClient) listByVirtualMachineCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachineRunCommandsClientListByVirtualMachineOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ return req, nil
+}
+
+// listByVirtualMachineHandleResponse handles the ListByVirtualMachine response.
+func (client *VirtualMachineRunCommandsClient) listByVirtualMachineHandleResponse(resp *http.Response) (VirtualMachineRunCommandsClientListByVirtualMachineResponse, error) {
+ result := VirtualMachineRunCommandsClientListByVirtualMachineResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommandsListResult); err != nil {
+ return VirtualMachineRunCommandsClientListByVirtualMachineResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - The operation to update the run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine where the run command should be updated.
+// - runCommandName - The name of the virtual machine run command.
+// - runCommand - Parameters supplied to the Update Virtual Machine RunCommand operation.
+// - options - VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate
+// method.
+func (client *VirtualMachineRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineRunCommandsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, vmName, runCommandName, runCommand, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineRunCommandsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineRunCommandsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - The operation to update the run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineRunCommandsClient) update(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineRunCommandsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, runCommandName, runCommand, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *VirtualMachineRunCommandsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if runCommandName == "" {
+ return nil, errors.New("parameter runCommandName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ if err := runtime.MarshalAsJSON(req, runCommand); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.go
new file mode 100644
index 000000000..e02d32dc6
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.go
@@ -0,0 +1,1891 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// VirtualMachinesClient contains the methods for the VirtualMachines group.
+// Don't use this type directly, use NewVirtualMachinesClient() instead.
+type VirtualMachinesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachinesClient creates a new instance of VirtualMachinesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachinesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachinesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginAssessPatches - Assess patches on the VM.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches
+// method.
+func (client *VirtualMachinesClient) BeginAssessPatches(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*runtime.Poller[VirtualMachinesClientAssessPatchesResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.assessPatches(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientAssessPatchesResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientAssessPatchesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// AssessPatches - Assess patches on the VM.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) assessPatches(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginAssessPatches"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.assessPatchesCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// assessPatchesCreateRequest creates the AssessPatches request.
+func (client *VirtualMachinesClient) assessPatchesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginCapture - Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create
+// similar VMs.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - parameters - Parameters supplied to the Capture Virtual Machine operation.
+// - options - VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture
+// method.
+func (client *VirtualMachinesClient) BeginCapture(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*runtime.Poller[VirtualMachinesClientCaptureResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.capture(ctx, resourceGroupName, vmName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientCaptureResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientCaptureResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Capture - Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar
+// VMs.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) capture(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginCapture"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.captureCreateRequest(ctx, resourceGroupName, vmName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// captureCreateRequest creates the Capture request.
+func (client *VirtualMachinesClient) captureCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginConvertToManagedDisks - Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated
+// before invoking this operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks
+// method.
+func (client *VirtualMachinesClient) BeginConvertToManagedDisks(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*runtime.Poller[VirtualMachinesClientConvertToManagedDisksResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.convertToManagedDisks(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientConvertToManagedDisksResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientConvertToManagedDisksResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ConvertToManagedDisks - Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated
+// before invoking this operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) convertToManagedDisks(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginConvertToManagedDisks"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.convertToManagedDisksCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// convertToManagedDisksCreateRequest creates the ConvertToManagedDisks request.
+func (client *VirtualMachinesClient) convertToManagedDisksCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginCreateOrUpdate - The operation to create or update a virtual machine. Please note some properties can be set only
+// during virtual machine creation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - parameters - Parameters supplied to the Create Virtual Machine operation.
+// - options - VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate
+// method.
+func (client *VirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachinesClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, vmName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - The operation to create or update a virtual machine. Please note some properties can be set only during
+// virtual machine creation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *VirtualMachinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDeallocate - Shuts down the virtual machine and releases the compute resources. You are not billed for the compute
+// resources that this virtual machine uses.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate
+// method.
+func (client *VirtualMachinesClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachinesClientDeallocateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deallocate(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientDeallocateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientDeallocateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Deallocate - Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources
+// that this virtual machine uses.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) deallocate(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginDeallocate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deallocateCreateRequest creates the Deallocate request.
+func (client *VirtualMachinesClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Hibernate != nil {
+ reqQP.Set("hibernate", strconv.FormatBool(*options.Hibernate))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginDelete - The operation to delete a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete
+// method.
+func (client *VirtualMachinesClient) BeginDelete(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*runtime.Poller[VirtualMachinesClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - The operation to delete a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *VirtualMachinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.ForceDeletion != nil {
+ reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Generalize - Sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine
+// before performing this operation. For Windows, please refer to Create a managed image of a
+// generalized VM in Azure [https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource]. For Linux,
+// please refer to How to create an image of a virtual machine or VHD
+// [https://docs.microsoft.com/azure/virtual-machines/linux/capture-image].
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize
+// method.
+func (client *VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGeneralizeOptions) (VirtualMachinesClientGeneralizeResponse, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.Generalize"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.generalizeCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return VirtualMachinesClientGeneralizeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachinesClientGeneralizeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachinesClientGeneralizeResponse{}, err
+ }
+ return VirtualMachinesClientGeneralizeResponse{}, nil
+}
+
+// generalizeCreateRequest creates the Generalize request.
+func (client *VirtualMachinesClient) generalizeCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGeneralizeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Retrieves information about the model view or the instance view of a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method.
+func (client *VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGetOptions) (VirtualMachinesClientGetResponse, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return VirtualMachinesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachinesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachinesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *VirtualMachinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *VirtualMachinesClient) getHandleResponse(resp *http.Response) (VirtualMachinesClientGetResponse, error) {
+ result := VirtualMachinesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachine); err != nil {
+ return VirtualMachinesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginInstallPatches - Installs patches on the VM.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - installPatchesInput - Input for InstallPatches as directly received by the API
+// - options - VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches
+// method.
+func (client *VirtualMachinesClient) BeginInstallPatches(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*runtime.Poller[VirtualMachinesClientInstallPatchesResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.installPatches(ctx, resourceGroupName, vmName, installPatchesInput, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientInstallPatchesResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientInstallPatchesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// InstallPatches - Installs patches on the VM.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) installPatches(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginInstallPatches"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.installPatchesCreateRequest(ctx, resourceGroupName, vmName, installPatchesInput, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// installPatchesCreateRequest creates the InstallPatches request.
+func (client *VirtualMachinesClient) installPatchesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, installPatchesInput); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// InstanceView - Retrieves information about the run-time state of a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView
+// method.
+func (client *VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientInstanceViewOptions) (VirtualMachinesClientInstanceViewResponse, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.InstanceView"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.instanceViewCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return VirtualMachinesClientInstanceViewResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachinesClientInstanceViewResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachinesClientInstanceViewResponse{}, err
+ }
+ resp, err := client.instanceViewHandleResponse(httpResp)
+ return resp, err
+}
+
+// instanceViewCreateRequest creates the InstanceView request.
+func (client *VirtualMachinesClient) instanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientInstanceViewOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// instanceViewHandleResponse handles the InstanceView response.
+func (client *VirtualMachinesClient) instanceViewHandleResponse(resp *http.Response) (VirtualMachinesClientInstanceViewResponse, error) {
+ result := VirtualMachinesClientInstanceViewResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineInstanceView); err != nil {
+ return VirtualMachinesClientInstanceViewResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response
+// to get the next page of virtual machines.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - options - VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager
+// method.
+func (client *VirtualMachinesClient) NewListPager(resourceGroupName string, options *VirtualMachinesClientListOptions) *runtime.Pager[VirtualMachinesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListResponse]{
+ More: func(page VirtualMachinesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachinesClientListResponse) (VirtualMachinesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachinesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *VirtualMachinesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachinesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *VirtualMachinesClient) listHandleResponse(resp *http.Response) (VirtualMachinesClientListResponse, error) {
+ result := VirtualMachinesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil {
+ return VirtualMachinesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAllPager - Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response
+// to get the next page of virtual machines.
+//
+// Generated from API version 2023-07-01
+// - options - VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.NewListAllPager
+// method.
+func (client *VirtualMachinesClient) NewListAllPager(options *VirtualMachinesClientListAllOptions) *runtime.Pager[VirtualMachinesClientListAllResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListAllResponse]{
+ More: func(page VirtualMachinesClientListAllResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachinesClientListAllResponse) (VirtualMachinesClientListAllResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListAllPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAllCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachinesClientListAllResponse{}, err
+ }
+ return client.listAllHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAllCreateRequest creates the ListAll request.
+func (client *VirtualMachinesClient) listAllCreateRequest(ctx context.Context, options *VirtualMachinesClientListAllOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ if options != nil && options.StatusOnly != nil {
+ reqQP.Set("statusOnly", *options.StatusOnly)
+ }
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAllHandleResponse handles the ListAll response.
+func (client *VirtualMachinesClient) listAllHandleResponse(resp *http.Response) (VirtualMachinesClientListAllResponse, error) {
+ result := VirtualMachinesClientListAllResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil {
+ return VirtualMachinesClientListAllResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAvailableSizesPager - Lists all available virtual machine sizes to which the specified virtual machine can be resized.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.NewListAvailableSizesPager
+// method.
+func (client *VirtualMachinesClient) NewListAvailableSizesPager(resourceGroupName string, vmName string, options *VirtualMachinesClientListAvailableSizesOptions) *runtime.Pager[VirtualMachinesClientListAvailableSizesResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListAvailableSizesResponse]{
+ More: func(page VirtualMachinesClientListAvailableSizesResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachinesClientListAvailableSizesResponse) (VirtualMachinesClientListAvailableSizesResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListAvailableSizesPager")
+ req, err := client.listAvailableSizesCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return VirtualMachinesClientListAvailableSizesResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachinesClientListAvailableSizesResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return VirtualMachinesClientListAvailableSizesResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listAvailableSizesHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAvailableSizesCreateRequest creates the ListAvailableSizes request.
+func (client *VirtualMachinesClient) listAvailableSizesCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientListAvailableSizesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAvailableSizesHandleResponse handles the ListAvailableSizes response.
+func (client *VirtualMachinesClient) listAvailableSizesHandleResponse(resp *http.Response) (VirtualMachinesClientListAvailableSizesResponse, error) {
+ result := VirtualMachinesClientListAvailableSizesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil {
+ return VirtualMachinesClientListAvailableSizesResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByLocationPager - Gets all the virtual machines under the specified subscription for the specified location.
+//
+// Generated from API version 2023-07-01
+// - location - The location for which virtual machines under the subscription are queried.
+// - options - VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.NewListByLocationPager
+// method.
+func (client *VirtualMachinesClient) NewListByLocationPager(location string, options *VirtualMachinesClientListByLocationOptions) *runtime.Pager[VirtualMachinesClientListByLocationResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachinesClientListByLocationResponse]{
+ More: func(page VirtualMachinesClientListByLocationResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachinesClientListByLocationResponse) (VirtualMachinesClientListByLocationResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachinesClient.NewListByLocationPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByLocationCreateRequest(ctx, location, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachinesClientListByLocationResponse{}, err
+ }
+ return client.listByLocationHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByLocationCreateRequest creates the ListByLocation request.
+func (client *VirtualMachinesClient) listByLocationCreateRequest(ctx context.Context, location string, options *VirtualMachinesClientListByLocationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByLocationHandleResponse handles the ListByLocation response.
+func (client *VirtualMachinesClient) listByLocationHandleResponse(resp *http.Response) (VirtualMachinesClientListByLocationResponse, error) {
+ result := VirtualMachinesClientListByLocationResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineListResult); err != nil {
+ return VirtualMachinesClientListByLocationResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginPerformMaintenance - The operation to perform maintenance on a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance
+// method.
+func (client *VirtualMachinesClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachinesClientPerformMaintenanceResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.performMaintenance(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientPerformMaintenanceResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientPerformMaintenanceResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// PerformMaintenance - The operation to perform maintenance on a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) performMaintenance(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginPerformMaintenance"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// performMaintenanceCreateRequest creates the PerformMaintenance request.
+func (client *VirtualMachinesClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginPowerOff - The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same
+// provisioned resources. You are still charged for this virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff
+// method.
+func (client *VirtualMachinesClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachinesClientPowerOffResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.powerOff(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientPowerOffResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientPowerOffResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// PowerOff - The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned
+// resources. You are still charged for this virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) powerOff(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginPowerOff"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// powerOffCreateRequest creates the PowerOff request.
+func (client *VirtualMachinesClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.SkipShutdown != nil {
+ reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginReapply - The operation to reapply a virtual machine's state.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply
+// method.
+func (client *VirtualMachinesClient) BeginReapply(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*runtime.Poller[VirtualMachinesClientReapplyResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.reapply(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientReapplyResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientReapplyResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Reapply - The operation to reapply a virtual machine's state.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) reapply(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginReapply"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.reapplyCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// reapplyCreateRequest creates the Reapply request.
+func (client *VirtualMachinesClient) reapplyCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginRedeploy - Shuts down the virtual machine, moves it to a new node, and powers it back on.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy
+// method.
+func (client *VirtualMachinesClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*runtime.Poller[VirtualMachinesClientRedeployResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.redeploy(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRedeployResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientRedeployResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Redeploy - Shuts down the virtual machine, moves it to a new node, and powers it back on.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) redeploy(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginRedeploy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// redeployCreateRequest creates the Redeploy request.
+func (client *VirtualMachinesClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginReimage - Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual
+// machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE:
+// The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk
+// will be preserved after reimage. If deleteOption is delete, the old OS disk
+// will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage
+// method.
+func (client *VirtualMachinesClient) BeginReimage(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*runtime.Poller[VirtualMachinesClientReimageResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.reimage(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientReimageResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientReimageResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Reimage - Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines
+// who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE:
+// The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk
+// will be preserved after reimage. If deleteOption is delete, the old OS disk
+// will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) reimage(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginReimage"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// reimageCreateRequest creates the Reimage request.
+func (client *VirtualMachinesClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginRestart - The operation to restart a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart
+// method.
+func (client *VirtualMachinesClient) BeginRestart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*runtime.Poller[VirtualMachinesClientRestartResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.restart(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Restart - The operation to restart a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) restart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginRestart"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.restartCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// restartCreateRequest creates the Restart request.
+func (client *VirtualMachinesClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// RetrieveBootDiagnosticsData - The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData
+// method.
+func (client *VirtualMachinesClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientRetrieveBootDiagnosticsDataOptions) (VirtualMachinesClientRetrieveBootDiagnosticsDataResponse, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.RetrieveBootDiagnosticsData"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.retrieveBootDiagnosticsDataCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err
+ }
+ resp, err := client.retrieveBootDiagnosticsDataHandleResponse(httpResp)
+ return resp, err
+}
+
+// retrieveBootDiagnosticsDataCreateRequest creates the RetrieveBootDiagnosticsData request.
+func (client *VirtualMachinesClient) retrieveBootDiagnosticsDataCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientRetrieveBootDiagnosticsDataOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.SasURIExpirationTimeInMinutes != nil {
+ reqQP.Set("sasUriExpirationTimeInMinutes", strconv.FormatInt(int64(*options.SasURIExpirationTimeInMinutes), 10))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// retrieveBootDiagnosticsDataHandleResponse handles the RetrieveBootDiagnosticsData response.
+func (client *VirtualMachinesClient) retrieveBootDiagnosticsDataHandleResponse(resp *http.Response) (VirtualMachinesClientRetrieveBootDiagnosticsDataResponse, error) {
+ result := VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RetrieveBootDiagnosticsDataResult); err != nil {
+ return VirtualMachinesClientRetrieveBootDiagnosticsDataResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginRunCommand - Run command on the VM.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - parameters - Parameters supplied to the Run command operation.
+// - options - VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand
+// method.
+func (client *VirtualMachinesClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*runtime.Poller[VirtualMachinesClientRunCommandResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.runCommand(ctx, resourceGroupName, vmName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRunCommandResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientRunCommandResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// RunCommand - Run command on the VM.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) runCommand(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginRunCommand"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.runCommandCreateRequest(ctx, resourceGroupName, vmName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// runCommandCreateRequest creates the RunCommand request.
+func (client *VirtualMachinesClient) runCommandCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// SimulateEviction - The operation to simulate the eviction of spot virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction
+// method.
+func (client *VirtualMachinesClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientSimulateEvictionOptions) (VirtualMachinesClientSimulateEvictionResponse, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.SimulateEviction"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.simulateEvictionCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return VirtualMachinesClientSimulateEvictionResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachinesClientSimulateEvictionResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachinesClientSimulateEvictionResponse{}, err
+ }
+ return VirtualMachinesClientSimulateEvictionResponse{}, nil
+}
+
+// simulateEvictionCreateRequest creates the SimulateEviction request.
+func (client *VirtualMachinesClient) simulateEvictionCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientSimulateEvictionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginStart - The operation to start a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - options - VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart
+// method.
+func (client *VirtualMachinesClient) BeginStart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*runtime.Poller[VirtualMachinesClientStartResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.start(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientStartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientStartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Start - The operation to start a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) start(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginStart"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.startCreateRequest(ctx, resourceGroupName, vmName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// startCreateRequest creates the Start request.
+func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginUpdate - The operation to update a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmName - The name of the virtual machine.
+// - parameters - Parameters supplied to the Update Virtual Machine operation.
+// - options - VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate
+// method.
+func (client *VirtualMachinesClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*runtime.Poller[VirtualMachinesClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, vmName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachinesClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - The operation to update a virtual machine.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachinesClient) update(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachinesClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, vmName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *VirtualMachinesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmName == "" {
+ return nil, errors.New("parameter vmName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmName}", url.PathEscape(vmName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.go
new file mode 100644
index 000000000..8e5820d44
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.go
@@ -0,0 +1,434 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// VirtualMachineScaleSetExtensionsClient contains the methods for the VirtualMachineScaleSetExtensions group.
+// Don't use this type directly, use NewVirtualMachineScaleSetExtensionsClient() instead.
+type VirtualMachineScaleSetExtensionsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineScaleSetExtensionsClient creates a new instance of VirtualMachineScaleSetExtensionsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetExtensionsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineScaleSetExtensionsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - The operation to create or update an extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set where the extension should be create or updated.
+// - vmssExtensionName - The name of the VM scale set extension.
+// - extensionParameters - Parameters supplied to the Create VM scale set Extension operation.
+// - options - VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate
+// method.
+func (client *VirtualMachineScaleSetExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - The operation to create or update an extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *VirtualMachineScaleSetExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if vmssExtensionName == "" {
+ return nil, errors.New("parameter vmssExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - The operation to delete the extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set where the extension should be deleted.
+// - vmssExtensionName - The name of the VM scale set extension.
+// - options - VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete
+// method.
+func (client *VirtualMachineScaleSetExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetExtensionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetExtensionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - The operation to delete the extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetExtensionsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *VirtualMachineScaleSetExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if vmssExtensionName == "" {
+ return nil, errors.New("parameter vmssExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - The operation to get the extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set containing the extension.
+// - vmssExtensionName - The name of the VM scale set extension.
+// - options - VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get
+// method.
+func (client *VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientGetOptions) (VirtualMachineScaleSetExtensionsClientGetResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetExtensionsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, options)
+ if err != nil {
+ return VirtualMachineScaleSetExtensionsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetExtensionsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetExtensionsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *VirtualMachineScaleSetExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if vmssExtensionName == "" {
+ return nil, errors.New("parameter vmssExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *VirtualMachineScaleSetExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetExtensionsClientGetResponse, error) {
+ result := VirtualMachineScaleSetExtensionsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetExtension); err != nil {
+ return VirtualMachineScaleSetExtensionsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets a list of all extensions in a VM scale set.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set containing the extension.
+// - options - VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.NewListPager
+// method.
+func (client *VirtualMachineScaleSetExtensionsClient) NewListPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetExtensionsClientListOptions) *runtime.Pager[VirtualMachineScaleSetExtensionsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetExtensionsClientListResponse]{
+ More: func(page VirtualMachineScaleSetExtensionsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetExtensionsClientListResponse) (VirtualMachineScaleSetExtensionsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetExtensionsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachineScaleSetExtensionsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *VirtualMachineScaleSetExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetExtensionsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *VirtualMachineScaleSetExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetExtensionsClientListResponse, error) {
+ result := VirtualMachineScaleSetExtensionsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetExtensionListResult); err != nil {
+ return VirtualMachineScaleSetExtensionsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - The operation to update an extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set where the extension should be updated.
+// - vmssExtensionName - The name of the VM scale set extension.
+// - extensionParameters - Parameters supplied to the Update VM scale set Extension operation.
+// - options - VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate
+// method.
+func (client *VirtualMachineScaleSetExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetExtensionsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetExtensionsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetExtensionsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - The operation to update an extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetExtensionsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetExtensionsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *VirtualMachineScaleSetExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if vmssExtensionName == "" {
+ return nil, errors.New("parameter vmssExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmssExtensionName}", url.PathEscape(vmssExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.go
new file mode 100644
index 000000000..7856e8e69
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.go
@@ -0,0 +1,346 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// VirtualMachineScaleSetRollingUpgradesClient contains the methods for the VirtualMachineScaleSetRollingUpgrades group.
+// Don't use this type directly, use NewVirtualMachineScaleSetRollingUpgradesClient() instead.
+type VirtualMachineScaleSetRollingUpgradesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineScaleSetRollingUpgradesClient creates a new instance of VirtualMachineScaleSetRollingUpgradesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetRollingUpgradesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineScaleSetRollingUpgradesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCancel - Cancels the current virtual machine scale set rolling upgrade.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel
+// method.
+func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginCancel(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientCancelResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.cancel(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetRollingUpgradesClientCancelResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetRollingUpgradesClientCancelResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Cancel - Cancels the current virtual machine scale set rolling upgrade.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetRollingUpgradesClient) cancel(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginCancel"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.cancelCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// cancelCreateRequest creates the Cancel request.
+func (client *VirtualMachineScaleSetRollingUpgradesClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// GetLatest - Gets the status of the latest virtual machine scale set rolling upgrade.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest
+// method.
+func (client *VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions) (VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetRollingUpgradesClient.GetLatest"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getLatestCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err
+ }
+ resp, err := client.getLatestHandleResponse(httpResp)
+ return resp, err
+}
+
+// getLatestCreateRequest creates the GetLatest request.
+func (client *VirtualMachineScaleSetRollingUpgradesClient) getLatestCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getLatestHandleResponse handles the GetLatest response.
+func (client *VirtualMachineScaleSetRollingUpgradesClient) getLatestHandleResponse(resp *http.Response) (VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse, error) {
+ result := VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RollingUpgradeStatusInfo); err != nil {
+ return VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginStartExtensionUpgrade - Starts a rolling upgrade to move all extensions for all virtual machine scale set instances
+// to the latest available extension version. Instances which are already running the latest extension versions
+// are not affected.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters
+// for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade method.
+func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartExtensionUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.startExtensionUpgrade(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// StartExtensionUpgrade - Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to
+// the latest available extension version. Instances which are already running the latest extension versions
+// are not affected.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetRollingUpgradesClient) startExtensionUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.startExtensionUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// startExtensionUpgradeCreateRequest creates the StartExtensionUpgrade request.
+func (client *VirtualMachineScaleSetRollingUpgradesClient) startExtensionUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginStartOSUpgrade - Starts a rolling upgrade to move all virtual machine scale set instances to the latest available
+// Platform Image OS version. Instances which are already running the latest available OS version are not
+// affected.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the
+// VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade method.
+func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartOSUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*runtime.Poller[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.startOSUpgrade(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// StartOSUpgrade - Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform
+// Image OS version. Instances which are already running the latest available OS version are not
+// affected.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetRollingUpgradesClient) startOSUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.startOSUpgradeCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// startOSUpgradeCreateRequest creates the StartOSUpgrade request.
+func (client *VirtualMachineScaleSetRollingUpgradesClient) startOSUpgradeCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.go
new file mode 100644
index 000000000..dc9276c62
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.go
@@ -0,0 +1,1861 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// VirtualMachineScaleSetsClient contains the methods for the VirtualMachineScaleSets group.
+// Don't use this type directly, use NewVirtualMachineScaleSetsClient() instead.
+type VirtualMachineScaleSetsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineScaleSetsClient creates a new instance of VirtualMachineScaleSetsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineScaleSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineScaleSetsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// ConvertToSinglePlacementGroup - Converts SinglePlacementGroup property to false for a existing virtual machine scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the virtual machine scale set to create or update.
+// - parameters - The input object for ConvertToSinglePlacementGroup API.
+// - options - VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup
+// method.
+func (client *VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput, options *VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions) (VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.convertToSinglePlacementGroupCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options)
+ if err != nil {
+ return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, err
+ }
+ return VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse{}, nil
+}
+
+// convertToSinglePlacementGroupCreateRequest creates the ConvertToSinglePlacementGroup request.
+func (client *VirtualMachineScaleSetsClient) convertToSinglePlacementGroupCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput, options *VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginCreateOrUpdate - Create or update a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set to create or update.
+// - parameters - The scale set object.
+// - options - VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Create or update a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *VirtualMachineScaleSetsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDeallocate - Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases
+// the compute resources. You are not billed for the compute resources that this virtual machine
+// scale set deallocates.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeallocateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deallocate(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientDeallocateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientDeallocateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Deallocate - Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the
+// compute resources. You are not billed for the compute resources that this virtual machine
+// scale set deallocates.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) deallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginDeallocate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deallocateCreateRequest creates the Deallocate request.
+func (client *VirtualMachineScaleSetsClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Hibernate != nil {
+ reqQP.Set("hibernate", strconv.FormatBool(*options.Hibernate))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.VMInstanceIDs != nil {
+ if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *VirtualMachineScaleSetsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.ForceDeletion != nil {
+ reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginDeleteInstances - Deletes virtual machines in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - vmInstanceIDs - A list of virtual machine instance IDs from the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginDeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*runtime.Poller[VirtualMachineScaleSetsClientDeleteInstancesResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteInstances(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientDeleteInstancesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientDeleteInstancesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// DeleteInstances - Deletes virtual machines in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) deleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginDeleteInstances"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteInstancesCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteInstancesCreateRequest creates the DeleteInstances request.
+func (client *VirtualMachineScaleSetsClient) deleteInstancesCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.ForceDeletion != nil {
+ reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, vmInstanceIDs); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// ForceRecoveryServiceFabricPlatformUpdateDomainWalk - Manual platform update domain walk to update virtual machines in a
+// service fabric virtual machine scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - platformUpdateDomain - The platform update domain for which a manual recovery walk is requested
+// - options - VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional
+// parameters for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method.
+func (client *VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, vmScaleSetName string, platformUpdateDomain int32, options *VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions) (VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest(ctx, resourceGroupName, vmScaleSetName, platformUpdateDomain, options)
+ if err != nil {
+ return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err
+ }
+ resp, err := client.forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse(httpResp)
+ return resp, err
+}
+
+// forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest creates the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request.
+func (client *VirtualMachineScaleSetsClient) forceRecoveryServiceFabricPlatformUpdateDomainWalkCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, platformUpdateDomain int32, options *VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ reqQP.Set("platformUpdateDomain", strconv.FormatInt(int64(platformUpdateDomain), 10))
+ if options != nil && options.Zone != nil {
+ reqQP.Set("zone", *options.Zone)
+ }
+ if options != nil && options.PlacementGroupID != nil {
+ reqQP.Set("placementGroupId", *options.PlacementGroupID)
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse handles the ForceRecoveryServiceFabricPlatformUpdateDomainWalk response.
+func (client *VirtualMachineScaleSetsClient) forceRecoveryServiceFabricPlatformUpdateDomainWalkHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse, error) {
+ result := VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RecoveryWalkResponse); err != nil {
+ return VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse{}, err
+ }
+ return result, nil
+}
+
+// Get - Display information about a virtual machine scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get
+// method.
+func (client *VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOptions) (VirtualMachineScaleSetsClientGetResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return VirtualMachineScaleSetsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *VirtualMachineScaleSetsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *VirtualMachineScaleSetsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetResponse, error) {
+ result := VirtualMachineScaleSetsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSet); err != nil {
+ return VirtualMachineScaleSetsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetInstanceView - Gets the status of a VM scale set instance.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView
+// method.
+func (client *VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetInstanceViewOptions) (VirtualMachineScaleSetsClientGetInstanceViewResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.GetInstanceView"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err
+ }
+ resp, err := client.getInstanceViewHandleResponse(httpResp)
+ return resp, err
+}
+
+// getInstanceViewCreateRequest creates the GetInstanceView request.
+func (client *VirtualMachineScaleSetsClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetInstanceViewOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getInstanceViewHandleResponse handles the GetInstanceView response.
+func (client *VirtualMachineScaleSetsClient) getInstanceViewHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetInstanceViewResponse, error) {
+ result := VirtualMachineScaleSetsClientGetInstanceViewResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetInstanceView); err != nil {
+ return VirtualMachineScaleSetsClientGetInstanceViewResponse{}, err
+ }
+ return result, nil
+}
+
+// NewGetOSUpgradeHistoryPager - Gets list of OS upgrades on a VM scale set instance.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager
+// method.
+func (client *VirtualMachineScaleSetsClient) NewGetOSUpgradeHistoryPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions) *runtime.Pager[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse]{
+ More: func(page VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse) (VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.getOSUpgradeHistoryCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{}, err
+ }
+ return client.getOSUpgradeHistoryHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// getOSUpgradeHistoryCreateRequest creates the GetOSUpgradeHistory request.
+func (client *VirtualMachineScaleSetsClient) getOSUpgradeHistoryCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getOSUpgradeHistoryHandleResponse handles the GetOSUpgradeHistory response.
+func (client *VirtualMachineScaleSetsClient) getOSUpgradeHistoryHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse, error) {
+ result := VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListOSUpgradeHistory); err != nil {
+ return VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets a list of all VM scale sets under a resource group.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - options - VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListPager
+// method.
+func (client *VirtualMachineScaleSetsClient) NewListPager(resourceGroupName string, options *VirtualMachineScaleSetsClientListOptions) *runtime.Pager[VirtualMachineScaleSetsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListResponse]{
+ More: func(page VirtualMachineScaleSetsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListResponse) (VirtualMachineScaleSetsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachineScaleSetsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *VirtualMachineScaleSetsClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *VirtualMachineScaleSetsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *VirtualMachineScaleSetsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListResponse, error) {
+ result := VirtualMachineScaleSetsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListResult); err != nil {
+ return VirtualMachineScaleSetsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAllPager - Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use
+// nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is
+// null to fetch all the VM Scale Sets.
+//
+// Generated from API version 2023-07-01
+// - options - VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListAllPager
+// method.
+func (client *VirtualMachineScaleSetsClient) NewListAllPager(options *VirtualMachineScaleSetsClientListAllOptions) *runtime.Pager[VirtualMachineScaleSetsClientListAllResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListAllResponse]{
+ More: func(page VirtualMachineScaleSetsClientListAllResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListAllResponse) (VirtualMachineScaleSetsClientListAllResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListAllPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAllCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachineScaleSetsClientListAllResponse{}, err
+ }
+ return client.listAllHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAllCreateRequest creates the ListAll request.
+func (client *VirtualMachineScaleSetsClient) listAllCreateRequest(ctx context.Context, options *VirtualMachineScaleSetsClientListAllOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAllHandleResponse handles the ListAll response.
+func (client *VirtualMachineScaleSetsClient) listAllHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListAllResponse, error) {
+ result := VirtualMachineScaleSetsClientListAllResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListWithLinkResult); err != nil {
+ return VirtualMachineScaleSetsClientListAllResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByLocationPager - Gets all the VM scale sets under the specified subscription for the specified location.
+//
+// Generated from API version 2023-07-01
+// - location - The location for which VM scale sets under the subscription are queried.
+// - options - VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListByLocationPager
+// method.
+func (client *VirtualMachineScaleSetsClient) NewListByLocationPager(location string, options *VirtualMachineScaleSetsClientListByLocationOptions) *runtime.Pager[VirtualMachineScaleSetsClientListByLocationResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListByLocationResponse]{
+ More: func(page VirtualMachineScaleSetsClientListByLocationResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListByLocationResponse) (VirtualMachineScaleSetsClientListByLocationResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListByLocationPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByLocationCreateRequest(ctx, location, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachineScaleSetsClientListByLocationResponse{}, err
+ }
+ return client.listByLocationHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByLocationCreateRequest creates the ListByLocation request.
+func (client *VirtualMachineScaleSetsClient) listByLocationCreateRequest(ctx context.Context, location string, options *VirtualMachineScaleSetsClientListByLocationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByLocationHandleResponse handles the ListByLocation response.
+func (client *VirtualMachineScaleSetsClient) listByLocationHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListByLocationResponse, error) {
+ result := VirtualMachineScaleSetsClientListByLocationResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListResult); err != nil {
+ return VirtualMachineScaleSetsClientListByLocationResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListSKUsPager - Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances
+// allowed for each SKU.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListSKUsPager
+// method.
+func (client *VirtualMachineScaleSetsClient) NewListSKUsPager(resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientListSKUsOptions) *runtime.Pager[VirtualMachineScaleSetsClientListSKUsResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetsClientListSKUsResponse]{
+ More: func(page VirtualMachineScaleSetsClientListSKUsResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetsClientListSKUsResponse) (VirtualMachineScaleSetsClientListSKUsResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetsClient.NewListSKUsPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listSKUsCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachineScaleSetsClientListSKUsResponse{}, err
+ }
+ return client.listSKUsHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listSKUsCreateRequest creates the ListSKUs request.
+func (client *VirtualMachineScaleSetsClient) listSKUsCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientListSKUsOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listSKUsHandleResponse handles the ListSKUs response.
+func (client *VirtualMachineScaleSetsClient) listSKUsHandleResponse(resp *http.Response) (VirtualMachineScaleSetsClientListSKUsResponse, error) {
+ result := VirtualMachineScaleSetsClientListSKUsResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetListSKUsResult); err != nil {
+ return VirtualMachineScaleSetsClientListSKUsResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginPerformMaintenance - Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances
+// which are not eligible for perform maintenance will be failed. Please refer to best practices for more
+// details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachineScaleSetsClientPerformMaintenanceResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.performMaintenance(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientPerformMaintenanceResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientPerformMaintenanceResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// PerformMaintenance - Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which
+// are not eligible for perform maintenance will be failed. Please refer to best practices for more
+// details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) performMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginPerformMaintenance"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// performMaintenanceCreateRequest creates the PerformMaintenance request.
+func (client *VirtualMachineScaleSetsClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.VMInstanceIDs != nil {
+ if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginPowerOff - Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached
+// and you are getting charged for the resources. Instead, use deallocate to release resources and
+// avoid charges.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachineScaleSetsClientPowerOffResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.powerOff(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientPowerOffResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientPowerOffResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// PowerOff - Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and
+// you are getting charged for the resources. Instead, use deallocate to release resources and
+// avoid charges.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) powerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginPowerOff"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// powerOffCreateRequest creates the PowerOff request.
+func (client *VirtualMachineScaleSetsClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.SkipShutdown != nil {
+ reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.VMInstanceIDs != nil {
+ if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginReapply - Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginReapplyOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReapply
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginReapply(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReapplyOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReapplyResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.reapply(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientReapplyResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientReapplyResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Reapply - Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) reapply(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReapplyOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginReapply"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.reapplyCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// reapplyCreateRequest creates the Reapply request.
+func (client *VirtualMachineScaleSetsClient) reapplyCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReapplyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reapply"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginRedeploy - Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers
+// them back on.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*runtime.Poller[VirtualMachineScaleSetsClientRedeployResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.redeploy(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientRedeployResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientRedeployResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Redeploy - Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them
+// back on.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) redeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginRedeploy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// redeployCreateRequest creates the Redeploy request.
+func (client *VirtualMachineScaleSetsClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.VMInstanceIDs != nil {
+ if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginReimage - Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have
+// a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is
+// reset to initial state.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReimageResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.reimage(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientReimageResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientReimageResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Reimage - Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral
+// OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is
+// reset to initial state.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) reimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginReimage"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// reimageCreateRequest creates the Reimage request.
+func (client *VirtualMachineScaleSetsClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.VMScaleSetReimageInput != nil {
+ if err := runtime.MarshalAsJSON(req, *options.VMScaleSetReimageInput); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginReimageAll - Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation
+// is only supported for managed disks.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*runtime.Poller[VirtualMachineScaleSetsClientReimageAllResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.reimageAll(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientReimageAllResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientReimageAllResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ReimageAll - Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation
+// is only supported for managed disks.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) reimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginReimageAll"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.reimageAllCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// reimageAllCreateRequest creates the ReimageAll request.
+func (client *VirtualMachineScaleSetsClient) reimageAllCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.VMInstanceIDs != nil {
+ if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginRestart - Restarts one or more virtual machines in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*runtime.Poller[VirtualMachineScaleSetsClientRestartResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.restart(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Restart - Restarts one or more virtual machines in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) restart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginRestart"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.restartCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// restartCreateRequest creates the Restart request.
+func (client *VirtualMachineScaleSetsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.VMInstanceIDs != nil {
+ if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginSetOrchestrationServiceState - Changes ServiceState property for a given service
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the virtual machine scale set to create or update.
+// - parameters - The input object for SetOrchestrationServiceState API.
+// - options - VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the
+// VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState method.
+func (client *VirtualMachineScaleSetsClient) BeginSetOrchestrationServiceState(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.setOrchestrationServiceState(ctx, resourceGroupName, vmScaleSetName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// SetOrchestrationServiceState - Changes ServiceState property for a given service
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) setOrchestrationServiceState(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.setOrchestrationServiceStateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// setOrchestrationServiceStateCreateRequest creates the SetOrchestrationServiceState request.
+func (client *VirtualMachineScaleSetsClient) setOrchestrationServiceStateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginStart - Starts one or more virtual machines in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*runtime.Poller[VirtualMachineScaleSetsClientStartResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.start(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientStartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientStartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Start - Starts one or more virtual machines in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) start(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginStart"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.startCreateRequest(ctx, resourceGroupName, vmScaleSetName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// startCreateRequest creates the Start request.
+func (client *VirtualMachineScaleSetsClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.VMInstanceIDs != nil {
+ if err := runtime.MarshalAsJSON(req, *options.VMInstanceIDs); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginUpdate - Update a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set to create or update.
+// - parameters - The scale set object.
+// - options - VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Update a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *VirtualMachineScaleSetsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginUpdateInstances - Upgrades one or more virtual machines to the latest SKU set in the VM scale set model.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - vmInstanceIDs - A list of virtual machine instance IDs from the VM scale set.
+// - options - VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances
+// method.
+func (client *VirtualMachineScaleSetsClient) BeginUpdateInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*runtime.Poller[VirtualMachineScaleSetsClientUpdateInstancesResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.updateInstances(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetsClientUpdateInstancesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetsClientUpdateInstancesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// UpdateInstances - Upgrades one or more virtual machines to the latest SKU set in the VM scale set model.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetsClient) updateInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetsClient.BeginUpdateInstances"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateInstancesCreateRequest(ctx, resourceGroupName, vmScaleSetName, vmInstanceIDs, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateInstancesCreateRequest creates the UpdateInstances request.
+func (client *VirtualMachineScaleSetsClient) updateInstancesCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, vmInstanceIDs); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.go
new file mode 100644
index 000000000..8d657b688
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.go
@@ -0,0 +1,462 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// VirtualMachineScaleSetVMExtensionsClient contains the methods for the VirtualMachineScaleSetVMExtensions group.
+// Don't use this type directly, use NewVirtualMachineScaleSetVMExtensionsClient() instead.
+type VirtualMachineScaleSetVMExtensionsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineScaleSetVMExtensionsClient creates a new instance of VirtualMachineScaleSetVMExtensionsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMExtensionsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineScaleSetVMExtensionsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - The operation to create or update the VMSS VM extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - vmExtensionName - The name of the virtual machine extension.
+// - extensionParameters - Parameters supplied to the Create Virtual Machine Extension operation.
+// - options - VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate
+// method.
+func (client *VirtualMachineScaleSetVMExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - The operation to create or update the VMSS VM extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *VirtualMachineScaleSetVMExtensionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if vmExtensionName == "" {
+ return nil, errors.New("parameter vmExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - The operation to delete the VMSS VM extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - vmExtensionName - The name of the virtual machine extension.
+// - options - VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete
+// method.
+func (client *VirtualMachineScaleSetVMExtensionsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMExtensionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMExtensionsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - The operation to delete the VMSS VM extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *VirtualMachineScaleSetVMExtensionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if vmExtensionName == "" {
+ return nil, errors.New("parameter vmExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - The operation to get the VMSS VM extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - vmExtensionName - The name of the virtual machine extension.
+// - options - VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get
+// method.
+func (client *VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientGetOptions) (VirtualMachineScaleSetVMExtensionsClientGetResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMExtensionsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, options)
+ if err != nil {
+ return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *VirtualMachineScaleSetVMExtensionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if vmExtensionName == "" {
+ return nil, errors.New("parameter vmExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *VirtualMachineScaleSetVMExtensionsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMExtensionsClientGetResponse, error) {
+ result := VirtualMachineScaleSetVMExtensionsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMExtension); err != nil {
+ return VirtualMachineScaleSetVMExtensionsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// List - The operation to get all extensions of an instance in Virtual Machine Scaleset.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List
+// method.
+func (client *VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMExtensionsClientListOptions) (VirtualMachineScaleSetVMExtensionsClientListResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMExtensionsClient.List"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err
+ }
+ resp, err := client.listHandleResponse(httpResp)
+ return resp, err
+}
+
+// listCreateRequest creates the List request.
+func (client *VirtualMachineScaleSetVMExtensionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMExtensionsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *VirtualMachineScaleSetVMExtensionsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMExtensionsClientListResponse, error) {
+ result := VirtualMachineScaleSetVMExtensionsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMExtensionsListResult); err != nil {
+ return VirtualMachineScaleSetVMExtensionsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - The operation to update the VMSS VM extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - vmExtensionName - The name of the virtual machine extension.
+// - extensionParameters - Parameters supplied to the Update Virtual Machine Extension operation.
+// - options - VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate
+// method.
+func (client *VirtualMachineScaleSetVMExtensionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMExtensionsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMExtensionsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMExtensionsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - The operation to update the VMSS VM extension.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMExtensionsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, vmExtensionName, extensionParameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *VirtualMachineScaleSetVMExtensionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if vmExtensionName == "" {
+ return nil, errors.New("parameter vmExtensionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmExtensionName}", url.PathEscape(vmExtensionName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.go
new file mode 100644
index 000000000..beb09f99b
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.go
@@ -0,0 +1,462 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// VirtualMachineScaleSetVMRunCommandsClient contains the methods for the VirtualMachineScaleSetVMRunCommands group.
+// Don't use this type directly, use NewVirtualMachineScaleSetVMRunCommandsClient() instead.
+type VirtualMachineScaleSetVMRunCommandsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineScaleSetVMRunCommandsClient creates a new instance of VirtualMachineScaleSetVMRunCommandsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineScaleSetVMRunCommandsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMRunCommandsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineScaleSetVMRunCommandsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginCreateOrUpdate - The operation to create or update the VMSS VM run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - runCommandName - The name of the virtual machine run command.
+// - runCommand - Parameters supplied to the Create Virtual Machine RunCommand operation.
+// - options - VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the
+// VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate method.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - The operation to create or update the VMSS VM run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMRunCommandsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if runCommandName == "" {
+ return nil, errors.New("parameter runCommandName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ if err := runtime.MarshalAsJSON(req, runCommand); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - The operation to delete the VMSS VM run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - runCommandName - The name of the virtual machine run command.
+// - options - VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete
+// method.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMRunCommandsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - The operation to delete the VMSS VM run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMRunCommandsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if runCommandName == "" {
+ return nil, errors.New("parameter runCommandName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ return req, nil
+}
+
+// Get - The operation to get the VMSS VM run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - runCommandName - The name of the virtual machine run command.
+// - options - VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get
+// method.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientGetOptions) (VirtualMachineScaleSetVMRunCommandsClientGetResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMRunCommandsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, options)
+ if err != nil {
+ return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if runCommandName == "" {
+ return nil, errors.New("parameter runCommandName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMRunCommandsClientGetResponse, error) {
+ result := VirtualMachineScaleSetVMRunCommandsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommand); err != nil {
+ return VirtualMachineScaleSetVMRunCommandsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - The operation to get all run commands of an instance in Virtual Machine Scaleset.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.NewListPager
+// method.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) NewListPager(resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMRunCommandsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMRunCommandsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetVMRunCommandsClientListResponse]{
+ More: func(page VirtualMachineScaleSetVMRunCommandsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetVMRunCommandsClientListResponse) (VirtualMachineScaleSetVMRunCommandsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetVMRunCommandsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachineScaleSetVMRunCommandsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) listCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMRunCommandsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMRunCommandsClientListResponse, error) {
+ result := VirtualMachineScaleSetVMRunCommandsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineRunCommandsListResult); err != nil {
+ return VirtualMachineScaleSetVMRunCommandsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginUpdate - The operation to update the VMSS VM run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - runCommandName - The name of the virtual machine run command.
+// - runCommand - Parameters supplied to the Update Virtual Machine RunCommand operation.
+// - options - VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate
+// method.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMRunCommandsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - The operation to update the VMSS VM run command.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMRunCommandsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, runCommandName, runCommand, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *VirtualMachineScaleSetVMRunCommandsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if runCommandName == "" {
+ return nil, errors.New("parameter runCommandName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{runCommandName}", url.PathEscape(runCommandName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ if err := runtime.MarshalAsJSON(req, runCommand); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.go
new file mode 100644
index 000000000..e27cc0a64
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.go
@@ -0,0 +1,1321 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// VirtualMachineScaleSetVMsClient contains the methods for the VirtualMachineScaleSetVMs group.
+// Don't use this type directly, use NewVirtualMachineScaleSetVMsClient() instead.
+type VirtualMachineScaleSetVMsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineScaleSetVMsClient creates a new instance of VirtualMachineScaleSetVMsClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineScaleSetVMsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineScaleSetVMsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineScaleSetVMsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginDeallocate - Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases
+// the compute resources it uses. You are not billed for the compute resources of this virtual
+// machine once it is deallocated.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate
+// method.
+func (client *VirtualMachineScaleSetVMsClient) BeginDeallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeallocateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deallocate(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientDeallocateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientDeallocateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Deallocate - Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the
+// compute resources it uses. You are not billed for the compute resources of this virtual
+// machine once it is deallocated.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMsClient) deallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.BeginDeallocate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deallocateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deallocateCreateRequest creates the Deallocate request.
+func (client *VirtualMachineScaleSetVMsClient) deallocateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/deallocate"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginDelete - Deletes a virtual machine from a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete
+// method.
+func (client *VirtualMachineScaleSetVMsClient) BeginDelete(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a virtual machine from a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *VirtualMachineScaleSetVMsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.ForceDeletion != nil {
+ reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets a virtual machine from a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get
+// method.
+func (client *VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetOptions) (VirtualMachineScaleSetVMsClientGetResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return VirtualMachineScaleSetVMsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetVMsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetVMsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *VirtualMachineScaleSetVMsClient) getCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *VirtualMachineScaleSetVMsClient) getHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientGetResponse, error) {
+ result := VirtualMachineScaleSetVMsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVM); err != nil {
+ return VirtualMachineScaleSetVMsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetInstanceView - Gets the status of a virtual machine from a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView
+// method.
+func (client *VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetInstanceViewOptions) (VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.GetInstanceView"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getInstanceViewCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err
+ }
+ resp, err := client.getInstanceViewHandleResponse(httpResp)
+ return resp, err
+}
+
+// getInstanceViewCreateRequest creates the GetInstanceView request.
+func (client *VirtualMachineScaleSetVMsClient) getInstanceViewCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientGetInstanceViewOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/instanceView"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getInstanceViewHandleResponse handles the GetInstanceView response.
+func (client *VirtualMachineScaleSetVMsClient) getInstanceViewHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientGetInstanceViewResponse, error) {
+ result := VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMInstanceView); err != nil {
+ return VirtualMachineScaleSetVMsClientGetInstanceViewResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets a list of all virtual machines in a VM scale sets.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - virtualMachineScaleSetName - The name of the VM scale set.
+// - options - VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.NewListPager
+// method.
+func (client *VirtualMachineScaleSetVMsClient) NewListPager(resourceGroupName string, virtualMachineScaleSetName string, options *VirtualMachineScaleSetVMsClientListOptions) *runtime.Pager[VirtualMachineScaleSetVMsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachineScaleSetVMsClientListResponse]{
+ More: func(page VirtualMachineScaleSetVMsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachineScaleSetVMsClientListResponse) (VirtualMachineScaleSetVMsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineScaleSetVMsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, virtualMachineScaleSetName, options)
+ }, nil)
+ if err != nil {
+ return VirtualMachineScaleSetVMsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *VirtualMachineScaleSetVMsClient) listCreateRequest(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, options *VirtualMachineScaleSetVMsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if virtualMachineScaleSetName == "" {
+ return nil, errors.New("parameter virtualMachineScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{virtualMachineScaleSetName}", url.PathEscape(virtualMachineScaleSetName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Select != nil {
+ reqQP.Set("$select", *options.Select)
+ }
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *VirtualMachineScaleSetVMsClient) listHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientListResponse, error) {
+ result := VirtualMachineScaleSetVMsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineScaleSetVMListResult); err != nil {
+ return VirtualMachineScaleSetVMsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginPerformMaintenance - Performs maintenance on a virtual machine in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance
+// method.
+func (client *VirtualMachineScaleSetVMsClient) BeginPerformMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.performMaintenance(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientPerformMaintenanceResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// PerformMaintenance - Performs maintenance on a virtual machine in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMsClient) performMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.BeginPerformMaintenance"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.performMaintenanceCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// performMaintenanceCreateRequest creates the PerformMaintenance request.
+func (client *VirtualMachineScaleSetVMsClient) performMaintenanceCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginPowerOff - Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are
+// getting charged for the resources. Instead, use deallocate to release resources and avoid
+// charges.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff
+// method.
+func (client *VirtualMachineScaleSetVMsClient) BeginPowerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientPowerOffResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.powerOff(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientPowerOffResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientPowerOffResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// PowerOff - Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting
+// charged for the resources. Instead, use deallocate to release resources and avoid
+// charges.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMsClient) powerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.BeginPowerOff"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.powerOffCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// powerOffCreateRequest creates the PowerOff request.
+func (client *VirtualMachineScaleSetVMsClient) powerOffCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.SkipShutdown != nil {
+ reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginRedeploy - Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it
+// back on.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy
+// method.
+func (client *VirtualMachineScaleSetVMsClient) BeginRedeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRedeployResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.redeploy(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientRedeployResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientRedeployResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Redeploy - Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back
+// on.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMsClient) redeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.BeginRedeploy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.redeployCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// redeployCreateRequest creates the Redeploy request.
+func (client *VirtualMachineScaleSetVMsClient) redeployCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginReimage - Reimages (upgrade the operating system) a specific virtual machine in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage
+// method.
+func (client *VirtualMachineScaleSetVMsClient) BeginReimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.reimage(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientReimageResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientReimageResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Reimage - Reimages (upgrade the operating system) a specific virtual machine in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMsClient) reimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.BeginReimage"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.reimageCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// reimageCreateRequest creates the Reimage request.
+func (client *VirtualMachineScaleSetVMsClient) reimageCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimage"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.VMScaleSetVMReimageInput != nil {
+ if err := runtime.MarshalAsJSON(req, *options.VMScaleSetVMReimageInput); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// BeginReimageAll - Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation
+// is only supported for managed disks.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll
+// method.
+func (client *VirtualMachineScaleSetVMsClient) BeginReimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientReimageAllResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.reimageAll(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientReimageAllResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientReimageAllResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ReimageAll - Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation
+// is only supported for managed disks.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMsClient) reimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.BeginReimageAll"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.reimageAllCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// reimageAllCreateRequest creates the ReimageAll request.
+func (client *VirtualMachineScaleSetVMsClient) reimageAllCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginRestart - Restarts a virtual machine in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart
+// method.
+func (client *VirtualMachineScaleSetVMsClient) BeginRestart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRestartResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.restart(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientRestartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Restart - Restarts a virtual machine in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMsClient) restart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.BeginRestart"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.restartCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// restartCreateRequest creates the Restart request.
+func (client *VirtualMachineScaleSetVMsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// RetrieveBootDiagnosticsData - The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM
+// scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData
+// method.
+func (client *VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions) (VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.retrieveBootDiagnosticsDataCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err
+ }
+ resp, err := client.retrieveBootDiagnosticsDataHandleResponse(httpResp)
+ return resp, err
+}
+
+// retrieveBootDiagnosticsDataCreateRequest creates the RetrieveBootDiagnosticsData request.
+func (client *VirtualMachineScaleSetVMsClient) retrieveBootDiagnosticsDataCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.SasURIExpirationTimeInMinutes != nil {
+ reqQP.Set("sasUriExpirationTimeInMinutes", strconv.FormatInt(int64(*options.SasURIExpirationTimeInMinutes), 10))
+ }
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// retrieveBootDiagnosticsDataHandleResponse handles the RetrieveBootDiagnosticsData response.
+func (client *VirtualMachineScaleSetVMsClient) retrieveBootDiagnosticsDataHandleResponse(resp *http.Response) (VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse, error) {
+ result := VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.RetrieveBootDiagnosticsDataResult); err != nil {
+ return VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginRunCommand - Run command on a virtual machine in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - parameters - Parameters supplied to the Run command operation.
+// - options - VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand
+// method.
+func (client *VirtualMachineScaleSetVMsClient) BeginRunCommand(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientRunCommandResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.runCommand(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientRunCommandResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientRunCommandResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// RunCommand - Run command on a virtual machine in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMsClient) runCommand(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.BeginRunCommand"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.runCommandCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// runCommandCreateRequest creates the RunCommand request.
+func (client *VirtualMachineScaleSetVMsClient) runCommandCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json, text/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// SimulateEviction - The operation to simulate the eviction of spot virtual machine in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction
+// method.
+func (client *VirtualMachineScaleSetVMsClient) SimulateEviction(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientSimulateEvictionOptions) (VirtualMachineScaleSetVMsClientSimulateEvictionResponse, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.SimulateEviction"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.simulateEvictionCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, err
+ }
+ return VirtualMachineScaleSetVMsClientSimulateEvictionResponse{}, nil
+}
+
+// simulateEvictionCreateRequest creates the SimulateEviction request.
+func (client *VirtualMachineScaleSetVMsClient) simulateEvictionCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientSimulateEvictionOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginStart - Starts a virtual machine in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set.
+// - instanceID - The instance ID of the virtual machine.
+// - options - VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart
+// method.
+func (client *VirtualMachineScaleSetVMsClient) BeginStart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientStartResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.start(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientStartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientStartResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Start - Starts a virtual machine in a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMsClient) start(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.BeginStart"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.startCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// startCreateRequest creates the Start request.
+func (client *VirtualMachineScaleSetVMsClient) startCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginUpdate - Updates a virtual machine of a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+// - resourceGroupName - The name of the resource group.
+// - vmScaleSetName - The name of the VM scale set where the extension should be create or updated.
+// - instanceID - The instance ID of the virtual machine.
+// - parameters - Parameters supplied to the Update Virtual Machine Scale Sets VM operation.
+// - options - VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate
+// method.
+func (client *VirtualMachineScaleSetVMsClient) BeginUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*runtime.Poller[VirtualMachineScaleSetVMsClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachineScaleSetVMsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VirtualMachineScaleSetVMsClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Updates a virtual machine of a VM scale set.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-07-01
+func (client *VirtualMachineScaleSetVMsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "VirtualMachineScaleSetVMsClient.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, vmScaleSetName, instanceID, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *VirtualMachineScaleSetVMsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if vmScaleSetName == "" {
+ return nil, errors.New("parameter vmScaleSetName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{vmScaleSetName}", url.PathEscape(vmScaleSetName))
+ if instanceID == "" {
+ return nil, errors.New("parameter instanceID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.go
new file mode 100644
index 000000000..066ecc7b4
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.go
@@ -0,0 +1,106 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armcompute
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// VirtualMachineSizesClient contains the methods for the VirtualMachineSizes group.
+// Don't use this type directly, use NewVirtualMachineSizesClient() instead.
+type VirtualMachineSizesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewVirtualMachineSizesClient creates a new instance of VirtualMachineSizesClient with the specified values.
+// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+// part of the URI for every service call.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewVirtualMachineSizesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachineSizesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &VirtualMachineSizesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - This API is deprecated. Use Resources Skus [https://docs.microsoft.com/rest/api/compute/resourceskus/list]
+//
+// Generated from API version 2023-07-01
+// - location - The location upon which virtual-machine-sizes is queried.
+// - options - VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.NewListPager
+// method.
+func (client *VirtualMachineSizesClient) NewListPager(location string, options *VirtualMachineSizesClientListOptions) *runtime.Pager[VirtualMachineSizesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[VirtualMachineSizesClientListResponse]{
+ More: func(page VirtualMachineSizesClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *VirtualMachineSizesClientListResponse) (VirtualMachineSizesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "VirtualMachineSizesClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, location, options)
+ if err != nil {
+ return VirtualMachineSizesClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return VirtualMachineSizesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return VirtualMachineSizesClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *VirtualMachineSizesClient) listCreateRequest(ctx context.Context, location string, options *VirtualMachineSizesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes"
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-07-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *VirtualMachineSizesClient) listHandleResponse(resp *http.Response) (VirtualMachineSizesClientListResponse, error) {
+ result := VirtualMachineSizesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.VirtualMachineSizeListResult); err != nil {
+ return VirtualMachineSizesClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/CHANGELOG.md
new file mode 100644
index 000000000..7186a65f1
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/CHANGELOG.md
@@ -0,0 +1,45 @@
+# Release History
+
+## 1.2.0 (2023-11-24)
+### Features Added
+
+- Support for test fakes and OpenTelemetry trace spans.
+
+
+## 1.2.0-beta.3 (2023-10-09)
+
+### Other Changes
+
+- Updated to latest `azcore` beta.
+
+## 1.2.0-beta.2 (2023-07-19)
+
+### Bug Fixes
+
+- Fixed a potential panic in faked paged and long-running operations.
+
+## 1.2.0-beta.1 (2023-06-12)
+
+### Features Added
+
+- Support for test fakes and OpenTelemetry trace spans.
+
+## 1.1.1 (2023-04-14)
+### Bug Fixes
+
+- Fix serialization bug of empty value of `any` type.
+
+
+## 1.1.0 (2023-03-27)
+### Features Added
+
+- New struct `ClientFactory` which is a client factory used to create any client in this module
+
+
+## 1.0.0 (2022-05-16)
+
+The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes.
+
+To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration).
+
+To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt).
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/LICENSE.txt
new file mode 100644
index 000000000..dc0c2ffb3
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/README.md
new file mode 100644
index 000000000..fbe11f6c6
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/README.md
@@ -0,0 +1,100 @@
+# Azure Resources Module for Go
+
+[](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources)
+
+The `armresources` module provides operations for working with Azure Resources.
+
+[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/resources/armresources)
+
+# Getting started
+
+## Prerequisites
+
+- an [Azure subscription](https://azure.microsoft.com/free/)
+- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). 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](https://go.dev/doc/manage-install).)
+
+## Install the package
+
+This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
+
+Install the Azure Resources module:
+
+```sh
+go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources
+```
+
+## Authorization
+
+When creating a client, you will need to provide a credential for authenticating with Azure Resources. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.
+
+```go
+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](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity).
+
+## Client Factory
+
+Azure Resources module consists of one or more clients. We provide a client factory which could be used to create any client in this module.
+
+```go
+clientFactory, err := armresources.NewClientFactory(, 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](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore).
+
+```go
+options := arm.ClientOptions {
+ ClientOptions: azcore.ClientOptions {
+ Cloud: cloud.AzureChina,
+ },
+}
+clientFactory, err := armresources.NewClientFactory(, 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.
+
+```go
+client := clientFactory.NewClient()
+```
+
+## 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.
+
+## More sample code
+
+- [Creating a Fake](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/resources/armresources/fake_example_test.go)
+- [Deployment](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/resource/deployment)
+- [Provider](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/resource/provider)
+- [Resource Group](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/resource/resourcegroups)
+- [Resource](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/resource/resources)
+
+## Provide Feedback
+
+If you encounter bugs or have suggestions, please
+[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Resources` 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](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](https://opensource.microsoft.com/codeofconduct/).
+For more information, see the
+[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
+or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
+additional questions or comments.
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/assets.json
new file mode 100644
index 000000000..cd6e59432
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/assets.json
@@ -0,0 +1,6 @@
+{
+ "AssetsRepo": "Azure/azure-sdk-assets",
+ "AssetsRepoPrefixPath": "go",
+ "TagPrefix": "go/resourcemanager/resources/armresources",
+ "Tag": "go/resourcemanager/resources/armresources_ab8e63cc21"
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/autorest.md
new file mode 100644
index 000000000..58dea419a
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/autorest.md
@@ -0,0 +1,13 @@
+### AutoRest Configuration
+
+> see https://aka.ms/autorest
+
+``` yaml
+azure-arm: true
+require:
+- https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/readme.md
+- https://github.com/Azure/azure-rest-api-specs/blob/4fd842fb73656039ec94ce367bcedee25a57bd18/specification/resources/resource-manager/readme.go.md
+license-header: MICROSOFT_MIT_NO_VERSION
+module-version: 1.2.0
+package-resources: true
+```
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/build.go
new file mode 100644
index 000000000..546b96f36
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/build.go
@@ -0,0 +1,7 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+// This file enables 'go generate' to regenerate this specific SDK
+//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/resources/armresources
+
+package armresources
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/ci.yml
new file mode 100644
index 000000000..bf846e65b
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/ci.yml
@@ -0,0 +1,28 @@
+# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
+trigger:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/resources/armresources/
+
+pr:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/resources/armresources/
+
+stages:
+- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
+ parameters:
+ IncludeRelease: true
+ ServiceDirectory: 'resourcemanager/resources/armresources'
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/client.go
new file mode 100644
index 000000000..46fde2c78
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/client.go
@@ -0,0 +1,1042 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// Client contains the methods for the Resources group.
+// Don't use this type directly, use NewClient() instead.
+type Client struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewClient creates a new instance of Client with the specified values.
+// - subscriptionID - The Microsoft Azure subscription ID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &Client{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CheckExistence - Checks whether a resource exists.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group containing the resource to check. The name is case insensitive.
+// - resourceProviderNamespace - The resource provider of the resource to check.
+// - parentResourcePath - The parent resource identity.
+// - resourceType - The resource type.
+// - resourceName - The name of the resource to check whether it exists.
+// - apiVersion - The API version to use for the operation.
+// - options - ClientCheckExistenceOptions contains the optional parameters for the Client.CheckExistence method.
+func (client *Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, options *ClientCheckExistenceOptions) (ClientCheckExistenceResponse, error) {
+ var err error
+ const operationName = "Client.CheckExistence"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.checkExistenceCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, options)
+ if err != nil {
+ return ClientCheckExistenceResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ClientCheckExistenceResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent, http.StatusNotFound) {
+ err = runtime.NewResponseError(httpResp)
+ return ClientCheckExistenceResponse{}, err
+ }
+ return ClientCheckExistenceResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil
+}
+
+// checkExistenceCreateRequest creates the CheckExistence request.
+func (client *Client) checkExistenceCreateRequest(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, options *ClientCheckExistenceOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ urlPath = strings.ReplaceAll(urlPath, "{parentResourcePath}", parentResourcePath)
+ urlPath = strings.ReplaceAll(urlPath, "{resourceType}", resourceType)
+ if resourceName == "" {
+ return nil, errors.New("parameter resourceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", apiVersion)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CheckExistenceByID - Checks by ID whether a resource exists.
+//
+// Generated from API version 2021-04-01
+// - resourceID - The fully qualified ID of the resource, including the resource name and resource type. Use the format,
+// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
+// - apiVersion - The API version to use for the operation.
+// - options - ClientCheckExistenceByIDOptions contains the optional parameters for the Client.CheckExistenceByID method.
+func (client *Client) CheckExistenceByID(ctx context.Context, resourceID string, apiVersion string, options *ClientCheckExistenceByIDOptions) (ClientCheckExistenceByIDResponse, error) {
+ var err error
+ const operationName = "Client.CheckExistenceByID"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.checkExistenceByIDCreateRequest(ctx, resourceID, apiVersion, options)
+ if err != nil {
+ return ClientCheckExistenceByIDResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ClientCheckExistenceByIDResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent, http.StatusNotFound) {
+ err = runtime.NewResponseError(httpResp)
+ return ClientCheckExistenceByIDResponse{}, err
+ }
+ return ClientCheckExistenceByIDResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil
+}
+
+// checkExistenceByIDCreateRequest creates the CheckExistenceByID request.
+func (client *Client) checkExistenceByIDCreateRequest(ctx context.Context, resourceID string, apiVersion string, options *ClientCheckExistenceByIDOptions) (*policy.Request, error) {
+ urlPath := "/{resourceId}"
+ urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID)
+ req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", apiVersion)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginCreateOrUpdate - Creates a resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group for the resource. The name is case insensitive.
+// - resourceProviderNamespace - The namespace of the resource provider.
+// - parentResourcePath - The parent resource identity.
+// - resourceType - The resource type of the resource to create.
+// - resourceName - The name of the resource to create.
+// - apiVersion - The API version to use for the operation.
+// - parameters - Parameters for creating or updating the resource.
+// - options - ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method.
+func (client *Client) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource, options *ClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - Creates a resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *Client) createOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource, options *ClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "Client.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *Client) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource, options *ClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ urlPath = strings.ReplaceAll(urlPath, "{parentResourcePath}", parentResourcePath)
+ urlPath = strings.ReplaceAll(urlPath, "{resourceType}", resourceType)
+ if resourceName == "" {
+ return nil, errors.New("parameter resourceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", apiVersion)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginCreateOrUpdateByID - Create a resource by ID.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceID - The fully qualified ID of the resource, including the resource name and resource type. Use the format,
+// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
+// - apiVersion - The API version to use for the operation.
+// - parameters - Create or update resource parameters.
+// - options - ClientBeginCreateOrUpdateByIDOptions contains the optional parameters for the Client.BeginCreateOrUpdateByID
+// method.
+func (client *Client) BeginCreateOrUpdateByID(ctx context.Context, resourceID string, apiVersion string, parameters GenericResource, options *ClientBeginCreateOrUpdateByIDOptions) (*runtime.Poller[ClientCreateOrUpdateByIDResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdateByID(ctx, resourceID, apiVersion, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientCreateOrUpdateByIDResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClientCreateOrUpdateByIDResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdateByID - Create a resource by ID.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *Client) createOrUpdateByID(ctx context.Context, resourceID string, apiVersion string, parameters GenericResource, options *ClientBeginCreateOrUpdateByIDOptions) (*http.Response, error) {
+ var err error
+ const operationName = "Client.BeginCreateOrUpdateByID"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateByIDCreateRequest(ctx, resourceID, apiVersion, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateByIDCreateRequest creates the CreateOrUpdateByID request.
+func (client *Client) createOrUpdateByIDCreateRequest(ctx context.Context, resourceID string, apiVersion string, parameters GenericResource, options *ClientBeginCreateOrUpdateByIDOptions) (*policy.Request, error) {
+ urlPath := "/{resourceId}"
+ urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID)
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", apiVersion)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - Deletes a resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group that contains the resource to delete. The name is case insensitive.
+// - resourceProviderNamespace - The namespace of the resource provider.
+// - parentResourcePath - The parent resource identity.
+// - resourceType - The resource type.
+// - resourceName - The name of the resource to delete.
+// - apiVersion - The API version to use for the operation.
+// - options - ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method.
+func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, options *ClientBeginDeleteOptions) (*runtime.Poller[ClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - Deletes a resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *Client) deleteOperation(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, options *ClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "Client.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, options *ClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ urlPath = strings.ReplaceAll(urlPath, "{parentResourcePath}", parentResourcePath)
+ urlPath = strings.ReplaceAll(urlPath, "{resourceType}", resourceType)
+ if resourceName == "" {
+ return nil, errors.New("parameter resourceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", apiVersion)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginDeleteByID - Deletes a resource by ID.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceID - The fully qualified ID of the resource, including the resource name and resource type. Use the format,
+// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
+// - apiVersion - The API version to use for the operation.
+// - options - ClientBeginDeleteByIDOptions contains the optional parameters for the Client.BeginDeleteByID method.
+func (client *Client) BeginDeleteByID(ctx context.Context, resourceID string, apiVersion string, options *ClientBeginDeleteByIDOptions) (*runtime.Poller[ClientDeleteByIDResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteByID(ctx, resourceID, apiVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientDeleteByIDResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClientDeleteByIDResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// DeleteByID - Deletes a resource by ID.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *Client) deleteByID(ctx context.Context, resourceID string, apiVersion string, options *ClientBeginDeleteByIDOptions) (*http.Response, error) {
+ var err error
+ const operationName = "Client.BeginDeleteByID"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteByIDCreateRequest(ctx, resourceID, apiVersion, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteByIDCreateRequest creates the DeleteByID request.
+func (client *Client) deleteByIDCreateRequest(ctx context.Context, resourceID string, apiVersion string, options *ClientBeginDeleteByIDOptions) (*policy.Request, error) {
+ urlPath := "/{resourceId}"
+ urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID)
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", apiVersion)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets a resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group containing the resource to get. The name is case insensitive.
+// - resourceProviderNamespace - The namespace of the resource provider.
+// - parentResourcePath - The parent resource identity.
+// - resourceType - The resource type of the resource.
+// - resourceName - The name of the resource to get.
+// - apiVersion - The API version to use for the operation.
+// - options - ClientGetOptions contains the optional parameters for the Client.Get method.
+func (client *Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, options *ClientGetOptions) (ClientGetResponse, error) {
+ var err error
+ const operationName = "Client.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, options)
+ if err != nil {
+ return ClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, options *ClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ urlPath = strings.ReplaceAll(urlPath, "{parentResourcePath}", parentResourcePath)
+ urlPath = strings.ReplaceAll(urlPath, "{resourceType}", resourceType)
+ if resourceName == "" {
+ return nil, errors.New("parameter resourceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", apiVersion)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, error) {
+ result := ClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GenericResource); err != nil {
+ return ClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetByID - Gets a resource by ID.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceID - The fully qualified ID of the resource, including the resource name and resource type. Use the format,
+// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
+// - apiVersion - The API version to use for the operation.
+// - options - ClientGetByIDOptions contains the optional parameters for the Client.GetByID method.
+func (client *Client) GetByID(ctx context.Context, resourceID string, apiVersion string, options *ClientGetByIDOptions) (ClientGetByIDResponse, error) {
+ var err error
+ const operationName = "Client.GetByID"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getByIDCreateRequest(ctx, resourceID, apiVersion, options)
+ if err != nil {
+ return ClientGetByIDResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ClientGetByIDResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ClientGetByIDResponse{}, err
+ }
+ resp, err := client.getByIDHandleResponse(httpResp)
+ return resp, err
+}
+
+// getByIDCreateRequest creates the GetByID request.
+func (client *Client) getByIDCreateRequest(ctx context.Context, resourceID string, apiVersion string, options *ClientGetByIDOptions) (*policy.Request, error) {
+ urlPath := "/{resourceId}"
+ urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID)
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", apiVersion)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getByIDHandleResponse handles the GetByID response.
+func (client *Client) getByIDHandleResponse(resp *http.Response) (ClientGetByIDResponse, error) {
+ result := ClientGetByIDResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.GenericResource); err != nil {
+ return ClientGetByIDResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Get all the resources in a subscription.
+//
+// Generated from API version 2021-04-01
+// - options - ClientListOptions contains the optional parameters for the Client.NewListPager method.
+func (client *Client) NewListPager(options *ClientListOptions) *runtime.Pager[ClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ClientListResponse]{
+ More: func(page ClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *ClientListResponse) (ClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "Client.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return ClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *Client) listCreateRequest(ctx context.Context, options *ClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resources"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *Client) listHandleResponse(resp *http.Response) (ClientListResponse, error) {
+ result := ClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ResourceListResult); err != nil {
+ return ClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Get all the resources for a resource group.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The resource group with the resources to get.
+// - options - ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager
+// method.
+func (client *Client) NewListByResourceGroupPager(resourceGroupName string, options *ClientListByResourceGroupOptions) *runtime.Pager[ClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ClientListByResourceGroupResponse]{
+ More: func(page ClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *ClientListByResourceGroupResponse) (ClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "Client.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return ClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *Client) listByResourceGroupHandleResponse(resp *http.Response) (ClientListByResourceGroupResponse, error) {
+ result := ClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ResourceListResult); err != nil {
+ return ClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginMoveResources - The resources to be moved must be in the same source resource group in the source subscription being
+// used. The target resource group may be in a different subscription. When moving resources, both the
+// source group and the target group are locked for the duration of the operation. Write and delete operations are blocked
+// on the groups until the move completes.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - sourceResourceGroupName - The name of the resource group from the source subscription containing the resources to be moved.
+// - parameters - Parameters for moving resources.
+// - options - ClientBeginMoveResourcesOptions contains the optional parameters for the Client.BeginMoveResources method.
+func (client *Client) BeginMoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo, options *ClientBeginMoveResourcesOptions) (*runtime.Poller[ClientMoveResourcesResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.moveResources(ctx, sourceResourceGroupName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientMoveResourcesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClientMoveResourcesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// MoveResources - The resources to be moved must be in the same source resource group in the source subscription being used.
+// The target resource group may be in a different subscription. When moving resources, both the
+// source group and the target group are locked for the duration of the operation. Write and delete operations are blocked
+// on the groups until the move completes.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *Client) moveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo, options *ClientBeginMoveResourcesOptions) (*http.Response, error) {
+ var err error
+ const operationName = "Client.BeginMoveResources"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.moveResourcesCreateRequest(ctx, sourceResourceGroupName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// moveResourcesCreateRequest creates the MoveResources request.
+func (client *Client) moveResourcesCreateRequest(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo, options *ClientBeginMoveResourcesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources"
+ if sourceResourceGroupName == "" {
+ return nil, errors.New("parameter sourceResourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{sourceResourceGroupName}", url.PathEscape(sourceResourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginUpdate - Updates a resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group for the resource. The name is case insensitive.
+// - resourceProviderNamespace - The namespace of the resource provider.
+// - parentResourcePath - The parent resource identity.
+// - resourceType - The resource type of the resource to update.
+// - resourceName - The name of the resource to update.
+// - apiVersion - The API version to use for the operation.
+// - parameters - Parameters for updating the resource.
+// - options - ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method.
+func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource, options *ClientBeginUpdateOptions) (*runtime.Poller[ClientUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.update(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClientUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Update - Updates a resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *Client) update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource, options *ClientBeginUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "Client.BeginUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateCreateRequest creates the Update request.
+func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource, options *ClientBeginUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ urlPath = strings.ReplaceAll(urlPath, "{parentResourcePath}", parentResourcePath)
+ urlPath = strings.ReplaceAll(urlPath, "{resourceType}", resourceType)
+ if resourceName == "" {
+ return nil, errors.New("parameter resourceName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", apiVersion)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginUpdateByID - Updates a resource by ID.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceID - The fully qualified ID of the resource, including the resource name and resource type. Use the format,
+// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
+// - apiVersion - The API version to use for the operation.
+// - parameters - Update resource parameters.
+// - options - ClientBeginUpdateByIDOptions contains the optional parameters for the Client.BeginUpdateByID method.
+func (client *Client) BeginUpdateByID(ctx context.Context, resourceID string, apiVersion string, parameters GenericResource, options *ClientBeginUpdateByIDOptions) (*runtime.Poller[ClientUpdateByIDResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.updateByID(ctx, resourceID, apiVersion, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientUpdateByIDResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClientUpdateByIDResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// UpdateByID - Updates a resource by ID.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *Client) updateByID(ctx context.Context, resourceID string, apiVersion string, parameters GenericResource, options *ClientBeginUpdateByIDOptions) (*http.Response, error) {
+ var err error
+ const operationName = "Client.BeginUpdateByID"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateByIDCreateRequest(ctx, resourceID, apiVersion, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// updateByIDCreateRequest creates the UpdateByID request.
+func (client *Client) updateByIDCreateRequest(ctx context.Context, resourceID string, apiVersion string, parameters GenericResource, options *ClientBeginUpdateByIDOptions) (*policy.Request, error) {
+ urlPath := "/{resourceId}"
+ urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID)
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", apiVersion)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginValidateMoveResources - This operation checks whether the specified resources can be moved to the target. The resources
+// to be moved must be in the same source resource group in the source subscription being used. The target
+// resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content).
+// If validation fails, it returns HTTP response code 409 (Conflict) with an
+// error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - sourceResourceGroupName - The name of the resource group from the source subscription containing the resources to be validated
+// for move.
+// - parameters - Parameters for moving resources.
+// - options - ClientBeginValidateMoveResourcesOptions contains the optional parameters for the Client.BeginValidateMoveResources
+// method.
+func (client *Client) BeginValidateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo, options *ClientBeginValidateMoveResourcesOptions) (*runtime.Poller[ClientValidateMoveResourcesResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.validateMoveResources(ctx, sourceResourceGroupName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientValidateMoveResourcesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ClientValidateMoveResourcesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ValidateMoveResources - This operation checks whether the specified resources can be moved to the target. The resources
+// to be moved must be in the same source resource group in the source subscription being used. The target
+// resource group may be in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content).
+// If validation fails, it returns HTTP response code 409 (Conflict) with an
+// error message. Retrieve the URL in the Location header value to check the result of the long-running operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *Client) validateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo, options *ClientBeginValidateMoveResourcesOptions) (*http.Response, error) {
+ var err error
+ const operationName = "Client.BeginValidateMoveResources"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.validateMoveResourcesCreateRequest(ctx, sourceResourceGroupName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// validateMoveResourcesCreateRequest creates the ValidateMoveResources request.
+func (client *Client) validateMoveResourcesCreateRequest(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo, options *ClientBeginValidateMoveResourcesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources"
+ if sourceResourceGroupName == "" {
+ return nil, errors.New("parameter sourceResourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{sourceResourceGroupName}", url.PathEscape(sourceResourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/client_factory.go
new file mode 100644
index 000000000..bcd6487d6
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/client_factory.go
@@ -0,0 +1,86 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+)
+
+// ClientFactory is a client factory used to create any client in this module.
+// Don't use this type directly, use NewClientFactory instead.
+type ClientFactory struct {
+ subscriptionID string
+ credential azcore.TokenCredential
+ options *arm.ClientOptions
+}
+
+// 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 Microsoft Azure subscription ID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {
+ _, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ return &ClientFactory{
+ subscriptionID: subscriptionID, credential: credential,
+ options: options.Clone(),
+ }, nil
+}
+
+// NewClient creates a new instance of Client.
+func (c *ClientFactory) NewClient() *Client {
+ subClient, _ := NewClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewDeploymentOperationsClient creates a new instance of DeploymentOperationsClient.
+func (c *ClientFactory) NewDeploymentOperationsClient() *DeploymentOperationsClient {
+ subClient, _ := NewDeploymentOperationsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewDeploymentsClient creates a new instance of DeploymentsClient.
+func (c *ClientFactory) NewDeploymentsClient() *DeploymentsClient {
+ subClient, _ := NewDeploymentsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewOperationsClient creates a new instance of OperationsClient.
+func (c *ClientFactory) NewOperationsClient() *OperationsClient {
+ subClient, _ := NewOperationsClient(c.credential, c.options)
+ return subClient
+}
+
+// NewProviderResourceTypesClient creates a new instance of ProviderResourceTypesClient.
+func (c *ClientFactory) NewProviderResourceTypesClient() *ProviderResourceTypesClient {
+ subClient, _ := NewProviderResourceTypesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewProvidersClient creates a new instance of ProvidersClient.
+func (c *ClientFactory) NewProvidersClient() *ProvidersClient {
+ subClient, _ := NewProvidersClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewResourceGroupsClient creates a new instance of ResourceGroupsClient.
+func (c *ClientFactory) NewResourceGroupsClient() *ResourceGroupsClient {
+ subClient, _ := NewResourceGroupsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewTagsClient creates a new instance of TagsClient.
+func (c *ClientFactory) NewTagsClient() *TagsClient {
+ subClient, _ := NewTagsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/constants.go
new file mode 100644
index 000000000..6cf0f0dc3
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/constants.go
@@ -0,0 +1,402 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+const (
+ moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources"
+ moduleVersion = "v1.2.0"
+)
+
+// AliasPathAttributes - The attributes of the token that the alias path is referring to.
+type AliasPathAttributes string
+
+const (
+ // AliasPathAttributesModifiable - The token that the alias path is referring to is modifiable by policies with 'modify' effect.
+ AliasPathAttributesModifiable AliasPathAttributes = "Modifiable"
+ // AliasPathAttributesNone - The token that the alias path is referring to has no attributes.
+ AliasPathAttributesNone AliasPathAttributes = "None"
+)
+
+// PossibleAliasPathAttributesValues returns the possible values for the AliasPathAttributes const type.
+func PossibleAliasPathAttributesValues() []AliasPathAttributes {
+ return []AliasPathAttributes{
+ AliasPathAttributesModifiable,
+ AliasPathAttributesNone,
+ }
+}
+
+// AliasPathTokenType - The type of the token that the alias path is referring to.
+type AliasPathTokenType string
+
+const (
+ // AliasPathTokenTypeAny - The token type can be anything.
+ AliasPathTokenTypeAny AliasPathTokenType = "Any"
+ // AliasPathTokenTypeArray - The token type is array.
+ AliasPathTokenTypeArray AliasPathTokenType = "Array"
+ // AliasPathTokenTypeBoolean - The token type is boolean.
+ AliasPathTokenTypeBoolean AliasPathTokenType = "Boolean"
+ // AliasPathTokenTypeInteger - The token type is integer.
+ AliasPathTokenTypeInteger AliasPathTokenType = "Integer"
+ // AliasPathTokenTypeNotSpecified - The token type is not specified.
+ AliasPathTokenTypeNotSpecified AliasPathTokenType = "NotSpecified"
+ // AliasPathTokenTypeNumber - The token type is number.
+ AliasPathTokenTypeNumber AliasPathTokenType = "Number"
+ // AliasPathTokenTypeObject - The token type is object.
+ AliasPathTokenTypeObject AliasPathTokenType = "Object"
+ // AliasPathTokenTypeString - The token type is string.
+ AliasPathTokenTypeString AliasPathTokenType = "String"
+)
+
+// PossibleAliasPathTokenTypeValues returns the possible values for the AliasPathTokenType const type.
+func PossibleAliasPathTokenTypeValues() []AliasPathTokenType {
+ return []AliasPathTokenType{
+ AliasPathTokenTypeAny,
+ AliasPathTokenTypeArray,
+ AliasPathTokenTypeBoolean,
+ AliasPathTokenTypeInteger,
+ AliasPathTokenTypeNotSpecified,
+ AliasPathTokenTypeNumber,
+ AliasPathTokenTypeObject,
+ AliasPathTokenTypeString,
+ }
+}
+
+// AliasPatternType - The type of alias pattern
+type AliasPatternType string
+
+const (
+ // AliasPatternTypeExtract - Extract is the only allowed value.
+ AliasPatternTypeExtract AliasPatternType = "Extract"
+ // AliasPatternTypeNotSpecified - NotSpecified is not allowed.
+ AliasPatternTypeNotSpecified AliasPatternType = "NotSpecified"
+)
+
+// PossibleAliasPatternTypeValues returns the possible values for the AliasPatternType const type.
+func PossibleAliasPatternTypeValues() []AliasPatternType {
+ return []AliasPatternType{
+ AliasPatternTypeExtract,
+ AliasPatternTypeNotSpecified,
+ }
+}
+
+// AliasType - The type of the alias.
+type AliasType string
+
+const (
+ // AliasTypeMask - Alias value is secret.
+ AliasTypeMask AliasType = "Mask"
+ // AliasTypeNotSpecified - Alias type is unknown (same as not providing alias type).
+ AliasTypeNotSpecified AliasType = "NotSpecified"
+ // AliasTypePlainText - Alias value is not secret.
+ AliasTypePlainText AliasType = "PlainText"
+)
+
+// PossibleAliasTypeValues returns the possible values for the AliasType const type.
+func PossibleAliasTypeValues() []AliasType {
+ return []AliasType{
+ AliasTypeMask,
+ AliasTypeNotSpecified,
+ AliasTypePlainText,
+ }
+}
+
+// ChangeType - Type of change that will be made to the resource when the deployment is executed.
+type ChangeType string
+
+const (
+ // ChangeTypeCreate - The resource does not exist in the current state but is present in the desired state. The resource will
+ // be created when the deployment is executed.
+ ChangeTypeCreate ChangeType = "Create"
+ // ChangeTypeDelete - The resource exists in the current state and is missing from the desired state. The resource will be
+ // deleted when the deployment is executed.
+ ChangeTypeDelete ChangeType = "Delete"
+ // ChangeTypeDeploy - The resource exists in the current state and the desired state and will be redeployed when the deployment
+ // is executed. The properties of the resource may or may not change.
+ ChangeTypeDeploy ChangeType = "Deploy"
+ // ChangeTypeIgnore - The resource exists in the current state and is missing from the desired state. The resource will not
+ // be deployed or modified when the deployment is executed.
+ ChangeTypeIgnore ChangeType = "Ignore"
+ // ChangeTypeModify - The resource exists in the current state and the desired state and will be redeployed when the deployment
+ // is executed. The properties of the resource will change.
+ ChangeTypeModify ChangeType = "Modify"
+ // ChangeTypeNoChange - The resource exists in the current state and the desired state and will be redeployed when the deployment
+ // is executed. The properties of the resource will not change.
+ ChangeTypeNoChange ChangeType = "NoChange"
+ // ChangeTypeUnsupported - The resource is not supported by What-If.
+ ChangeTypeUnsupported ChangeType = "Unsupported"
+)
+
+// PossibleChangeTypeValues returns the possible values for the ChangeType const type.
+func PossibleChangeTypeValues() []ChangeType {
+ return []ChangeType{
+ ChangeTypeCreate,
+ ChangeTypeDelete,
+ ChangeTypeDeploy,
+ ChangeTypeIgnore,
+ ChangeTypeModify,
+ ChangeTypeNoChange,
+ ChangeTypeUnsupported,
+ }
+}
+
+// DeploymentMode - The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental
+// mode, resources are deployed without deleting existing resources that are not included in
+// the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included
+// in the template are deleted. Be careful when using Complete mode as you may
+// unintentionally delete resources.
+type DeploymentMode string
+
+const (
+ DeploymentModeComplete DeploymentMode = "Complete"
+ DeploymentModeIncremental DeploymentMode = "Incremental"
+)
+
+// PossibleDeploymentModeValues returns the possible values for the DeploymentMode const type.
+func PossibleDeploymentModeValues() []DeploymentMode {
+ return []DeploymentMode{
+ DeploymentModeComplete,
+ DeploymentModeIncremental,
+ }
+}
+
+// ExpressionEvaluationOptionsScopeType - The scope to be used for evaluation of parameters, variables and functions in a
+// nested template.
+type ExpressionEvaluationOptionsScopeType string
+
+const (
+ ExpressionEvaluationOptionsScopeTypeInner ExpressionEvaluationOptionsScopeType = "Inner"
+ ExpressionEvaluationOptionsScopeTypeNotSpecified ExpressionEvaluationOptionsScopeType = "NotSpecified"
+ ExpressionEvaluationOptionsScopeTypeOuter ExpressionEvaluationOptionsScopeType = "Outer"
+)
+
+// PossibleExpressionEvaluationOptionsScopeTypeValues returns the possible values for the ExpressionEvaluationOptionsScopeType const type.
+func PossibleExpressionEvaluationOptionsScopeTypeValues() []ExpressionEvaluationOptionsScopeType {
+ return []ExpressionEvaluationOptionsScopeType{
+ ExpressionEvaluationOptionsScopeTypeInner,
+ ExpressionEvaluationOptionsScopeTypeNotSpecified,
+ ExpressionEvaluationOptionsScopeTypeOuter,
+ }
+}
+
+// ExtendedLocationType - The extended location type.
+type ExtendedLocationType string
+
+const (
+ ExtendedLocationTypeEdgeZone ExtendedLocationType = "EdgeZone"
+)
+
+// PossibleExtendedLocationTypeValues returns the possible values for the ExtendedLocationType const type.
+func PossibleExtendedLocationTypeValues() []ExtendedLocationType {
+ return []ExtendedLocationType{
+ ExtendedLocationTypeEdgeZone,
+ }
+}
+
+// OnErrorDeploymentType - The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment.
+type OnErrorDeploymentType string
+
+const (
+ OnErrorDeploymentTypeLastSuccessful OnErrorDeploymentType = "LastSuccessful"
+ OnErrorDeploymentTypeSpecificDeployment OnErrorDeploymentType = "SpecificDeployment"
+)
+
+// PossibleOnErrorDeploymentTypeValues returns the possible values for the OnErrorDeploymentType const type.
+func PossibleOnErrorDeploymentTypeValues() []OnErrorDeploymentType {
+ return []OnErrorDeploymentType{
+ OnErrorDeploymentTypeLastSuccessful,
+ OnErrorDeploymentTypeSpecificDeployment,
+ }
+}
+
+// PropertyChangeType - The type of property change.
+type PropertyChangeType string
+
+const (
+ // PropertyChangeTypeArray - The property is an array and contains nested changes.
+ PropertyChangeTypeArray PropertyChangeType = "Array"
+ // PropertyChangeTypeCreate - The property does not exist in the current state but is present in the desired state. The property
+ // will be created when the deployment is executed.
+ PropertyChangeTypeCreate PropertyChangeType = "Create"
+ // PropertyChangeTypeDelete - The property exists in the current state and is missing from the desired state. It will be deleted
+ // when the deployment is executed.
+ PropertyChangeTypeDelete PropertyChangeType = "Delete"
+ // PropertyChangeTypeModify - The property exists in both current and desired state and is different. The value of the property
+ // will change when the deployment is executed.
+ PropertyChangeTypeModify PropertyChangeType = "Modify"
+ // PropertyChangeTypeNoEffect - The property will not be set or updated.
+ PropertyChangeTypeNoEffect PropertyChangeType = "NoEffect"
+)
+
+// PossiblePropertyChangeTypeValues returns the possible values for the PropertyChangeType const type.
+func PossiblePropertyChangeTypeValues() []PropertyChangeType {
+ return []PropertyChangeType{
+ PropertyChangeTypeArray,
+ PropertyChangeTypeCreate,
+ PropertyChangeTypeDelete,
+ PropertyChangeTypeModify,
+ PropertyChangeTypeNoEffect,
+ }
+}
+
+// ProviderAuthorizationConsentState - The provider authorization consent state.
+type ProviderAuthorizationConsentState string
+
+const (
+ ProviderAuthorizationConsentStateConsented ProviderAuthorizationConsentState = "Consented"
+ ProviderAuthorizationConsentStateNotRequired ProviderAuthorizationConsentState = "NotRequired"
+ ProviderAuthorizationConsentStateNotSpecified ProviderAuthorizationConsentState = "NotSpecified"
+ ProviderAuthorizationConsentStateRequired ProviderAuthorizationConsentState = "Required"
+)
+
+// PossibleProviderAuthorizationConsentStateValues returns the possible values for the ProviderAuthorizationConsentState const type.
+func PossibleProviderAuthorizationConsentStateValues() []ProviderAuthorizationConsentState {
+ return []ProviderAuthorizationConsentState{
+ ProviderAuthorizationConsentStateConsented,
+ ProviderAuthorizationConsentStateNotRequired,
+ ProviderAuthorizationConsentStateNotSpecified,
+ ProviderAuthorizationConsentStateRequired,
+ }
+}
+
+// ProvisioningOperation - The name of the current provisioning operation.
+type ProvisioningOperation string
+
+const (
+ // ProvisioningOperationAction - The provisioning operation is action.
+ ProvisioningOperationAction ProvisioningOperation = "Action"
+ // ProvisioningOperationAzureAsyncOperationWaiting - The provisioning operation is waiting Azure async operation.
+ ProvisioningOperationAzureAsyncOperationWaiting ProvisioningOperation = "AzureAsyncOperationWaiting"
+ // ProvisioningOperationCreate - The provisioning operation is create.
+ ProvisioningOperationCreate ProvisioningOperation = "Create"
+ // ProvisioningOperationDelete - The provisioning operation is delete.
+ ProvisioningOperationDelete ProvisioningOperation = "Delete"
+ // ProvisioningOperationDeploymentCleanup - The provisioning operation is cleanup. This operation is part of the 'complete'
+ // mode deployment.
+ ProvisioningOperationDeploymentCleanup ProvisioningOperation = "DeploymentCleanup"
+ // ProvisioningOperationEvaluateDeploymentOutput - The provisioning operation is evaluate output.
+ ProvisioningOperationEvaluateDeploymentOutput ProvisioningOperation = "EvaluateDeploymentOutput"
+ // ProvisioningOperationNotSpecified - The provisioning operation is not specified.
+ ProvisioningOperationNotSpecified ProvisioningOperation = "NotSpecified"
+ // ProvisioningOperationRead - The provisioning operation is read.
+ ProvisioningOperationRead ProvisioningOperation = "Read"
+ // ProvisioningOperationResourceCacheWaiting - The provisioning operation is waiting for resource cache.
+ ProvisioningOperationResourceCacheWaiting ProvisioningOperation = "ResourceCacheWaiting"
+ // ProvisioningOperationWaiting - The provisioning operation is waiting.
+ ProvisioningOperationWaiting ProvisioningOperation = "Waiting"
+)
+
+// PossibleProvisioningOperationValues returns the possible values for the ProvisioningOperation const type.
+func PossibleProvisioningOperationValues() []ProvisioningOperation {
+ return []ProvisioningOperation{
+ ProvisioningOperationAction,
+ ProvisioningOperationAzureAsyncOperationWaiting,
+ ProvisioningOperationCreate,
+ ProvisioningOperationDelete,
+ ProvisioningOperationDeploymentCleanup,
+ ProvisioningOperationEvaluateDeploymentOutput,
+ ProvisioningOperationNotSpecified,
+ ProvisioningOperationRead,
+ ProvisioningOperationResourceCacheWaiting,
+ ProvisioningOperationWaiting,
+ }
+}
+
+// ProvisioningState - Denotes the state of provisioning.
+type ProvisioningState string
+
+const (
+ ProvisioningStateAccepted ProvisioningState = "Accepted"
+ ProvisioningStateCanceled ProvisioningState = "Canceled"
+ ProvisioningStateCreated ProvisioningState = "Created"
+ ProvisioningStateCreating ProvisioningState = "Creating"
+ ProvisioningStateDeleted ProvisioningState = "Deleted"
+ ProvisioningStateDeleting ProvisioningState = "Deleting"
+ ProvisioningStateFailed ProvisioningState = "Failed"
+ ProvisioningStateNotSpecified ProvisioningState = "NotSpecified"
+ ProvisioningStateReady ProvisioningState = "Ready"
+ ProvisioningStateRunning ProvisioningState = "Running"
+ ProvisioningStateSucceeded ProvisioningState = "Succeeded"
+ ProvisioningStateUpdating ProvisioningState = "Updating"
+)
+
+// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
+func PossibleProvisioningStateValues() []ProvisioningState {
+ return []ProvisioningState{
+ ProvisioningStateAccepted,
+ ProvisioningStateCanceled,
+ ProvisioningStateCreated,
+ ProvisioningStateCreating,
+ ProvisioningStateDeleted,
+ ProvisioningStateDeleting,
+ ProvisioningStateFailed,
+ ProvisioningStateNotSpecified,
+ ProvisioningStateReady,
+ ProvisioningStateRunning,
+ ProvisioningStateSucceeded,
+ ProvisioningStateUpdating,
+ }
+}
+
+// ResourceIdentityType - The identity type.
+type ResourceIdentityType string
+
+const (
+ ResourceIdentityTypeNone ResourceIdentityType = "None"
+ ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned"
+ ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned"
+ ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned"
+)
+
+// PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type.
+func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
+ return []ResourceIdentityType{
+ ResourceIdentityTypeNone,
+ ResourceIdentityTypeSystemAssigned,
+ ResourceIdentityTypeSystemAssignedUserAssigned,
+ ResourceIdentityTypeUserAssigned,
+ }
+}
+
+// TagsPatchOperation - The operation type for the patch API.
+type TagsPatchOperation string
+
+const (
+ // TagsPatchOperationDelete - The 'delete' option allows selectively deleting tags based on given names or name/value pairs.
+ TagsPatchOperationDelete TagsPatchOperation = "Delete"
+ // TagsPatchOperationMerge - The 'merge' option allows adding tags with new names and updating the values of tags with existing
+ // names.
+ TagsPatchOperationMerge TagsPatchOperation = "Merge"
+ // TagsPatchOperationReplace - The 'replace' option replaces the entire set of existing tags with a new set.
+ TagsPatchOperationReplace TagsPatchOperation = "Replace"
+)
+
+// PossibleTagsPatchOperationValues returns the possible values for the TagsPatchOperation const type.
+func PossibleTagsPatchOperationValues() []TagsPatchOperation {
+ return []TagsPatchOperation{
+ TagsPatchOperationDelete,
+ TagsPatchOperationMerge,
+ TagsPatchOperationReplace,
+ }
+}
+
+// WhatIfResultFormat - The format of the What-If results
+type WhatIfResultFormat string
+
+const (
+ WhatIfResultFormatFullResourcePayloads WhatIfResultFormat = "FullResourcePayloads"
+ WhatIfResultFormatResourceIDOnly WhatIfResultFormat = "ResourceIdOnly"
+)
+
+// PossibleWhatIfResultFormatValues returns the possible values for the WhatIfResultFormat const type.
+func PossibleWhatIfResultFormatValues() []WhatIfResultFormat {
+ return []WhatIfResultFormat{
+ WhatIfResultFormatFullResourcePayloads,
+ WhatIfResultFormatResourceIDOnly,
+ }
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/deploymentoperations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/deploymentoperations_client.go
new file mode 100644
index 000000000..ec1e1ab80
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/deploymentoperations_client.go
@@ -0,0 +1,685 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// DeploymentOperationsClient contains the methods for the DeploymentOperations group.
+// Don't use this type directly, use NewDeploymentOperationsClient() instead.
+type DeploymentOperationsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewDeploymentOperationsClient creates a new instance of DeploymentOperationsClient with the specified values.
+// - subscriptionID - The Microsoft Azure subscription ID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewDeploymentOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeploymentOperationsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &DeploymentOperationsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Gets a deployments operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - deploymentName - The name of the deployment.
+// - operationID - The ID of the operation to get.
+// - options - DeploymentOperationsClientGetOptions contains the optional parameters for the DeploymentOperationsClient.Get
+// method.
+func (client *DeploymentOperationsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string, operationID string, options *DeploymentOperationsClientGetOptions) (DeploymentOperationsClientGetResponse, error) {
+ var err error
+ const operationName = "DeploymentOperationsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, deploymentName, operationID, options)
+ if err != nil {
+ return DeploymentOperationsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentOperationsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentOperationsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *DeploymentOperationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, deploymentName string, operationID string, options *DeploymentOperationsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if operationID == "" {
+ return nil, errors.New("parameter operationID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *DeploymentOperationsClient) getHandleResponse(resp *http.Response) (DeploymentOperationsClientGetResponse, error) {
+ result := DeploymentOperationsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentOperation); err != nil {
+ return DeploymentOperationsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetAtManagementGroupScope - Gets a deployments operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - groupID - The management group ID.
+// - deploymentName - The name of the deployment.
+// - operationID - The ID of the operation to get.
+// - options - DeploymentOperationsClientGetAtManagementGroupScopeOptions contains the optional parameters for the DeploymentOperationsClient.GetAtManagementGroupScope
+// method.
+func (client *DeploymentOperationsClient) GetAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, operationID string, options *DeploymentOperationsClientGetAtManagementGroupScopeOptions) (DeploymentOperationsClientGetAtManagementGroupScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentOperationsClient.GetAtManagementGroupScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, operationID, options)
+ if err != nil {
+ return DeploymentOperationsClientGetAtManagementGroupScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentOperationsClientGetAtManagementGroupScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentOperationsClientGetAtManagementGroupScopeResponse{}, err
+ }
+ resp, err := client.getAtManagementGroupScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// getAtManagementGroupScopeCreateRequest creates the GetAtManagementGroupScope request.
+func (client *DeploymentOperationsClient) getAtManagementGroupScopeCreateRequest(ctx context.Context, groupID string, deploymentName string, operationID string, options *DeploymentOperationsClientGetAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}"
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if operationID == "" {
+ return nil, errors.New("parameter operationID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getAtManagementGroupScopeHandleResponse handles the GetAtManagementGroupScope response.
+func (client *DeploymentOperationsClient) getAtManagementGroupScopeHandleResponse(resp *http.Response) (DeploymentOperationsClientGetAtManagementGroupScopeResponse, error) {
+ result := DeploymentOperationsClientGetAtManagementGroupScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentOperation); err != nil {
+ return DeploymentOperationsClientGetAtManagementGroupScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// GetAtScope - Gets a deployments operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - deploymentName - The name of the deployment.
+// - operationID - The ID of the operation to get.
+// - options - DeploymentOperationsClientGetAtScopeOptions contains the optional parameters for the DeploymentOperationsClient.GetAtScope
+// method.
+func (client *DeploymentOperationsClient) GetAtScope(ctx context.Context, scope string, deploymentName string, operationID string, options *DeploymentOperationsClientGetAtScopeOptions) (DeploymentOperationsClientGetAtScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentOperationsClient.GetAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getAtScopeCreateRequest(ctx, scope, deploymentName, operationID, options)
+ if err != nil {
+ return DeploymentOperationsClientGetAtScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentOperationsClientGetAtScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentOperationsClientGetAtScopeResponse{}, err
+ }
+ resp, err := client.getAtScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// getAtScopeCreateRequest creates the GetAtScope request.
+func (client *DeploymentOperationsClient) getAtScopeCreateRequest(ctx context.Context, scope string, deploymentName string, operationID string, options *DeploymentOperationsClientGetAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if operationID == "" {
+ return nil, errors.New("parameter operationID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getAtScopeHandleResponse handles the GetAtScope response.
+func (client *DeploymentOperationsClient) getAtScopeHandleResponse(resp *http.Response) (DeploymentOperationsClientGetAtScopeResponse, error) {
+ result := DeploymentOperationsClientGetAtScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentOperation); err != nil {
+ return DeploymentOperationsClientGetAtScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// GetAtSubscriptionScope - Gets a deployments operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - operationID - The ID of the operation to get.
+// - options - DeploymentOperationsClientGetAtSubscriptionScopeOptions contains the optional parameters for the DeploymentOperationsClient.GetAtSubscriptionScope
+// method.
+func (client *DeploymentOperationsClient) GetAtSubscriptionScope(ctx context.Context, deploymentName string, operationID string, options *DeploymentOperationsClientGetAtSubscriptionScopeOptions) (DeploymentOperationsClientGetAtSubscriptionScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentOperationsClient.GetAtSubscriptionScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getAtSubscriptionScopeCreateRequest(ctx, deploymentName, operationID, options)
+ if err != nil {
+ return DeploymentOperationsClientGetAtSubscriptionScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentOperationsClientGetAtSubscriptionScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentOperationsClientGetAtSubscriptionScopeResponse{}, err
+ }
+ resp, err := client.getAtSubscriptionScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// getAtSubscriptionScopeCreateRequest creates the GetAtSubscriptionScope request.
+func (client *DeploymentOperationsClient) getAtSubscriptionScopeCreateRequest(ctx context.Context, deploymentName string, operationID string, options *DeploymentOperationsClientGetAtSubscriptionScopeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if operationID == "" {
+ return nil, errors.New("parameter operationID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getAtSubscriptionScopeHandleResponse handles the GetAtSubscriptionScope response.
+func (client *DeploymentOperationsClient) getAtSubscriptionScopeHandleResponse(resp *http.Response) (DeploymentOperationsClientGetAtSubscriptionScopeResponse, error) {
+ result := DeploymentOperationsClientGetAtSubscriptionScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentOperation); err != nil {
+ return DeploymentOperationsClientGetAtSubscriptionScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// GetAtTenantScope - Gets a deployments operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - operationID - The ID of the operation to get.
+// - options - DeploymentOperationsClientGetAtTenantScopeOptions contains the optional parameters for the DeploymentOperationsClient.GetAtTenantScope
+// method.
+func (client *DeploymentOperationsClient) GetAtTenantScope(ctx context.Context, deploymentName string, operationID string, options *DeploymentOperationsClientGetAtTenantScopeOptions) (DeploymentOperationsClientGetAtTenantScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentOperationsClient.GetAtTenantScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getAtTenantScopeCreateRequest(ctx, deploymentName, operationID, options)
+ if err != nil {
+ return DeploymentOperationsClientGetAtTenantScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentOperationsClientGetAtTenantScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentOperationsClientGetAtTenantScopeResponse{}, err
+ }
+ resp, err := client.getAtTenantScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// getAtTenantScopeCreateRequest creates the GetAtTenantScope request.
+func (client *DeploymentOperationsClient) getAtTenantScopeCreateRequest(ctx context.Context, deploymentName string, operationID string, options *DeploymentOperationsClientGetAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if operationID == "" {
+ return nil, errors.New("parameter operationID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getAtTenantScopeHandleResponse handles the GetAtTenantScope response.
+func (client *DeploymentOperationsClient) getAtTenantScopeHandleResponse(resp *http.Response) (DeploymentOperationsClientGetAtTenantScopeResponse, error) {
+ result := DeploymentOperationsClientGetAtTenantScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentOperation); err != nil {
+ return DeploymentOperationsClientGetAtTenantScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets all deployments operations for a deployment.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentOperationsClientListOptions contains the optional parameters for the DeploymentOperationsClient.NewListPager
+// method.
+func (client *DeploymentOperationsClient) NewListPager(resourceGroupName string, deploymentName string, options *DeploymentOperationsClientListOptions) *runtime.Pager[DeploymentOperationsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeploymentOperationsClientListResponse]{
+ More: func(page DeploymentOperationsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeploymentOperationsClientListResponse) (DeploymentOperationsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeploymentOperationsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, deploymentName, options)
+ }, nil)
+ if err != nil {
+ return DeploymentOperationsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *DeploymentOperationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentOperationsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *DeploymentOperationsClient) listHandleResponse(resp *http.Response) (DeploymentOperationsClientListResponse, error) {
+ result := DeploymentOperationsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentOperationsListResult); err != nil {
+ return DeploymentOperationsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAtManagementGroupScopePager - Gets all deployments operations for a deployment.
+//
+// Generated from API version 2021-04-01
+// - groupID - The management group ID.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentOperationsClientListAtManagementGroupScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtManagementGroupScopePager
+// method.
+func (client *DeploymentOperationsClient) NewListAtManagementGroupScopePager(groupID string, deploymentName string, options *DeploymentOperationsClientListAtManagementGroupScopeOptions) *runtime.Pager[DeploymentOperationsClientListAtManagementGroupScopeResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeploymentOperationsClientListAtManagementGroupScopeResponse]{
+ More: func(page DeploymentOperationsClientListAtManagementGroupScopeResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeploymentOperationsClientListAtManagementGroupScopeResponse) (DeploymentOperationsClientListAtManagementGroupScopeResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeploymentOperationsClient.NewListAtManagementGroupScopePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, options)
+ }, nil)
+ if err != nil {
+ return DeploymentOperationsClientListAtManagementGroupScopeResponse{}, err
+ }
+ return client.listAtManagementGroupScopeHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAtManagementGroupScopeCreateRequest creates the ListAtManagementGroupScope request.
+func (client *DeploymentOperationsClient) listAtManagementGroupScopeCreateRequest(ctx context.Context, groupID string, deploymentName string, options *DeploymentOperationsClientListAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations"
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAtManagementGroupScopeHandleResponse handles the ListAtManagementGroupScope response.
+func (client *DeploymentOperationsClient) listAtManagementGroupScopeHandleResponse(resp *http.Response) (DeploymentOperationsClientListAtManagementGroupScopeResponse, error) {
+ result := DeploymentOperationsClientListAtManagementGroupScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentOperationsListResult); err != nil {
+ return DeploymentOperationsClientListAtManagementGroupScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAtScopePager - Gets all deployments operations for a deployment.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentOperationsClientListAtScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtScopePager
+// method.
+func (client *DeploymentOperationsClient) NewListAtScopePager(scope string, deploymentName string, options *DeploymentOperationsClientListAtScopeOptions) *runtime.Pager[DeploymentOperationsClientListAtScopeResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeploymentOperationsClientListAtScopeResponse]{
+ More: func(page DeploymentOperationsClientListAtScopeResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeploymentOperationsClientListAtScopeResponse) (DeploymentOperationsClientListAtScopeResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeploymentOperationsClient.NewListAtScopePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAtScopeCreateRequest(ctx, scope, deploymentName, options)
+ }, nil)
+ if err != nil {
+ return DeploymentOperationsClientListAtScopeResponse{}, err
+ }
+ return client.listAtScopeHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAtScopeCreateRequest creates the ListAtScope request.
+func (client *DeploymentOperationsClient) listAtScopeCreateRequest(ctx context.Context, scope string, deploymentName string, options *DeploymentOperationsClientListAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAtScopeHandleResponse handles the ListAtScope response.
+func (client *DeploymentOperationsClient) listAtScopeHandleResponse(resp *http.Response) (DeploymentOperationsClientListAtScopeResponse, error) {
+ result := DeploymentOperationsClientListAtScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentOperationsListResult); err != nil {
+ return DeploymentOperationsClientListAtScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAtSubscriptionScopePager - Gets all deployments operations for a deployment.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentOperationsClientListAtSubscriptionScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtSubscriptionScopePager
+// method.
+func (client *DeploymentOperationsClient) NewListAtSubscriptionScopePager(deploymentName string, options *DeploymentOperationsClientListAtSubscriptionScopeOptions) *runtime.Pager[DeploymentOperationsClientListAtSubscriptionScopeResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeploymentOperationsClientListAtSubscriptionScopeResponse]{
+ More: func(page DeploymentOperationsClientListAtSubscriptionScopeResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeploymentOperationsClientListAtSubscriptionScopeResponse) (DeploymentOperationsClientListAtSubscriptionScopeResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeploymentOperationsClient.NewListAtSubscriptionScopePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAtSubscriptionScopeCreateRequest(ctx, deploymentName, options)
+ }, nil)
+ if err != nil {
+ return DeploymentOperationsClientListAtSubscriptionScopeResponse{}, err
+ }
+ return client.listAtSubscriptionScopeHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAtSubscriptionScopeCreateRequest creates the ListAtSubscriptionScope request.
+func (client *DeploymentOperationsClient) listAtSubscriptionScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentOperationsClientListAtSubscriptionScopeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAtSubscriptionScopeHandleResponse handles the ListAtSubscriptionScope response.
+func (client *DeploymentOperationsClient) listAtSubscriptionScopeHandleResponse(resp *http.Response) (DeploymentOperationsClientListAtSubscriptionScopeResponse, error) {
+ result := DeploymentOperationsClientListAtSubscriptionScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentOperationsListResult); err != nil {
+ return DeploymentOperationsClientListAtSubscriptionScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAtTenantScopePager - Gets all deployments operations for a deployment.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentOperationsClientListAtTenantScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtTenantScopePager
+// method.
+func (client *DeploymentOperationsClient) NewListAtTenantScopePager(deploymentName string, options *DeploymentOperationsClientListAtTenantScopeOptions) *runtime.Pager[DeploymentOperationsClientListAtTenantScopeResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeploymentOperationsClientListAtTenantScopeResponse]{
+ More: func(page DeploymentOperationsClientListAtTenantScopeResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeploymentOperationsClientListAtTenantScopeResponse) (DeploymentOperationsClientListAtTenantScopeResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeploymentOperationsClient.NewListAtTenantScopePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAtTenantScopeCreateRequest(ctx, deploymentName, options)
+ }, nil)
+ if err != nil {
+ return DeploymentOperationsClientListAtTenantScopeResponse{}, err
+ }
+ return client.listAtTenantScopeHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAtTenantScopeCreateRequest creates the ListAtTenantScope request.
+func (client *DeploymentOperationsClient) listAtTenantScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentOperationsClientListAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/deployments/{deploymentName}/operations"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAtTenantScopeHandleResponse handles the ListAtTenantScope response.
+func (client *DeploymentOperationsClient) listAtTenantScopeHandleResponse(resp *http.Response) (DeploymentOperationsClientListAtTenantScopeResponse, error) {
+ result := DeploymentOperationsClientListAtTenantScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentOperationsListResult); err != nil {
+ return DeploymentOperationsClientListAtTenantScopeResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/deployments_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/deployments_client.go
new file mode 100644
index 000000000..2e9eff6b7
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/deployments_client.go
@@ -0,0 +1,2995 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// DeploymentsClient contains the methods for the Deployments group.
+// Don't use this type directly, use NewDeploymentsClient() instead.
+type DeploymentsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewDeploymentsClient creates a new instance of DeploymentsClient with the specified values.
+// - subscriptionID - The Microsoft Azure subscription ID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewDeploymentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeploymentsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &DeploymentsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CalculateTemplateHash - Calculate the hash of the given template.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - templateParam - The template provided to calculate hash.
+// - options - DeploymentsClientCalculateTemplateHashOptions contains the optional parameters for the DeploymentsClient.CalculateTemplateHash
+// method.
+func (client *DeploymentsClient) CalculateTemplateHash(ctx context.Context, templateParam any, options *DeploymentsClientCalculateTemplateHashOptions) (DeploymentsClientCalculateTemplateHashResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.CalculateTemplateHash"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.calculateTemplateHashCreateRequest(ctx, templateParam, options)
+ if err != nil {
+ return DeploymentsClientCalculateTemplateHashResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientCalculateTemplateHashResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientCalculateTemplateHashResponse{}, err
+ }
+ resp, err := client.calculateTemplateHashHandleResponse(httpResp)
+ return resp, err
+}
+
+// calculateTemplateHashCreateRequest creates the CalculateTemplateHash request.
+func (client *DeploymentsClient) calculateTemplateHashCreateRequest(ctx context.Context, templateParam any, options *DeploymentsClientCalculateTemplateHashOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/calculateTemplateHash"
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, templateParam); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// calculateTemplateHashHandleResponse handles the CalculateTemplateHash response.
+func (client *DeploymentsClient) calculateTemplateHashHandleResponse(resp *http.Response) (DeploymentsClientCalculateTemplateHashResponse, error) {
+ result := DeploymentsClientCalculateTemplateHashResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TemplateHashResult); err != nil {
+ return DeploymentsClientCalculateTemplateHashResponse{}, err
+ }
+ return result, nil
+}
+
+// Cancel - You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled,
+// the provisioningState is set to Canceled. Canceling a template deployment stops the
+// currently running template deployment and leaves the resource group partially deployed.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientCancelOptions contains the optional parameters for the DeploymentsClient.Cancel method.
+func (client *DeploymentsClient) Cancel(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientCancelOptions) (DeploymentsClientCancelResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.Cancel"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.cancelCreateRequest(ctx, resourceGroupName, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientCancelResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientCancelResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientCancelResponse{}, err
+ }
+ return DeploymentsClientCancelResponse{}, nil
+}
+
+// cancelCreateRequest creates the Cancel request.
+func (client *DeploymentsClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientCancelOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CancelAtManagementGroupScope - You can cancel a deployment only if the provisioningState is Accepted or Running. After
+// the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the
+// currently running template deployment and leaves the resources partially deployed.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - groupID - The management group ID.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientCancelAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtManagementGroupScope
+// method.
+func (client *DeploymentsClient) CancelAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientCancelAtManagementGroupScopeOptions) (DeploymentsClientCancelAtManagementGroupScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.CancelAtManagementGroupScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.cancelAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientCancelAtManagementGroupScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientCancelAtManagementGroupScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientCancelAtManagementGroupScopeResponse{}, err
+ }
+ return DeploymentsClientCancelAtManagementGroupScopeResponse{}, nil
+}
+
+// cancelAtManagementGroupScopeCreateRequest creates the CancelAtManagementGroupScope request.
+func (client *DeploymentsClient) cancelAtManagementGroupScopeCreateRequest(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientCancelAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel"
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CancelAtScope - You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment
+// is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the
+// currently running template deployment and leaves the resources partially deployed.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientCancelAtScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtScope
+// method.
+func (client *DeploymentsClient) CancelAtScope(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientCancelAtScopeOptions) (DeploymentsClientCancelAtScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.CancelAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.cancelAtScopeCreateRequest(ctx, scope, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientCancelAtScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientCancelAtScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientCancelAtScopeResponse{}, err
+ }
+ return DeploymentsClientCancelAtScopeResponse{}, nil
+}
+
+// cancelAtScopeCreateRequest creates the CancelAtScope request.
+func (client *DeploymentsClient) cancelAtScopeCreateRequest(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientCancelAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CancelAtSubscriptionScope - You can cancel a deployment only if the provisioningState is Accepted or Running. After the
+// deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the
+// currently running template deployment and leaves the resources partially deployed.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientCancelAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtSubscriptionScope
+// method.
+func (client *DeploymentsClient) CancelAtSubscriptionScope(ctx context.Context, deploymentName string, options *DeploymentsClientCancelAtSubscriptionScopeOptions) (DeploymentsClientCancelAtSubscriptionScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.CancelAtSubscriptionScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.cancelAtSubscriptionScopeCreateRequest(ctx, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientCancelAtSubscriptionScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientCancelAtSubscriptionScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientCancelAtSubscriptionScopeResponse{}, err
+ }
+ return DeploymentsClientCancelAtSubscriptionScopeResponse{}, nil
+}
+
+// cancelAtSubscriptionScopeCreateRequest creates the CancelAtSubscriptionScope request.
+func (client *DeploymentsClient) cancelAtSubscriptionScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentsClientCancelAtSubscriptionScopeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CancelAtTenantScope - You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment
+// is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the
+// currently running template deployment and leaves the resources partially deployed.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientCancelAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtTenantScope
+// method.
+func (client *DeploymentsClient) CancelAtTenantScope(ctx context.Context, deploymentName string, options *DeploymentsClientCancelAtTenantScopeOptions) (DeploymentsClientCancelAtTenantScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.CancelAtTenantScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.cancelAtTenantScopeCreateRequest(ctx, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientCancelAtTenantScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientCancelAtTenantScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientCancelAtTenantScopeResponse{}, err
+ }
+ return DeploymentsClientCancelAtTenantScopeResponse{}, nil
+}
+
+// cancelAtTenantScopeCreateRequest creates the CancelAtTenantScope request.
+func (client *DeploymentsClient) cancelAtTenantScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentsClientCancelAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/deployments/{deploymentName}/cancel"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CheckExistence - Checks whether the deployment exists.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group with the deployment to check. The name is case insensitive.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientCheckExistenceOptions contains the optional parameters for the DeploymentsClient.CheckExistence
+// method.
+func (client *DeploymentsClient) CheckExistence(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientCheckExistenceOptions) (DeploymentsClientCheckExistenceResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.CheckExistence"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.checkExistenceCreateRequest(ctx, resourceGroupName, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientCheckExistenceResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientCheckExistenceResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent, http.StatusNotFound) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientCheckExistenceResponse{}, err
+ }
+ return DeploymentsClientCheckExistenceResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil
+}
+
+// checkExistenceCreateRequest creates the CheckExistence request.
+func (client *DeploymentsClient) checkExistenceCreateRequest(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientCheckExistenceOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CheckExistenceAtManagementGroupScope - Checks whether the deployment exists.
+//
+// Generated from API version 2021-04-01
+// - groupID - The management group ID.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientCheckExistenceAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtManagementGroupScope
+// method.
+func (client *DeploymentsClient) CheckExistenceAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientCheckExistenceAtManagementGroupScopeOptions) (DeploymentsClientCheckExistenceAtManagementGroupScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.CheckExistenceAtManagementGroupScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.checkExistenceAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientCheckExistenceAtManagementGroupScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientCheckExistenceAtManagementGroupScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent, http.StatusNotFound) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientCheckExistenceAtManagementGroupScopeResponse{}, err
+ }
+ return DeploymentsClientCheckExistenceAtManagementGroupScopeResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil
+}
+
+// checkExistenceAtManagementGroupScopeCreateRequest creates the CheckExistenceAtManagementGroupScope request.
+func (client *DeploymentsClient) checkExistenceAtManagementGroupScopeCreateRequest(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientCheckExistenceAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CheckExistenceAtScope - Checks whether the deployment exists.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientCheckExistenceAtScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtScope
+// method.
+func (client *DeploymentsClient) CheckExistenceAtScope(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientCheckExistenceAtScopeOptions) (DeploymentsClientCheckExistenceAtScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.CheckExistenceAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.checkExistenceAtScopeCreateRequest(ctx, scope, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientCheckExistenceAtScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientCheckExistenceAtScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent, http.StatusNotFound) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientCheckExistenceAtScopeResponse{}, err
+ }
+ return DeploymentsClientCheckExistenceAtScopeResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil
+}
+
+// checkExistenceAtScopeCreateRequest creates the CheckExistenceAtScope request.
+func (client *DeploymentsClient) checkExistenceAtScopeCreateRequest(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientCheckExistenceAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CheckExistenceAtSubscriptionScope - Checks whether the deployment exists.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientCheckExistenceAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtSubscriptionScope
+// method.
+func (client *DeploymentsClient) CheckExistenceAtSubscriptionScope(ctx context.Context, deploymentName string, options *DeploymentsClientCheckExistenceAtSubscriptionScopeOptions) (DeploymentsClientCheckExistenceAtSubscriptionScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.CheckExistenceAtSubscriptionScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.checkExistenceAtSubscriptionScopeCreateRequest(ctx, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientCheckExistenceAtSubscriptionScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientCheckExistenceAtSubscriptionScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent, http.StatusNotFound) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientCheckExistenceAtSubscriptionScopeResponse{}, err
+ }
+ return DeploymentsClientCheckExistenceAtSubscriptionScopeResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil
+}
+
+// checkExistenceAtSubscriptionScopeCreateRequest creates the CheckExistenceAtSubscriptionScope request.
+func (client *DeploymentsClient) checkExistenceAtSubscriptionScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentsClientCheckExistenceAtSubscriptionScopeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CheckExistenceAtTenantScope - Checks whether the deployment exists.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientCheckExistenceAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtTenantScope
+// method.
+func (client *DeploymentsClient) CheckExistenceAtTenantScope(ctx context.Context, deploymentName string, options *DeploymentsClientCheckExistenceAtTenantScopeOptions) (DeploymentsClientCheckExistenceAtTenantScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.CheckExistenceAtTenantScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.checkExistenceAtTenantScopeCreateRequest(ctx, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientCheckExistenceAtTenantScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientCheckExistenceAtTenantScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent, http.StatusNotFound) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientCheckExistenceAtTenantScopeResponse{}, err
+ }
+ return DeploymentsClientCheckExistenceAtTenantScopeResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil
+}
+
+// checkExistenceAtTenantScopeCreateRequest creates the CheckExistenceAtTenantScope request.
+func (client *DeploymentsClient) checkExistenceAtTenantScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentsClientCheckExistenceAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginCreateOrUpdate - You can provide the template and parameters directly in the request or link to JSON files.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group to deploy the resources to. The name is case insensitive. The resource
+// group must already exist.
+// - deploymentName - The name of the deployment.
+// - parameters - Additional parameters supplied to the operation.
+// - options - DeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdate
+// method.
+func (client *DeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DeploymentsClientCreateOrUpdateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdate(ctx, resourceGroupName, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientCreateOrUpdateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdate - You can provide the template and parameters directly in the request or link to JSON files.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginCreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginCreateOrUpdateAtManagementGroupScope - You can provide the template and parameters directly in the request or link
+// to JSON files.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - groupID - The management group ID.
+// - deploymentName - The name of the deployment.
+// - parameters - Additional parameters supplied to the operation.
+// - options - DeploymentsClientBeginCreateOrUpdateAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtManagementGroupScope
+// method.
+func (client *DeploymentsClient) BeginCreateOrUpdateAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginCreateOrUpdateAtManagementGroupScopeOptions) (*runtime.Poller[DeploymentsClientCreateOrUpdateAtManagementGroupScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdateAtManagementGroupScope(ctx, groupID, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientCreateOrUpdateAtManagementGroupScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientCreateOrUpdateAtManagementGroupScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdateAtManagementGroupScope - You can provide the template and parameters directly in the request or link to JSON
+// files.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) createOrUpdateAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginCreateOrUpdateAtManagementGroupScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginCreateOrUpdateAtManagementGroupScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateAtManagementGroupScopeCreateRequest creates the CreateOrUpdateAtManagementGroupScope request.
+func (client *DeploymentsClient) createOrUpdateAtManagementGroupScopeCreateRequest(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginCreateOrUpdateAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginCreateOrUpdateAtScope - You can provide the template and parameters directly in the request or link to JSON files.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - deploymentName - The name of the deployment.
+// - parameters - Additional parameters supplied to the operation.
+// - options - DeploymentsClientBeginCreateOrUpdateAtScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtScope
+// method.
+func (client *DeploymentsClient) BeginCreateOrUpdateAtScope(ctx context.Context, scope string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateAtScopeOptions) (*runtime.Poller[DeploymentsClientCreateOrUpdateAtScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdateAtScope(ctx, scope, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientCreateOrUpdateAtScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientCreateOrUpdateAtScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdateAtScope - You can provide the template and parameters directly in the request or link to JSON files.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) createOrUpdateAtScope(ctx context.Context, scope string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateAtScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginCreateOrUpdateAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateAtScopeCreateRequest(ctx, scope, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateAtScopeCreateRequest creates the CreateOrUpdateAtScope request.
+func (client *DeploymentsClient) createOrUpdateAtScopeCreateRequest(ctx context.Context, scope string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginCreateOrUpdateAtSubscriptionScope - You can provide the template and parameters directly in the request or link to
+// JSON files.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - parameters - Additional parameters supplied to the operation.
+// - options - DeploymentsClientBeginCreateOrUpdateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtSubscriptionScope
+// method.
+func (client *DeploymentsClient) BeginCreateOrUpdateAtSubscriptionScope(ctx context.Context, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateAtSubscriptionScopeOptions) (*runtime.Poller[DeploymentsClientCreateOrUpdateAtSubscriptionScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdateAtSubscriptionScope(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientCreateOrUpdateAtSubscriptionScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientCreateOrUpdateAtSubscriptionScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdateAtSubscriptionScope - You can provide the template and parameters directly in the request or link to JSON
+// files.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) createOrUpdateAtSubscriptionScope(ctx context.Context, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateAtSubscriptionScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginCreateOrUpdateAtSubscriptionScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateAtSubscriptionScopeCreateRequest(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateAtSubscriptionScopeCreateRequest creates the CreateOrUpdateAtSubscriptionScope request.
+func (client *DeploymentsClient) createOrUpdateAtSubscriptionScopeCreateRequest(ctx context.Context, deploymentName string, parameters Deployment, options *DeploymentsClientBeginCreateOrUpdateAtSubscriptionScopeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginCreateOrUpdateAtTenantScope - You can provide the template and parameters directly in the request or link to JSON
+// files.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - parameters - Additional parameters supplied to the operation.
+// - options - DeploymentsClientBeginCreateOrUpdateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtTenantScope
+// method.
+func (client *DeploymentsClient) BeginCreateOrUpdateAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginCreateOrUpdateAtTenantScopeOptions) (*runtime.Poller[DeploymentsClientCreateOrUpdateAtTenantScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.createOrUpdateAtTenantScope(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientCreateOrUpdateAtTenantScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientCreateOrUpdateAtTenantScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CreateOrUpdateAtTenantScope - You can provide the template and parameters directly in the request or link to JSON files.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) createOrUpdateAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginCreateOrUpdateAtTenantScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginCreateOrUpdateAtTenantScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateAtTenantScopeCreateRequest(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createOrUpdateAtTenantScopeCreateRequest creates the CreateOrUpdateAtTenantScope request.
+func (client *DeploymentsClient) createOrUpdateAtTenantScopeCreateRequest(ctx context.Context, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginCreateOrUpdateAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginDelete - A template deployment that is currently running cannot be deleted. Deleting a template deployment removes
+// the associated deployment operations. Deleting a template deployment does not affect the state
+// of the resource group. This is an asynchronous operation that returns a status of 202 until the template deployment is
+// successfully deleted. The Location response header contains the URI that is used
+// to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status
+// of 202. When the process finishes, the URI in the Location header returns a
+// status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status
+// code.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group with the deployment to delete. The name is case insensitive.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientBeginDeleteOptions contains the optional parameters for the DeploymentsClient.BeginDelete method.
+func (client *DeploymentsClient) BeginDelete(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*runtime.Poller[DeploymentsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, deploymentName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
+// associated deployment operations. Deleting a template deployment does not affect the state
+// of the resource group. This is an asynchronous operation that returns a status of 202 until the template deployment is
+// successfully deleted. The Location response header contains the URI that is used
+// to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status
+// of 202. When the process finishes, the URI in the Location header returns a
+// status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status
+// code.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, deploymentName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *DeploymentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginDeleteAtManagementGroupScope - A template deployment that is currently running cannot be deleted. Deleting a template
+// deployment removes the associated deployment operations. This is an asynchronous operation that returns a status
+// of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used
+// to obtain the status of the process. While the process is running, a call to
+// the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns
+// a status of 204 on success. If the asynchronous request failed, the URI in the
+// Location header returns an error-level status code.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - groupID - The management group ID.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientBeginDeleteAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtManagementGroupScope
+// method.
+func (client *DeploymentsClient) BeginDeleteAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientBeginDeleteAtManagementGroupScopeOptions) (*runtime.Poller[DeploymentsClientDeleteAtManagementGroupScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteAtManagementGroupScope(ctx, groupID, deploymentName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientDeleteAtManagementGroupScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientDeleteAtManagementGroupScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// DeleteAtManagementGroupScope - A template deployment that is currently running cannot be deleted. Deleting a template deployment
+// removes the associated deployment operations. This is an asynchronous operation that returns a status
+// of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used
+// to obtain the status of the process. While the process is running, a call to
+// the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns
+// a status of 204 on success. If the asynchronous request failed, the URI in the
+// Location header returns an error-level status code.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) deleteAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientBeginDeleteAtManagementGroupScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginDeleteAtManagementGroupScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteAtManagementGroupScopeCreateRequest creates the DeleteAtManagementGroupScope request.
+func (client *DeploymentsClient) deleteAtManagementGroupScopeCreateRequest(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientBeginDeleteAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginDeleteAtScope - A template deployment that is currently running cannot be deleted. Deleting a template deployment
+// removes the associated deployment operations. This is an asynchronous operation that returns a status
+// of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used
+// to obtain the status of the process. While the process is running, a call to
+// the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns
+// a status of 204 on success. If the asynchronous request failed, the URI in the
+// Location header returns an error-level status code.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientBeginDeleteAtScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtScope
+// method.
+func (client *DeploymentsClient) BeginDeleteAtScope(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientBeginDeleteAtScopeOptions) (*runtime.Poller[DeploymentsClientDeleteAtScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteAtScope(ctx, scope, deploymentName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientDeleteAtScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientDeleteAtScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// DeleteAtScope - A template deployment that is currently running cannot be deleted. Deleting a template deployment removes
+// the associated deployment operations. This is an asynchronous operation that returns a status
+// of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used
+// to obtain the status of the process. While the process is running, a call to
+// the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns
+// a status of 204 on success. If the asynchronous request failed, the URI in the
+// Location header returns an error-level status code.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) deleteAtScope(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientBeginDeleteAtScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginDeleteAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteAtScopeCreateRequest(ctx, scope, deploymentName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteAtScopeCreateRequest creates the DeleteAtScope request.
+func (client *DeploymentsClient) deleteAtScopeCreateRequest(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientBeginDeleteAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginDeleteAtSubscriptionScope - A template deployment that is currently running cannot be deleted. Deleting a template
+// deployment removes the associated deployment operations. This is an asynchronous operation that returns a status
+// of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used
+// to obtain the status of the process. While the process is running, a call to
+// the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns
+// a status of 204 on success. If the asynchronous request failed, the URI in the
+// Location header returns an error-level status code.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientBeginDeleteAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtSubscriptionScope
+// method.
+func (client *DeploymentsClient) BeginDeleteAtSubscriptionScope(ctx context.Context, deploymentName string, options *DeploymentsClientBeginDeleteAtSubscriptionScopeOptions) (*runtime.Poller[DeploymentsClientDeleteAtSubscriptionScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteAtSubscriptionScope(ctx, deploymentName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientDeleteAtSubscriptionScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientDeleteAtSubscriptionScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// DeleteAtSubscriptionScope - A template deployment that is currently running cannot be deleted. Deleting a template deployment
+// removes the associated deployment operations. This is an asynchronous operation that returns a status
+// of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used
+// to obtain the status of the process. While the process is running, a call to
+// the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns
+// a status of 204 on success. If the asynchronous request failed, the URI in the
+// Location header returns an error-level status code.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) deleteAtSubscriptionScope(ctx context.Context, deploymentName string, options *DeploymentsClientBeginDeleteAtSubscriptionScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginDeleteAtSubscriptionScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteAtSubscriptionScopeCreateRequest(ctx, deploymentName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteAtSubscriptionScopeCreateRequest creates the DeleteAtSubscriptionScope request.
+func (client *DeploymentsClient) deleteAtSubscriptionScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentsClientBeginDeleteAtSubscriptionScopeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginDeleteAtTenantScope - A template deployment that is currently running cannot be deleted. Deleting a template deployment
+// removes the associated deployment operations. This is an asynchronous operation that returns a status
+// of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used
+// to obtain the status of the process. While the process is running, a call to
+// the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns
+// a status of 204 on success. If the asynchronous request failed, the URI in the
+// Location header returns an error-level status code.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientBeginDeleteAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtTenantScope
+// method.
+func (client *DeploymentsClient) BeginDeleteAtTenantScope(ctx context.Context, deploymentName string, options *DeploymentsClientBeginDeleteAtTenantScopeOptions) (*runtime.Poller[DeploymentsClientDeleteAtTenantScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteAtTenantScope(ctx, deploymentName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientDeleteAtTenantScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientDeleteAtTenantScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// DeleteAtTenantScope - A template deployment that is currently running cannot be deleted. Deleting a template deployment
+// removes the associated deployment operations. This is an asynchronous operation that returns a status
+// of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used
+// to obtain the status of the process. While the process is running, a call to
+// the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns
+// a status of 204 on success. If the asynchronous request failed, the URI in the
+// Location header returns an error-level status code.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) deleteAtTenantScope(ctx context.Context, deploymentName string, options *DeploymentsClientBeginDeleteAtTenantScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginDeleteAtTenantScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteAtTenantScopeCreateRequest(ctx, deploymentName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteAtTenantScopeCreateRequest creates the DeleteAtTenantScope request.
+func (client *DeploymentsClient) deleteAtTenantScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentsClientBeginDeleteAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// ExportTemplate - Exports the template used for specified deployment.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientExportTemplateOptions contains the optional parameters for the DeploymentsClient.ExportTemplate
+// method.
+func (client *DeploymentsClient) ExportTemplate(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientExportTemplateOptions) (DeploymentsClientExportTemplateResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.ExportTemplate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.exportTemplateCreateRequest(ctx, resourceGroupName, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientExportTemplateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientExportTemplateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientExportTemplateResponse{}, err
+ }
+ resp, err := client.exportTemplateHandleResponse(httpResp)
+ return resp, err
+}
+
+// exportTemplateCreateRequest creates the ExportTemplate request.
+func (client *DeploymentsClient) exportTemplateCreateRequest(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientExportTemplateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// exportTemplateHandleResponse handles the ExportTemplate response.
+func (client *DeploymentsClient) exportTemplateHandleResponse(resp *http.Response) (DeploymentsClientExportTemplateResponse, error) {
+ result := DeploymentsClientExportTemplateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentExportResult); err != nil {
+ return DeploymentsClientExportTemplateResponse{}, err
+ }
+ return result, nil
+}
+
+// ExportTemplateAtManagementGroupScope - Exports the template used for specified deployment.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - groupID - The management group ID.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientExportTemplateAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtManagementGroupScope
+// method.
+func (client *DeploymentsClient) ExportTemplateAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientExportTemplateAtManagementGroupScopeOptions) (DeploymentsClientExportTemplateAtManagementGroupScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.ExportTemplateAtManagementGroupScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.exportTemplateAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientExportTemplateAtManagementGroupScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientExportTemplateAtManagementGroupScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientExportTemplateAtManagementGroupScopeResponse{}, err
+ }
+ resp, err := client.exportTemplateAtManagementGroupScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// exportTemplateAtManagementGroupScopeCreateRequest creates the ExportTemplateAtManagementGroupScope request.
+func (client *DeploymentsClient) exportTemplateAtManagementGroupScopeCreateRequest(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientExportTemplateAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate"
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// exportTemplateAtManagementGroupScopeHandleResponse handles the ExportTemplateAtManagementGroupScope response.
+func (client *DeploymentsClient) exportTemplateAtManagementGroupScopeHandleResponse(resp *http.Response) (DeploymentsClientExportTemplateAtManagementGroupScopeResponse, error) {
+ result := DeploymentsClientExportTemplateAtManagementGroupScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentExportResult); err != nil {
+ return DeploymentsClientExportTemplateAtManagementGroupScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// ExportTemplateAtScope - Exports the template used for specified deployment.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientExportTemplateAtScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtScope
+// method.
+func (client *DeploymentsClient) ExportTemplateAtScope(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientExportTemplateAtScopeOptions) (DeploymentsClientExportTemplateAtScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.ExportTemplateAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.exportTemplateAtScopeCreateRequest(ctx, scope, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientExportTemplateAtScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientExportTemplateAtScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientExportTemplateAtScopeResponse{}, err
+ }
+ resp, err := client.exportTemplateAtScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// exportTemplateAtScopeCreateRequest creates the ExportTemplateAtScope request.
+func (client *DeploymentsClient) exportTemplateAtScopeCreateRequest(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientExportTemplateAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// exportTemplateAtScopeHandleResponse handles the ExportTemplateAtScope response.
+func (client *DeploymentsClient) exportTemplateAtScopeHandleResponse(resp *http.Response) (DeploymentsClientExportTemplateAtScopeResponse, error) {
+ result := DeploymentsClientExportTemplateAtScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentExportResult); err != nil {
+ return DeploymentsClientExportTemplateAtScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// ExportTemplateAtSubscriptionScope - Exports the template used for specified deployment.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientExportTemplateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtSubscriptionScope
+// method.
+func (client *DeploymentsClient) ExportTemplateAtSubscriptionScope(ctx context.Context, deploymentName string, options *DeploymentsClientExportTemplateAtSubscriptionScopeOptions) (DeploymentsClientExportTemplateAtSubscriptionScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.ExportTemplateAtSubscriptionScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.exportTemplateAtSubscriptionScopeCreateRequest(ctx, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientExportTemplateAtSubscriptionScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientExportTemplateAtSubscriptionScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientExportTemplateAtSubscriptionScopeResponse{}, err
+ }
+ resp, err := client.exportTemplateAtSubscriptionScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// exportTemplateAtSubscriptionScopeCreateRequest creates the ExportTemplateAtSubscriptionScope request.
+func (client *DeploymentsClient) exportTemplateAtSubscriptionScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentsClientExportTemplateAtSubscriptionScopeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// exportTemplateAtSubscriptionScopeHandleResponse handles the ExportTemplateAtSubscriptionScope response.
+func (client *DeploymentsClient) exportTemplateAtSubscriptionScopeHandleResponse(resp *http.Response) (DeploymentsClientExportTemplateAtSubscriptionScopeResponse, error) {
+ result := DeploymentsClientExportTemplateAtSubscriptionScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentExportResult); err != nil {
+ return DeploymentsClientExportTemplateAtSubscriptionScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// ExportTemplateAtTenantScope - Exports the template used for specified deployment.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientExportTemplateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtTenantScope
+// method.
+func (client *DeploymentsClient) ExportTemplateAtTenantScope(ctx context.Context, deploymentName string, options *DeploymentsClientExportTemplateAtTenantScopeOptions) (DeploymentsClientExportTemplateAtTenantScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.ExportTemplateAtTenantScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.exportTemplateAtTenantScopeCreateRequest(ctx, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientExportTemplateAtTenantScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientExportTemplateAtTenantScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientExportTemplateAtTenantScopeResponse{}, err
+ }
+ resp, err := client.exportTemplateAtTenantScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// exportTemplateAtTenantScopeCreateRequest creates the ExportTemplateAtTenantScope request.
+func (client *DeploymentsClient) exportTemplateAtTenantScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentsClientExportTemplateAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// exportTemplateAtTenantScopeHandleResponse handles the ExportTemplateAtTenantScope response.
+func (client *DeploymentsClient) exportTemplateAtTenantScopeHandleResponse(resp *http.Response) (DeploymentsClientExportTemplateAtTenantScopeResponse, error) {
+ result := DeploymentsClientExportTemplateAtTenantScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentExportResult); err != nil {
+ return DeploymentsClientExportTemplateAtTenantScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// Get - Gets a deployment.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method.
+func (client *DeploymentsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientGetOptions) (DeploymentsClientGetResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *DeploymentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, deploymentName string, options *DeploymentsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *DeploymentsClient) getHandleResponse(resp *http.Response) (DeploymentsClientGetResponse, error) {
+ result := DeploymentsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentExtended); err != nil {
+ return DeploymentsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetAtManagementGroupScope - Gets a deployment.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - groupID - The management group ID.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientGetAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.GetAtManagementGroupScope
+// method.
+func (client *DeploymentsClient) GetAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientGetAtManagementGroupScopeOptions) (DeploymentsClientGetAtManagementGroupScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.GetAtManagementGroupScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientGetAtManagementGroupScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientGetAtManagementGroupScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientGetAtManagementGroupScopeResponse{}, err
+ }
+ resp, err := client.getAtManagementGroupScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// getAtManagementGroupScopeCreateRequest creates the GetAtManagementGroupScope request.
+func (client *DeploymentsClient) getAtManagementGroupScopeCreateRequest(ctx context.Context, groupID string, deploymentName string, options *DeploymentsClientGetAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getAtManagementGroupScopeHandleResponse handles the GetAtManagementGroupScope response.
+func (client *DeploymentsClient) getAtManagementGroupScopeHandleResponse(resp *http.Response) (DeploymentsClientGetAtManagementGroupScopeResponse, error) {
+ result := DeploymentsClientGetAtManagementGroupScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentExtended); err != nil {
+ return DeploymentsClientGetAtManagementGroupScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// GetAtScope - Gets a deployment.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientGetAtScopeOptions contains the optional parameters for the DeploymentsClient.GetAtScope method.
+func (client *DeploymentsClient) GetAtScope(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientGetAtScopeOptions) (DeploymentsClientGetAtScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.GetAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getAtScopeCreateRequest(ctx, scope, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientGetAtScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientGetAtScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientGetAtScopeResponse{}, err
+ }
+ resp, err := client.getAtScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// getAtScopeCreateRequest creates the GetAtScope request.
+func (client *DeploymentsClient) getAtScopeCreateRequest(ctx context.Context, scope string, deploymentName string, options *DeploymentsClientGetAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getAtScopeHandleResponse handles the GetAtScope response.
+func (client *DeploymentsClient) getAtScopeHandleResponse(resp *http.Response) (DeploymentsClientGetAtScopeResponse, error) {
+ result := DeploymentsClientGetAtScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentExtended); err != nil {
+ return DeploymentsClientGetAtScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// GetAtSubscriptionScope - Gets a deployment.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientGetAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.GetAtSubscriptionScope
+// method.
+func (client *DeploymentsClient) GetAtSubscriptionScope(ctx context.Context, deploymentName string, options *DeploymentsClientGetAtSubscriptionScopeOptions) (DeploymentsClientGetAtSubscriptionScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.GetAtSubscriptionScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getAtSubscriptionScopeCreateRequest(ctx, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientGetAtSubscriptionScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientGetAtSubscriptionScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientGetAtSubscriptionScopeResponse{}, err
+ }
+ resp, err := client.getAtSubscriptionScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// getAtSubscriptionScopeCreateRequest creates the GetAtSubscriptionScope request.
+func (client *DeploymentsClient) getAtSubscriptionScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentsClientGetAtSubscriptionScopeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getAtSubscriptionScopeHandleResponse handles the GetAtSubscriptionScope response.
+func (client *DeploymentsClient) getAtSubscriptionScopeHandleResponse(resp *http.Response) (DeploymentsClientGetAtSubscriptionScopeResponse, error) {
+ result := DeploymentsClientGetAtSubscriptionScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentExtended); err != nil {
+ return DeploymentsClientGetAtSubscriptionScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// GetAtTenantScope - Gets a deployment.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - options - DeploymentsClientGetAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.GetAtTenantScope
+// method.
+func (client *DeploymentsClient) GetAtTenantScope(ctx context.Context, deploymentName string, options *DeploymentsClientGetAtTenantScopeOptions) (DeploymentsClientGetAtTenantScopeResponse, error) {
+ var err error
+ const operationName = "DeploymentsClient.GetAtTenantScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getAtTenantScopeCreateRequest(ctx, deploymentName, options)
+ if err != nil {
+ return DeploymentsClientGetAtTenantScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeploymentsClientGetAtTenantScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeploymentsClientGetAtTenantScopeResponse{}, err
+ }
+ resp, err := client.getAtTenantScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// getAtTenantScopeCreateRequest creates the GetAtTenantScope request.
+func (client *DeploymentsClient) getAtTenantScopeCreateRequest(ctx context.Context, deploymentName string, options *DeploymentsClientGetAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/deployments/{deploymentName}"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getAtTenantScopeHandleResponse handles the GetAtTenantScope response.
+func (client *DeploymentsClient) getAtTenantScopeHandleResponse(resp *http.Response) (DeploymentsClientGetAtTenantScopeResponse, error) {
+ result := DeploymentsClientGetAtTenantScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentExtended); err != nil {
+ return DeploymentsClientGetAtTenantScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAtManagementGroupScopePager - Get all the deployments for a management group.
+//
+// Generated from API version 2021-04-01
+// - groupID - The management group ID.
+// - options - DeploymentsClientListAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtManagementGroupScopePager
+// method.
+func (client *DeploymentsClient) NewListAtManagementGroupScopePager(groupID string, options *DeploymentsClientListAtManagementGroupScopeOptions) *runtime.Pager[DeploymentsClientListAtManagementGroupScopeResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeploymentsClientListAtManagementGroupScopeResponse]{
+ More: func(page DeploymentsClientListAtManagementGroupScopeResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeploymentsClientListAtManagementGroupScopeResponse) (DeploymentsClientListAtManagementGroupScopeResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeploymentsClient.NewListAtManagementGroupScopePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAtManagementGroupScopeCreateRequest(ctx, groupID, options)
+ }, nil)
+ if err != nil {
+ return DeploymentsClientListAtManagementGroupScopeResponse{}, err
+ }
+ return client.listAtManagementGroupScopeHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAtManagementGroupScopeCreateRequest creates the ListAtManagementGroupScope request.
+func (client *DeploymentsClient) listAtManagementGroupScopeCreateRequest(ctx context.Context, groupID string, options *DeploymentsClientListAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/"
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAtManagementGroupScopeHandleResponse handles the ListAtManagementGroupScope response.
+func (client *DeploymentsClient) listAtManagementGroupScopeHandleResponse(resp *http.Response) (DeploymentsClientListAtManagementGroupScopeResponse, error) {
+ result := DeploymentsClientListAtManagementGroupScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentListResult); err != nil {
+ return DeploymentsClientListAtManagementGroupScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAtScopePager - Get all the deployments at the given scope.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - options - DeploymentsClientListAtScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtScopePager
+// method.
+func (client *DeploymentsClient) NewListAtScopePager(scope string, options *DeploymentsClientListAtScopeOptions) *runtime.Pager[DeploymentsClientListAtScopeResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeploymentsClientListAtScopeResponse]{
+ More: func(page DeploymentsClientListAtScopeResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeploymentsClientListAtScopeResponse) (DeploymentsClientListAtScopeResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeploymentsClient.NewListAtScopePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAtScopeCreateRequest(ctx, scope, options)
+ }, nil)
+ if err != nil {
+ return DeploymentsClientListAtScopeResponse{}, err
+ }
+ return client.listAtScopeHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAtScopeCreateRequest creates the ListAtScope request.
+func (client *DeploymentsClient) listAtScopeCreateRequest(ctx context.Context, scope string, options *DeploymentsClientListAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/deployments/"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAtScopeHandleResponse handles the ListAtScope response.
+func (client *DeploymentsClient) listAtScopeHandleResponse(resp *http.Response) (DeploymentsClientListAtScopeResponse, error) {
+ result := DeploymentsClientListAtScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentListResult); err != nil {
+ return DeploymentsClientListAtScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAtSubscriptionScopePager - Get all the deployments for a subscription.
+//
+// Generated from API version 2021-04-01
+// - options - DeploymentsClientListAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtSubscriptionScopePager
+// method.
+func (client *DeploymentsClient) NewListAtSubscriptionScopePager(options *DeploymentsClientListAtSubscriptionScopeOptions) *runtime.Pager[DeploymentsClientListAtSubscriptionScopeResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeploymentsClientListAtSubscriptionScopeResponse]{
+ More: func(page DeploymentsClientListAtSubscriptionScopeResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeploymentsClientListAtSubscriptionScopeResponse) (DeploymentsClientListAtSubscriptionScopeResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeploymentsClient.NewListAtSubscriptionScopePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAtSubscriptionScopeCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return DeploymentsClientListAtSubscriptionScopeResponse{}, err
+ }
+ return client.listAtSubscriptionScopeHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAtSubscriptionScopeCreateRequest creates the ListAtSubscriptionScope request.
+func (client *DeploymentsClient) listAtSubscriptionScopeCreateRequest(ctx context.Context, options *DeploymentsClientListAtSubscriptionScopeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAtSubscriptionScopeHandleResponse handles the ListAtSubscriptionScope response.
+func (client *DeploymentsClient) listAtSubscriptionScopeHandleResponse(resp *http.Response) (DeploymentsClientListAtSubscriptionScopeResponse, error) {
+ result := DeploymentsClientListAtSubscriptionScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentListResult); err != nil {
+ return DeploymentsClientListAtSubscriptionScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAtTenantScopePager - Get all the deployments at the tenant scope.
+//
+// Generated from API version 2021-04-01
+// - options - DeploymentsClientListAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtTenantScopePager
+// method.
+func (client *DeploymentsClient) NewListAtTenantScopePager(options *DeploymentsClientListAtTenantScopeOptions) *runtime.Pager[DeploymentsClientListAtTenantScopeResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeploymentsClientListAtTenantScopeResponse]{
+ More: func(page DeploymentsClientListAtTenantScopeResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeploymentsClientListAtTenantScopeResponse) (DeploymentsClientListAtTenantScopeResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeploymentsClient.NewListAtTenantScopePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAtTenantScopeCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return DeploymentsClientListAtTenantScopeResponse{}, err
+ }
+ return client.listAtTenantScopeHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAtTenantScopeCreateRequest creates the ListAtTenantScope request.
+func (client *DeploymentsClient) listAtTenantScopeCreateRequest(ctx context.Context, options *DeploymentsClientListAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/deployments/"
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAtTenantScopeHandleResponse handles the ListAtTenantScope response.
+func (client *DeploymentsClient) listAtTenantScopeHandleResponse(resp *http.Response) (DeploymentsClientListAtTenantScopeResponse, error) {
+ result := DeploymentsClientListAtTenantScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentListResult); err != nil {
+ return DeploymentsClientListAtTenantScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Get all the deployments for a resource group.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group with the deployments to get. The name is case insensitive.
+// - options - DeploymentsClientListByResourceGroupOptions contains the optional parameters for the DeploymentsClient.NewListByResourceGroupPager
+// method.
+func (client *DeploymentsClient) NewListByResourceGroupPager(resourceGroupName string, options *DeploymentsClientListByResourceGroupOptions) *runtime.Pager[DeploymentsClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeploymentsClientListByResourceGroupResponse]{
+ More: func(page DeploymentsClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeploymentsClientListByResourceGroupResponse) (DeploymentsClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeploymentsClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return DeploymentsClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *DeploymentsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DeploymentsClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *DeploymentsClient) listByResourceGroupHandleResponse(resp *http.Response) (DeploymentsClientListByResourceGroupResponse, error) {
+ result := DeploymentsClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentListResult); err != nil {
+ return DeploymentsClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginValidate - Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
+// Manager..
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group the template will be deployed to. The name is case insensitive.
+// - deploymentName - The name of the deployment.
+// - parameters - Parameters to validate.
+// - options - DeploymentsClientBeginValidateOptions contains the optional parameters for the DeploymentsClient.BeginValidate
+// method.
+func (client *DeploymentsClient) BeginValidate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateOptions) (*runtime.Poller[DeploymentsClientValidateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.validate(ctx, resourceGroupName, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientValidateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientValidateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Validate - Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) validate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginValidate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.validateCreateRequest(ctx, resourceGroupName, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusBadRequest) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// validateCreateRequest creates the Validate request.
+func (client *DeploymentsClient) validateCreateRequest(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginValidateAtManagementGroupScope - Validates whether the specified template is syntactically correct and will be accepted
+// by Azure Resource Manager..
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - groupID - The management group ID.
+// - deploymentName - The name of the deployment.
+// - parameters - Parameters to validate.
+// - options - DeploymentsClientBeginValidateAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtManagementGroupScope
+// method.
+func (client *DeploymentsClient) BeginValidateAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginValidateAtManagementGroupScopeOptions) (*runtime.Poller[DeploymentsClientValidateAtManagementGroupScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.validateAtManagementGroupScope(ctx, groupID, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientValidateAtManagementGroupScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientValidateAtManagementGroupScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ValidateAtManagementGroupScope - Validates whether the specified template is syntactically correct and will be accepted
+// by Azure Resource Manager..
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) validateAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginValidateAtManagementGroupScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginValidateAtManagementGroupScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.validateAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusBadRequest) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// validateAtManagementGroupScopeCreateRequest creates the ValidateAtManagementGroupScope request.
+func (client *DeploymentsClient) validateAtManagementGroupScopeCreateRequest(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginValidateAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate"
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginValidateAtScope - Validates whether the specified template is syntactically correct and will be accepted by Azure
+// Resource Manager..
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - deploymentName - The name of the deployment.
+// - parameters - Parameters to validate.
+// - options - DeploymentsClientBeginValidateAtScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtScope
+// method.
+func (client *DeploymentsClient) BeginValidateAtScope(ctx context.Context, scope string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateAtScopeOptions) (*runtime.Poller[DeploymentsClientValidateAtScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.validateAtScope(ctx, scope, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientValidateAtScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientValidateAtScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ValidateAtScope - Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
+// Manager..
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) validateAtScope(ctx context.Context, scope string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateAtScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginValidateAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.validateAtScopeCreateRequest(ctx, scope, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusBadRequest) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// validateAtScopeCreateRequest creates the ValidateAtScope request.
+func (client *DeploymentsClient) validateAtScopeCreateRequest(ctx context.Context, scope string, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginValidateAtSubscriptionScope - Validates whether the specified template is syntactically correct and will be accepted
+// by Azure Resource Manager..
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - parameters - Parameters to validate.
+// - options - DeploymentsClientBeginValidateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtSubscriptionScope
+// method.
+func (client *DeploymentsClient) BeginValidateAtSubscriptionScope(ctx context.Context, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateAtSubscriptionScopeOptions) (*runtime.Poller[DeploymentsClientValidateAtSubscriptionScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.validateAtSubscriptionScope(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientValidateAtSubscriptionScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientValidateAtSubscriptionScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ValidateAtSubscriptionScope - Validates whether the specified template is syntactically correct and will be accepted by
+// Azure Resource Manager..
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) validateAtSubscriptionScope(ctx context.Context, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateAtSubscriptionScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginValidateAtSubscriptionScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.validateAtSubscriptionScopeCreateRequest(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusBadRequest) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// validateAtSubscriptionScopeCreateRequest creates the ValidateAtSubscriptionScope request.
+func (client *DeploymentsClient) validateAtSubscriptionScopeCreateRequest(ctx context.Context, deploymentName string, parameters Deployment, options *DeploymentsClientBeginValidateAtSubscriptionScopeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginValidateAtTenantScope - Validates whether the specified template is syntactically correct and will be accepted by
+// Azure Resource Manager..
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - parameters - Parameters to validate.
+// - options - DeploymentsClientBeginValidateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtTenantScope
+// method.
+func (client *DeploymentsClient) BeginValidateAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginValidateAtTenantScopeOptions) (*runtime.Poller[DeploymentsClientValidateAtTenantScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.validateAtTenantScope(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientValidateAtTenantScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientValidateAtTenantScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ValidateAtTenantScope - Validates whether the specified template is syntactically correct and will be accepted by Azure
+// Resource Manager..
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) validateAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginValidateAtTenantScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginValidateAtTenantScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.validateAtTenantScopeCreateRequest(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusBadRequest) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// validateAtTenantScopeCreateRequest creates the ValidateAtTenantScope request.
+func (client *DeploymentsClient) validateAtTenantScopeCreateRequest(ctx context.Context, deploymentName string, parameters ScopedDeployment, options *DeploymentsClientBeginValidateAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/deployments/{deploymentName}/validate"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginWhatIf - Returns changes that will be made by the deployment if executed at the scope of the resource group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group the template will be deployed to. The name is case insensitive.
+// - deploymentName - The name of the deployment.
+// - parameters - Parameters to validate.
+// - options - DeploymentsClientBeginWhatIfOptions contains the optional parameters for the DeploymentsClient.BeginWhatIf method.
+func (client *DeploymentsClient) BeginWhatIf(ctx context.Context, resourceGroupName string, deploymentName string, parameters DeploymentWhatIf, options *DeploymentsClientBeginWhatIfOptions) (*runtime.Poller[DeploymentsClientWhatIfResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.whatIf(ctx, resourceGroupName, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientWhatIfResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientWhatIfResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// WhatIf - Returns changes that will be made by the deployment if executed at the scope of the resource group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) whatIf(ctx context.Context, resourceGroupName string, deploymentName string, parameters DeploymentWhatIf, options *DeploymentsClientBeginWhatIfOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginWhatIf"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.whatIfCreateRequest(ctx, resourceGroupName, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// whatIfCreateRequest creates the WhatIf request.
+func (client *DeploymentsClient) whatIfCreateRequest(ctx context.Context, resourceGroupName string, deploymentName string, parameters DeploymentWhatIf, options *DeploymentsClientBeginWhatIfOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginWhatIfAtManagementGroupScope - Returns changes that will be made by the deployment if executed at the scope of the
+// management group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - groupID - The management group ID.
+// - deploymentName - The name of the deployment.
+// - parameters - Parameters to validate.
+// - options - DeploymentsClientBeginWhatIfAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.BeginWhatIfAtManagementGroupScope
+// method.
+func (client *DeploymentsClient) BeginWhatIfAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtManagementGroupScopeOptions) (*runtime.Poller[DeploymentsClientWhatIfAtManagementGroupScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.whatIfAtManagementGroupScope(ctx, groupID, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientWhatIfAtManagementGroupScopeResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientWhatIfAtManagementGroupScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// WhatIfAtManagementGroupScope - Returns changes that will be made by the deployment if executed at the scope of the management
+// group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) whatIfAtManagementGroupScope(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtManagementGroupScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginWhatIfAtManagementGroupScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.whatIfAtManagementGroupScopeCreateRequest(ctx, groupID, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// whatIfAtManagementGroupScopeCreateRequest creates the WhatIfAtManagementGroupScope request.
+func (client *DeploymentsClient) whatIfAtManagementGroupScopeCreateRequest(ctx context.Context, groupID string, deploymentName string, parameters ScopedDeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf"
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginWhatIfAtSubscriptionScope - Returns changes that will be made by the deployment if executed at the scope of the subscription.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - parameters - Parameters to What If.
+// - options - DeploymentsClientBeginWhatIfAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginWhatIfAtSubscriptionScope
+// method.
+func (client *DeploymentsClient) BeginWhatIfAtSubscriptionScope(ctx context.Context, deploymentName string, parameters DeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtSubscriptionScopeOptions) (*runtime.Poller[DeploymentsClientWhatIfAtSubscriptionScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.whatIfAtSubscriptionScope(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientWhatIfAtSubscriptionScopeResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientWhatIfAtSubscriptionScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// WhatIfAtSubscriptionScope - Returns changes that will be made by the deployment if executed at the scope of the subscription.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) whatIfAtSubscriptionScope(ctx context.Context, deploymentName string, parameters DeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtSubscriptionScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginWhatIfAtSubscriptionScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.whatIfAtSubscriptionScopeCreateRequest(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// whatIfAtSubscriptionScopeCreateRequest creates the WhatIfAtSubscriptionScope request.
+func (client *DeploymentsClient) whatIfAtSubscriptionScopeCreateRequest(ctx context.Context, deploymentName string, parameters DeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtSubscriptionScopeOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginWhatIfAtTenantScope - Returns changes that will be made by the deployment if executed at the scope of the tenant group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - deploymentName - The name of the deployment.
+// - parameters - Parameters to validate.
+// - options - DeploymentsClientBeginWhatIfAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginWhatIfAtTenantScope
+// method.
+func (client *DeploymentsClient) BeginWhatIfAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtTenantScopeOptions) (*runtime.Poller[DeploymentsClientWhatIfAtTenantScopeResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.whatIfAtTenantScope(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientWhatIfAtTenantScopeResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DeploymentsClientWhatIfAtTenantScopeResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// WhatIfAtTenantScope - Returns changes that will be made by the deployment if executed at the scope of the tenant group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *DeploymentsClient) whatIfAtTenantScope(ctx context.Context, deploymentName string, parameters ScopedDeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtTenantScopeOptions) (*http.Response, error) {
+ var err error
+ const operationName = "DeploymentsClient.BeginWhatIfAtTenantScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.whatIfAtTenantScopeCreateRequest(ctx, deploymentName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// whatIfAtTenantScopeCreateRequest creates the WhatIfAtTenantScope request.
+func (client *DeploymentsClient) whatIfAtTenantScopeCreateRequest(ctx context.Context, deploymentName string, parameters ScopedDeploymentWhatIf, options *DeploymentsClientBeginWhatIfAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf"
+ if deploymentName == "" {
+ return nil, errors.New("parameter deploymentName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/models.go
new file mode 100644
index 000000000..ce98f859a
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/models.go
@@ -0,0 +1,1173 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import "time"
+
+type APIProfile struct {
+ // READ-ONLY; The API version.
+ APIVersion *string
+
+ // READ-ONLY; The profile version.
+ ProfileVersion *string
+}
+
+// Alias - The alias type.
+type Alias struct {
+ // The default path for an alias.
+ DefaultPath *string
+
+ // The default pattern for an alias.
+ DefaultPattern *AliasPattern
+
+ // The alias name.
+ Name *string
+
+ // The paths for an alias.
+ Paths []*AliasPath
+
+ // The type of the alias.
+ Type *AliasType
+
+ // READ-ONLY; The default alias path metadata. Applies to the default path and to any alias path that doesn't have metadata
+ DefaultMetadata *AliasPathMetadata
+}
+
+// AliasPath - The type of the paths for alias.
+type AliasPath struct {
+ // The API versions.
+ APIVersions []*string
+
+ // The path of an alias.
+ Path *string
+
+ // The pattern for an alias path.
+ Pattern *AliasPattern
+
+ // READ-ONLY; The metadata of the alias path. If missing, fall back to the default metadata of the alias.
+ Metadata *AliasPathMetadata
+}
+
+type AliasPathMetadata struct {
+ // READ-ONLY; The attributes of the token that the alias path is referring to.
+ Attributes *AliasPathAttributes
+
+ // READ-ONLY; The type of the token that the alias path is referring to.
+ Type *AliasPathTokenType
+}
+
+// AliasPattern - The type of the pattern for an alias path.
+type AliasPattern struct {
+ // The alias pattern phrase.
+ Phrase *string
+
+ // The type of alias pattern
+ Type *AliasPatternType
+
+ // The alias pattern variable.
+ Variable *string
+}
+
+// BasicDependency - Deployment dependency information.
+type BasicDependency struct {
+ // The ID of the dependency.
+ ID *string
+
+ // The dependency resource name.
+ ResourceName *string
+
+ // The dependency resource type.
+ ResourceType *string
+}
+
+// DebugSetting - The debug setting.
+type DebugSetting struct {
+ // Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent,
+ // or both requestContent and responseContent separated by a comma. The default is
+ // none. When setting this value, carefully consider the type of information you are passing in during deployment. By logging
+ // information about the request or response, you could potentially expose
+ // sensitive data that is retrieved through the deployment operations.
+ DetailLevel *string
+}
+
+// Dependency - Deployment dependency information.
+type Dependency struct {
+ // The list of dependencies.
+ DependsOn []*BasicDependency
+
+ // The ID of the dependency.
+ ID *string
+
+ // The dependency resource name.
+ ResourceName *string
+
+ // The dependency resource type.
+ ResourceType *string
+}
+
+// Deployment operation parameters.
+type Deployment struct {
+ // REQUIRED; The deployment properties.
+ Properties *DeploymentProperties
+
+ // The location to store the deployment data.
+ Location *string
+
+ // Deployment tags
+ Tags map[string]*string
+}
+
+// DeploymentExportResult - The deployment export result.
+type DeploymentExportResult struct {
+ // The template content.
+ Template any
+}
+
+// DeploymentExtended - Deployment information.
+type DeploymentExtended struct {
+ // the location of the deployment.
+ Location *string
+
+ // Deployment properties.
+ Properties *DeploymentPropertiesExtended
+
+ // Deployment tags
+ Tags map[string]*string
+
+ // READ-ONLY; The ID of the deployment.
+ ID *string
+
+ // READ-ONLY; The name of the deployment.
+ Name *string
+
+ // READ-ONLY; The type of the deployment.
+ Type *string
+}
+
+// DeploymentExtendedFilter - Deployment filter.
+type DeploymentExtendedFilter struct {
+ // The provisioning state.
+ ProvisioningState *string
+}
+
+// DeploymentListResult - List of deployments.
+type DeploymentListResult struct {
+ // An array of deployments.
+ Value []*DeploymentExtended
+
+ // READ-ONLY; The URL to use for getting the next set of results.
+ NextLink *string
+}
+
+// DeploymentOperation - Deployment operation information.
+type DeploymentOperation struct {
+ // Deployment properties.
+ Properties *DeploymentOperationProperties
+
+ // READ-ONLY; Full deployment operation ID.
+ ID *string
+
+ // READ-ONLY; Deployment operation ID.
+ OperationID *string
+}
+
+// DeploymentOperationProperties - Deployment operation properties.
+type DeploymentOperationProperties struct {
+ // READ-ONLY; The duration of the operation.
+ Duration *string
+
+ // READ-ONLY; The name of the current provisioning operation.
+ ProvisioningOperation *ProvisioningOperation
+
+ // READ-ONLY; The state of the provisioning.
+ ProvisioningState *string
+
+ // READ-ONLY; The HTTP request message.
+ Request *HTTPMessage
+
+ // READ-ONLY; The HTTP response message.
+ Response *HTTPMessage
+
+ // READ-ONLY; Deployment operation service request id.
+ ServiceRequestID *string
+
+ // READ-ONLY; Operation status code from the resource provider. This property may not be set if a response has not yet been
+ // received.
+ StatusCode *string
+
+ // READ-ONLY; Operation status message from the resource provider. This property is optional. It will only be provided if
+ // an error was received from the resource provider.
+ StatusMessage *StatusMessage
+
+ // READ-ONLY; The target resource.
+ TargetResource *TargetResource
+
+ // READ-ONLY; The date and time of the operation.
+ Timestamp *time.Time
+}
+
+// DeploymentOperationsListResult - List of deployment operations.
+type DeploymentOperationsListResult struct {
+ // An array of deployment operations.
+ Value []*DeploymentOperation
+
+ // READ-ONLY; The URL to use for getting the next set of results.
+ NextLink *string
+}
+
+// DeploymentProperties - Deployment properties.
+type DeploymentProperties struct {
+ // REQUIRED; The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode,
+ // resources are deployed without deleting existing resources that are not included in
+ // the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included
+ // in the template are deleted. Be careful when using Complete mode as you may
+ // unintentionally delete resources.
+ Mode *DeploymentMode
+
+ // The debug setting of the deployment.
+ DebugSetting *DebugSetting
+
+ // Specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable
+ // to nested templates. If not specified, default value is outer.
+ ExpressionEvaluationOptions *ExpressionEvaluationOptions
+
+ // The deployment on error behavior.
+ OnErrorDeployment *OnErrorDeployment
+
+ // Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide
+ // the parameter values directly in the request rather than link to an existing
+ // parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or
+ // a well formed JSON string.
+ Parameters any
+
+ // The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink
+ // property or the parameters property, but not both.
+ ParametersLink *ParametersLink
+
+ // The template content. You use this element when you want to pass the template syntax directly in the request rather than
+ // link to an existing template. It can be a JObject or well-formed JSON string.
+ // Use either the templateLink property or the template property, but not both.
+ Template any
+
+ // The URI of the template. Use either the templateLink property or the template property, but not both.
+ TemplateLink *TemplateLink
+}
+
+// DeploymentPropertiesExtended - Deployment properties with additional details.
+type DeploymentPropertiesExtended struct {
+ // READ-ONLY; The correlation ID of the deployment.
+ CorrelationID *string
+
+ // READ-ONLY; The debug setting of the deployment.
+ DebugSetting *DebugSetting
+
+ // READ-ONLY; The list of deployment dependencies.
+ Dependencies []*Dependency
+
+ // READ-ONLY; The duration of the template deployment.
+ Duration *string
+
+ // READ-ONLY; The deployment error.
+ Error *ErrorResponse
+
+ // READ-ONLY; The deployment mode. Possible values are Incremental and Complete.
+ Mode *DeploymentMode
+
+ // READ-ONLY; The deployment on error behavior.
+ OnErrorDeployment *OnErrorDeploymentExtended
+
+ // READ-ONLY; Array of provisioned resources.
+ OutputResources []*ResourceReference
+
+ // READ-ONLY; Key/value pairs that represent deployment output.
+ Outputs any
+
+ // READ-ONLY; Deployment parameters.
+ Parameters any
+
+ // READ-ONLY; The URI referencing the parameters.
+ ParametersLink *ParametersLink
+
+ // READ-ONLY; The list of resource providers needed for the deployment.
+ Providers []*Provider
+
+ // READ-ONLY; Denotes the state of provisioning.
+ ProvisioningState *ProvisioningState
+
+ // READ-ONLY; The hash produced for the template.
+ TemplateHash *string
+
+ // READ-ONLY; The URI referencing the template.
+ TemplateLink *TemplateLink
+
+ // READ-ONLY; The timestamp of the template deployment.
+ Timestamp *time.Time
+
+ // READ-ONLY; Array of validated resources.
+ ValidatedResources []*ResourceReference
+}
+
+// DeploymentValidateResult - Information from validate template deployment response.
+type DeploymentValidateResult struct {
+ // The template deployment properties.
+ Properties *DeploymentPropertiesExtended
+
+ // READ-ONLY; The deployment validation error.
+ Error *ErrorResponse
+}
+
+// DeploymentWhatIf - Deployment What-if operation parameters.
+type DeploymentWhatIf struct {
+ // REQUIRED; The deployment properties.
+ Properties *DeploymentWhatIfProperties
+
+ // The location to store the deployment data.
+ Location *string
+}
+
+// DeploymentWhatIfProperties - Deployment What-if properties.
+type DeploymentWhatIfProperties struct {
+ // REQUIRED; The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode,
+ // resources are deployed without deleting existing resources that are not included in
+ // the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included
+ // in the template are deleted. Be careful when using Complete mode as you may
+ // unintentionally delete resources.
+ Mode *DeploymentMode
+
+ // The debug setting of the deployment.
+ DebugSetting *DebugSetting
+
+ // Specifies whether template expressions are evaluated within the scope of the parent template or nested template. Only applicable
+ // to nested templates. If not specified, default value is outer.
+ ExpressionEvaluationOptions *ExpressionEvaluationOptions
+
+ // The deployment on error behavior.
+ OnErrorDeployment *OnErrorDeployment
+
+ // Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide
+ // the parameter values directly in the request rather than link to an existing
+ // parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or
+ // a well formed JSON string.
+ Parameters any
+
+ // The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink
+ // property or the parameters property, but not both.
+ ParametersLink *ParametersLink
+
+ // The template content. You use this element when you want to pass the template syntax directly in the request rather than
+ // link to an existing template. It can be a JObject or well-formed JSON string.
+ // Use either the templateLink property or the template property, but not both.
+ Template any
+
+ // The URI of the template. Use either the templateLink property or the template property, but not both.
+ TemplateLink *TemplateLink
+
+ // Optional What-If operation settings.
+ WhatIfSettings *DeploymentWhatIfSettings
+}
+
+// DeploymentWhatIfSettings - Deployment What-If operation settings.
+type DeploymentWhatIfSettings struct {
+ // The format of the What-If results
+ ResultFormat *WhatIfResultFormat
+}
+
+// ErrorAdditionalInfo - The resource management error additional info.
+type ErrorAdditionalInfo struct {
+ // READ-ONLY; The additional info.
+ Info any
+
+ // READ-ONLY; The additional info type.
+ Type *string
+}
+
+// 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 ErrorResponse struct {
+ // READ-ONLY; The error additional info.
+ AdditionalInfo []*ErrorAdditionalInfo
+
+ // READ-ONLY; The error code.
+ Code *string
+
+ // READ-ONLY; The error details.
+ Details []*ErrorResponse
+
+ // READ-ONLY; The error message.
+ Message *string
+
+ // READ-ONLY; The error target.
+ Target *string
+}
+
+// ExportTemplateRequest - Export resource group template request parameters.
+type ExportTemplateRequest struct {
+ // The export template options. A CSV-formatted list containing zero or more of the following: 'IncludeParameterDefaultValue',
+ // 'IncludeComments', 'SkipResourceNameParameterization',
+ // 'SkipAllParameterization'
+ Options *string
+
+ // The IDs of the resources to filter the export by. To export all resources, supply an array with single entry '*'.
+ Resources []*string
+}
+
+// ExpressionEvaluationOptions - Specifies whether template expressions are evaluated within the scope of the parent template
+// or nested template.
+type ExpressionEvaluationOptions struct {
+ // The scope to be used for evaluation of parameters, variables and functions in a nested template.
+ Scope *ExpressionEvaluationOptionsScopeType
+}
+
+// ExtendedLocation - Resource extended location.
+type ExtendedLocation struct {
+ // The extended location name.
+ Name *string
+
+ // The extended location type.
+ Type *ExtendedLocationType
+}
+
+// GenericResource - Resource information.
+type GenericResource struct {
+ // Resource extended location.
+ ExtendedLocation *ExtendedLocation
+
+ // The identity of the resource.
+ Identity *Identity
+
+ // The kind of the resource.
+ Kind *string
+
+ // Resource location
+ Location *string
+
+ // ID of the resource that manages this resource.
+ ManagedBy *string
+
+ // The plan of the resource.
+ Plan *Plan
+
+ // The resource properties.
+ Properties any
+
+ // The SKU of the resource.
+ SKU *SKU
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource ID
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GenericResourceExpanded - Resource information.
+type GenericResourceExpanded struct {
+ // Resource extended location.
+ ExtendedLocation *ExtendedLocation
+
+ // The identity of the resource.
+ Identity *Identity
+
+ // The kind of the resource.
+ Kind *string
+
+ // Resource location
+ Location *string
+
+ // ID of the resource that manages this resource.
+ ManagedBy *string
+
+ // The plan of the resource.
+ Plan *Plan
+
+ // The resource properties.
+ Properties any
+
+ // The SKU of the resource.
+ SKU *SKU
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; The changed time of the resource. This is only present if requested via the $expand query parameter.
+ ChangedTime *time.Time
+
+ // READ-ONLY; The created time of the resource. This is only present if requested via the $expand query parameter.
+ CreatedTime *time.Time
+
+ // READ-ONLY; Resource ID
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; The provisioning state of the resource. This is only present if requested via the $expand query parameter.
+ ProvisioningState *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// GenericResourceFilter - Resource filter.
+type GenericResourceFilter struct {
+ // The resource type.
+ ResourceType *string
+
+ // The tag name.
+ Tagname *string
+
+ // The tag value.
+ Tagvalue *string
+}
+
+// HTTPMessage - HTTP message.
+type HTTPMessage struct {
+ // HTTP message content.
+ Content any
+}
+
+// Identity for the resource.
+type Identity struct {
+ // The identity type.
+ Type *ResourceIdentityType
+
+ // The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource
+ // ids in the form:
+ // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
+ UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue
+
+ // READ-ONLY; The principal ID of resource identity.
+ PrincipalID *string
+
+ // READ-ONLY; The tenant ID of resource.
+ TenantID *string
+}
+
+type IdentityUserAssignedIdentitiesValue struct {
+ // READ-ONLY; The client id of user assigned identity.
+ ClientID *string
+
+ // READ-ONLY; The principal id of user assigned identity.
+ PrincipalID *string
+}
+
+// MoveInfo - Parameters of move resources.
+type MoveInfo struct {
+ // The IDs of the resources.
+ Resources []*string
+
+ // The target resource group.
+ TargetResourceGroup *string
+}
+
+// OnErrorDeployment - Deployment on error behavior.
+type OnErrorDeployment struct {
+ // The deployment to be used on error case.
+ DeploymentName *string
+
+ // The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment.
+ Type *OnErrorDeploymentType
+}
+
+// OnErrorDeploymentExtended - Deployment on error behavior with additional details.
+type OnErrorDeploymentExtended struct {
+ // The deployment to be used on error case.
+ DeploymentName *string
+
+ // The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment.
+ Type *OnErrorDeploymentType
+
+ // READ-ONLY; The state of the provisioning for the on error deployment.
+ ProvisioningState *string
+}
+
+// Operation - Microsoft.Resources operation
+type Operation struct {
+ // The object that represents the operation.
+ Display *OperationDisplay
+
+ // Operation name: {provider}/{resource}/{operation}
+ Name *string
+}
+
+// OperationDisplay - The object that represents the operation.
+type OperationDisplay struct {
+ // Description of the operation.
+ Description *string
+
+ // Operation type: Read, write, delete, etc.
+ Operation *string
+
+ // Service provider: Microsoft.Resources
+ Provider *string
+
+ // Resource on which the operation is performed: Profile, endpoint, etc.
+ Resource *string
+}
+
+// OperationListResult - Result of the request to list Microsoft.Resources operations. It contains a list of operations and
+// a URL link to get the next set of results.
+type OperationListResult struct {
+ // URL to get the next set of operation list results if there are any.
+ NextLink *string
+
+ // List of Microsoft.Resources operations.
+ Value []*Operation
+}
+
+// ParametersLink - Entity representing the reference to the deployment parameters.
+type ParametersLink struct {
+ // REQUIRED; The URI of the parameters file.
+ URI *string
+
+ // If included, must match the ContentVersion in the template.
+ ContentVersion *string
+}
+
+// Permission - Role definition permissions.
+type Permission struct {
+ // Allowed actions.
+ Actions []*string
+
+ // Allowed Data actions.
+ DataActions []*string
+
+ // Denied actions.
+ NotActions []*string
+
+ // Denied Data actions.
+ NotDataActions []*string
+}
+
+// Plan for the resource.
+type Plan struct {
+ // The plan ID.
+ Name *string
+
+ // The offer ID.
+ Product *string
+
+ // The promotion code.
+ PromotionCode *string
+
+ // The publisher ID.
+ Publisher *string
+
+ // The plan's version.
+ Version *string
+}
+
+// Provider - Resource provider information.
+type Provider struct {
+ // The namespace of the resource provider.
+ Namespace *string
+
+ // The provider authorization consent state.
+ ProviderAuthorizationConsentState *ProviderAuthorizationConsentState
+
+ // READ-ONLY; The provider ID.
+ ID *string
+
+ // READ-ONLY; The registration policy of the resource provider.
+ RegistrationPolicy *string
+
+ // READ-ONLY; The registration state of the resource provider.
+ RegistrationState *string
+
+ // READ-ONLY; The collection of provider resource types.
+ ResourceTypes []*ProviderResourceType
+}
+
+// ProviderConsentDefinition - The provider consent.
+type ProviderConsentDefinition struct {
+ // A value indicating whether authorization is consented or not.
+ ConsentToAuthorization *bool
+}
+
+// ProviderExtendedLocation - The provider extended location.
+type ProviderExtendedLocation struct {
+ // The extended locations for the azure location.
+ ExtendedLocations []*string
+
+ // The azure location.
+ Location *string
+
+ // The extended location type.
+ Type *string
+}
+
+// ProviderListResult - List of resource providers.
+type ProviderListResult struct {
+ // An array of resource providers.
+ Value []*Provider
+
+ // READ-ONLY; The URL to use for getting the next set of results.
+ NextLink *string
+}
+
+// ProviderPermission - The provider permission
+type ProviderPermission struct {
+ // The application id.
+ ApplicationID *string
+
+ // Role definition properties.
+ ManagedByRoleDefinition *RoleDefinition
+
+ // The provider authorization consent state.
+ ProviderAuthorizationConsentState *ProviderAuthorizationConsentState
+
+ // Role definition properties.
+ RoleDefinition *RoleDefinition
+}
+
+// ProviderPermissionListResult - List of provider permissions.
+type ProviderPermissionListResult struct {
+ // An array of provider permissions.
+ Value []*ProviderPermission
+
+ // READ-ONLY; The URL to use for getting the next set of results.
+ NextLink *string
+}
+
+// ProviderRegistrationRequest - The provider registration definition.
+type ProviderRegistrationRequest struct {
+ // The provider consent.
+ ThirdPartyProviderConsent *ProviderConsentDefinition
+}
+
+// ProviderResourceType - Resource type managed by the resource provider.
+type ProviderResourceType struct {
+ // The API version.
+ APIVersions []*string
+
+ // The aliases that are supported by this resource type.
+ Aliases []*Alias
+
+ // The additional capabilities offered by this resource type.
+ Capabilities *string
+
+ // The location mappings that are supported by this resource type.
+ LocationMappings []*ProviderExtendedLocation
+
+ // The collection of locations where this resource type can be created.
+ Locations []*string
+
+ // The properties.
+ Properties map[string]*string
+
+ // The resource type.
+ ResourceType *string
+ ZoneMappings []*ZoneMapping
+
+ // READ-ONLY; The API profiles for the resource provider.
+ APIProfiles []*APIProfile
+
+ // READ-ONLY; The default API version.
+ DefaultAPIVersion *string
+}
+
+// ProviderResourceTypeListResult - List of resource types of a resource provider.
+type ProviderResourceTypeListResult struct {
+ // An array of resource types.
+ Value []*ProviderResourceType
+
+ // READ-ONLY; The URL to use for getting the next set of results.
+ NextLink *string
+}
+
+// Resource - Specified resource.
+type Resource struct {
+ // Resource extended location.
+ ExtendedLocation *ExtendedLocation
+
+ // Resource location
+ Location *string
+
+ // Resource tags
+ Tags map[string]*string
+
+ // READ-ONLY; Resource ID
+ ID *string
+
+ // READ-ONLY; Resource name
+ Name *string
+
+ // READ-ONLY; Resource type
+ Type *string
+}
+
+// ResourceGroup - Resource group information.
+type ResourceGroup struct {
+ // REQUIRED; The location of the resource group. It cannot be changed after the resource group has been created. It must be
+ // one of the supported Azure locations.
+ Location *string
+
+ // The ID of the resource that manages this resource group.
+ ManagedBy *string
+
+ // The resource group properties.
+ Properties *ResourceGroupProperties
+
+ // The tags attached to the resource group.
+ Tags map[string]*string
+
+ // READ-ONLY; The ID of the resource group.
+ ID *string
+
+ // READ-ONLY; The name of the resource group.
+ Name *string
+
+ // READ-ONLY; The type of the resource group.
+ Type *string
+}
+
+// ResourceGroupExportResult - Resource group export result.
+type ResourceGroupExportResult struct {
+ // The template export error.
+ Error *ErrorResponse
+
+ // The template content.
+ Template any
+}
+
+// ResourceGroupFilter - Resource group filter.
+type ResourceGroupFilter struct {
+ // The tag name.
+ TagName *string
+
+ // The tag value.
+ TagValue *string
+}
+
+// ResourceGroupListResult - List of resource groups.
+type ResourceGroupListResult struct {
+ // An array of resource groups.
+ Value []*ResourceGroup
+
+ // READ-ONLY; The URL to use for getting the next set of results.
+ NextLink *string
+}
+
+// ResourceGroupPatchable - Resource group information.
+type ResourceGroupPatchable struct {
+ // The ID of the resource that manages this resource group.
+ ManagedBy *string
+
+ // The name of the resource group.
+ Name *string
+
+ // The resource group properties.
+ Properties *ResourceGroupProperties
+
+ // The tags attached to the resource group.
+ Tags map[string]*string
+}
+
+// ResourceGroupProperties - The resource group properties.
+type ResourceGroupProperties struct {
+ // READ-ONLY; The provisioning state.
+ ProvisioningState *string
+}
+
+// ResourceListResult - List of resource groups.
+type ResourceListResult struct {
+ // An array of resources.
+ Value []*GenericResourceExpanded
+
+ // READ-ONLY; The URL to use for getting the next set of results.
+ NextLink *string
+}
+
+// ResourceProviderOperationDisplayProperties - Resource provider operation's display properties.
+type ResourceProviderOperationDisplayProperties struct {
+ // Operation description.
+ Description *string
+
+ // Resource provider operation.
+ Operation *string
+
+ // Operation provider.
+ Provider *string
+
+ // Operation description.
+ Publisher *string
+
+ // Operation resource.
+ Resource *string
+}
+
+// ResourceReference - The resource Id model.
+type ResourceReference struct {
+ // READ-ONLY; The fully qualified resource Id.
+ ID *string
+}
+
+// RoleDefinition - Role definition properties.
+type RoleDefinition struct {
+ // The role definition ID.
+ ID *string
+
+ // If this is a service role.
+ IsServiceRole *bool
+
+ // The role definition name.
+ Name *string
+
+ // Role definition permissions.
+ Permissions []*Permission
+
+ // Role definition assignable scopes.
+ Scopes []*string
+}
+
+// SKU for the resource.
+type SKU struct {
+ // The SKU capacity.
+ Capacity *int32
+
+ // The SKU family.
+ Family *string
+
+ // The SKU model.
+ Model *string
+
+ // The SKU name.
+ Name *string
+
+ // The SKU size.
+ Size *string
+
+ // The SKU tier.
+ Tier *string
+}
+
+// ScopedDeployment - Deployment operation parameters.
+type ScopedDeployment struct {
+ // REQUIRED; The location to store the deployment data.
+ Location *string
+
+ // REQUIRED; The deployment properties.
+ Properties *DeploymentProperties
+
+ // Deployment tags
+ Tags map[string]*string
+}
+
+// ScopedDeploymentWhatIf - Deployment What-if operation parameters.
+type ScopedDeploymentWhatIf struct {
+ // REQUIRED; The location to store the deployment data.
+ Location *string
+
+ // REQUIRED; The deployment properties.
+ Properties *DeploymentWhatIfProperties
+}
+
+// StatusMessage - Operation status message object.
+type StatusMessage struct {
+ // The error reported by the operation.
+ Error *ErrorResponse
+
+ // Status of the deployment operation.
+ Status *string
+}
+
+// SubResource - Sub-resource.
+type SubResource struct {
+ // Resource ID
+ ID *string
+}
+
+// TagCount - Tag count.
+type TagCount struct {
+ // Type of count.
+ Type *string
+
+ // Value of count.
+ Value *int32
+}
+
+// TagDetails - Tag details.
+type TagDetails struct {
+ // The total number of resources that use the resource tag. When a tag is initially created and has no associated resources,
+ // the value is 0.
+ Count *TagCount
+
+ // The tag name.
+ TagName *string
+
+ // The list of tag values.
+ Values []*TagValue
+
+ // READ-ONLY; The tag name ID.
+ ID *string
+}
+
+// TagValue - Tag information.
+type TagValue struct {
+ // The tag value count.
+ Count *TagCount
+
+ // The tag value.
+ TagValue *string
+
+ // READ-ONLY; The tag value ID.
+ ID *string
+}
+
+// Tags - A dictionary of name and value pairs.
+type Tags struct {
+ // Dictionary of
+ Tags map[string]*string
+}
+
+// TagsListResult - List of subscription tags.
+type TagsListResult struct {
+ // An array of tags.
+ Value []*TagDetails
+
+ // READ-ONLY; The URL to use for getting the next set of results.
+ NextLink *string
+}
+
+// TagsPatchResource - Wrapper resource for tags patch API request only.
+type TagsPatchResource struct {
+ // The operation type for the patch API.
+ Operation *TagsPatchOperation
+
+ // The set of tags.
+ Properties *Tags
+}
+
+// TagsResource - Wrapper resource for tags API requests and responses.
+type TagsResource struct {
+ // REQUIRED; The set of tags.
+ Properties *Tags
+
+ // READ-ONLY; The ID of the tags wrapper resource.
+ ID *string
+
+ // READ-ONLY; The name of the tags wrapper resource.
+ Name *string
+
+ // READ-ONLY; The type of the tags wrapper resource.
+ Type *string
+}
+
+// TargetResource - Target resource.
+type TargetResource struct {
+ // The ID of the resource.
+ ID *string
+
+ // The name of the resource.
+ ResourceName *string
+
+ // The type of the resource.
+ ResourceType *string
+}
+
+// TemplateHashResult - Result of the request to calculate template hash. It contains a string of minified template and its
+// hash.
+type TemplateHashResult struct {
+ // The minified template string.
+ MinifiedTemplate *string
+
+ // The template hash.
+ TemplateHash *string
+}
+
+// TemplateLink - Entity representing the reference to the template.
+type TemplateLink struct {
+ // If included, must match the ContentVersion in the template.
+ ContentVersion *string
+
+ // The resource id of a Template Spec. Use either the id or uri property, but not both.
+ ID *string
+
+ // The query string (for example, a SAS token) to be used with the templateLink URI.
+ QueryString *string
+
+ // The relativePath property can be used to deploy a linked template at a location relative to the parent. If the parent template
+ // was linked with a TemplateSpec, this will reference an artifact in the
+ // TemplateSpec. If the parent was linked with a URI, the child deployment will be a combination of the parent and relativePath
+ // URIs
+ RelativePath *string
+
+ // The URI of the template to deploy. Use either the uri or id property, but not both.
+ URI *string
+}
+
+// WhatIfChange - Information about a single resource change predicted by What-If operation.
+type WhatIfChange struct {
+ // REQUIRED; Type of change that will be made to the resource when the deployment is executed.
+ ChangeType *ChangeType
+
+ // REQUIRED; Resource ID
+ ResourceID *string
+
+ // The predicted snapshot of the resource after the deployment is executed.
+ After any
+
+ // The snapshot of the resource before the deployment is executed.
+ Before any
+
+ // The predicted changes to resource properties.
+ Delta []*WhatIfPropertyChange
+
+ // The explanation about why the resource is unsupported by What-If.
+ UnsupportedReason *string
+}
+
+// WhatIfOperationProperties - Deployment operation properties.
+type WhatIfOperationProperties struct {
+ // List of resource changes predicted by What-If operation.
+ Changes []*WhatIfChange
+}
+
+// WhatIfOperationResult - Result of the What-If operation. Contains a list of predicted changes and a URL link to get to
+// the next set of results.
+type WhatIfOperationResult struct {
+ // Error when What-If operation fails.
+ Error *ErrorResponse
+
+ // What-If operation properties.
+ Properties *WhatIfOperationProperties
+
+ // Status of the What-If operation.
+ Status *string
+}
+
+// WhatIfPropertyChange - The predicted change to the resource property.
+type WhatIfPropertyChange struct {
+ // REQUIRED; The path of the property.
+ Path *string
+
+ // REQUIRED; The type of property change.
+ PropertyChangeType *PropertyChangeType
+
+ // The value of the property after the deployment is executed.
+ After any
+
+ // The value of the property before the deployment is executed.
+ Before any
+
+ // Nested property changes.
+ Children []*WhatIfPropertyChange
+}
+
+type ZoneMapping struct {
+ // The location of the zone mapping.
+ Location *string
+ Zones []*string
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/models_serde.go
new file mode 100644
index 000000000..5c6e3ac77
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/models_serde.go
@@ -0,0 +1,3108 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+)
+
+// MarshalJSON implements the json.Marshaller interface for type APIProfile.
+func (a APIProfile) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "apiVersion", a.APIVersion)
+ populate(objectMap, "profileVersion", a.ProfileVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type APIProfile.
+func (a *APIProfile) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "apiVersion":
+ err = unpopulate(val, "APIVersion", &a.APIVersion)
+ delete(rawMsg, key)
+ case "profileVersion":
+ err = unpopulate(val, "ProfileVersion", &a.ProfileVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Alias.
+func (a Alias) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "defaultMetadata", a.DefaultMetadata)
+ populate(objectMap, "defaultPath", a.DefaultPath)
+ populate(objectMap, "defaultPattern", a.DefaultPattern)
+ populate(objectMap, "name", a.Name)
+ populate(objectMap, "paths", a.Paths)
+ populate(objectMap, "type", a.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Alias.
+func (a *Alias) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "defaultMetadata":
+ err = unpopulate(val, "DefaultMetadata", &a.DefaultMetadata)
+ delete(rawMsg, key)
+ case "defaultPath":
+ err = unpopulate(val, "DefaultPath", &a.DefaultPath)
+ delete(rawMsg, key)
+ case "defaultPattern":
+ err = unpopulate(val, "DefaultPattern", &a.DefaultPattern)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &a.Name)
+ delete(rawMsg, key)
+ case "paths":
+ err = unpopulate(val, "Paths", &a.Paths)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AliasPath.
+func (a AliasPath) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "apiVersions", a.APIVersions)
+ populate(objectMap, "metadata", a.Metadata)
+ populate(objectMap, "path", a.Path)
+ populate(objectMap, "pattern", a.Pattern)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AliasPath.
+func (a *AliasPath) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "apiVersions":
+ err = unpopulate(val, "APIVersions", &a.APIVersions)
+ delete(rawMsg, key)
+ case "metadata":
+ err = unpopulate(val, "Metadata", &a.Metadata)
+ delete(rawMsg, key)
+ case "path":
+ err = unpopulate(val, "Path", &a.Path)
+ delete(rawMsg, key)
+ case "pattern":
+ err = unpopulate(val, "Pattern", &a.Pattern)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AliasPathMetadata.
+func (a AliasPathMetadata) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "attributes", a.Attributes)
+ populate(objectMap, "type", a.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AliasPathMetadata.
+func (a *AliasPathMetadata) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "attributes":
+ err = unpopulate(val, "Attributes", &a.Attributes)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AliasPattern.
+func (a AliasPattern) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "phrase", a.Phrase)
+ populate(objectMap, "type", a.Type)
+ populate(objectMap, "variable", a.Variable)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AliasPattern.
+func (a *AliasPattern) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "phrase":
+ err = unpopulate(val, "Phrase", &a.Phrase)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ case "variable":
+ err = unpopulate(val, "Variable", &a.Variable)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BasicDependency.
+func (b BasicDependency) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", b.ID)
+ populate(objectMap, "resourceName", b.ResourceName)
+ populate(objectMap, "resourceType", b.ResourceType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BasicDependency.
+func (b *BasicDependency) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &b.ID)
+ delete(rawMsg, key)
+ case "resourceName":
+ err = unpopulate(val, "ResourceName", &b.ResourceName)
+ delete(rawMsg, key)
+ case "resourceType":
+ err = unpopulate(val, "ResourceType", &b.ResourceType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DebugSetting.
+func (d DebugSetting) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "detailLevel", d.DetailLevel)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DebugSetting.
+func (d *DebugSetting) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "detailLevel":
+ err = unpopulate(val, "DetailLevel", &d.DetailLevel)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Dependency.
+func (d Dependency) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "dependsOn", d.DependsOn)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "resourceName", d.ResourceName)
+ populate(objectMap, "resourceType", d.ResourceType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Dependency.
+func (d *Dependency) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "dependsOn":
+ err = unpopulate(val, "DependsOn", &d.DependsOn)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "resourceName":
+ err = unpopulate(val, "ResourceName", &d.ResourceName)
+ delete(rawMsg, key)
+ case "resourceType":
+ err = unpopulate(val, "ResourceType", &d.ResourceType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Deployment.
+func (d Deployment) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "location", d.Location)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "tags", d.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Deployment.
+func (d *Deployment) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "location":
+ err = unpopulate(val, "Location", &d.Location)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentExportResult.
+func (d DeploymentExportResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateAny(objectMap, "template", d.Template)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentExportResult.
+func (d *DeploymentExportResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "template":
+ err = unpopulate(val, "Template", &d.Template)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentExtended.
+func (d DeploymentExtended) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "location", d.Location)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "tags", d.Tags)
+ populate(objectMap, "type", d.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentExtended.
+func (d *DeploymentExtended) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &d.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &d.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &d.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentExtendedFilter.
+func (d DeploymentExtendedFilter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "provisioningState", d.ProvisioningState)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentExtendedFilter.
+func (d *DeploymentExtendedFilter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &d.ProvisioningState)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentListResult.
+func (d DeploymentListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", d.NextLink)
+ populate(objectMap, "value", d.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentListResult.
+func (d *DeploymentListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &d.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &d.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentOperation.
+func (d DeploymentOperation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "operationId", d.OperationID)
+ populate(objectMap, "properties", d.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentOperation.
+func (d *DeploymentOperation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "operationId":
+ err = unpopulate(val, "OperationID", &d.OperationID)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentOperationProperties.
+func (d DeploymentOperationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "duration", d.Duration)
+ populate(objectMap, "provisioningOperation", d.ProvisioningOperation)
+ populate(objectMap, "provisioningState", d.ProvisioningState)
+ populate(objectMap, "request", d.Request)
+ populate(objectMap, "response", d.Response)
+ populate(objectMap, "serviceRequestId", d.ServiceRequestID)
+ populate(objectMap, "statusCode", d.StatusCode)
+ populate(objectMap, "statusMessage", d.StatusMessage)
+ populate(objectMap, "targetResource", d.TargetResource)
+ populateDateTimeRFC3339(objectMap, "timestamp", d.Timestamp)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentOperationProperties.
+func (d *DeploymentOperationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "duration":
+ err = unpopulate(val, "Duration", &d.Duration)
+ delete(rawMsg, key)
+ case "provisioningOperation":
+ err = unpopulate(val, "ProvisioningOperation", &d.ProvisioningOperation)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &d.ProvisioningState)
+ delete(rawMsg, key)
+ case "request":
+ err = unpopulate(val, "Request", &d.Request)
+ delete(rawMsg, key)
+ case "response":
+ err = unpopulate(val, "Response", &d.Response)
+ delete(rawMsg, key)
+ case "serviceRequestId":
+ err = unpopulate(val, "ServiceRequestID", &d.ServiceRequestID)
+ delete(rawMsg, key)
+ case "statusCode":
+ err = unpopulate(val, "StatusCode", &d.StatusCode)
+ delete(rawMsg, key)
+ case "statusMessage":
+ err = unpopulate(val, "StatusMessage", &d.StatusMessage)
+ delete(rawMsg, key)
+ case "targetResource":
+ err = unpopulate(val, "TargetResource", &d.TargetResource)
+ delete(rawMsg, key)
+ case "timestamp":
+ err = unpopulateDateTimeRFC3339(val, "Timestamp", &d.Timestamp)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentOperationsListResult.
+func (d DeploymentOperationsListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", d.NextLink)
+ populate(objectMap, "value", d.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentOperationsListResult.
+func (d *DeploymentOperationsListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &d.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &d.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentProperties.
+func (d DeploymentProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "debugSetting", d.DebugSetting)
+ populate(objectMap, "expressionEvaluationOptions", d.ExpressionEvaluationOptions)
+ populate(objectMap, "mode", d.Mode)
+ populate(objectMap, "onErrorDeployment", d.OnErrorDeployment)
+ populateAny(objectMap, "parameters", d.Parameters)
+ populate(objectMap, "parametersLink", d.ParametersLink)
+ populateAny(objectMap, "template", d.Template)
+ populate(objectMap, "templateLink", d.TemplateLink)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentProperties.
+func (d *DeploymentProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "debugSetting":
+ err = unpopulate(val, "DebugSetting", &d.DebugSetting)
+ delete(rawMsg, key)
+ case "expressionEvaluationOptions":
+ err = unpopulate(val, "ExpressionEvaluationOptions", &d.ExpressionEvaluationOptions)
+ delete(rawMsg, key)
+ case "mode":
+ err = unpopulate(val, "Mode", &d.Mode)
+ delete(rawMsg, key)
+ case "onErrorDeployment":
+ err = unpopulate(val, "OnErrorDeployment", &d.OnErrorDeployment)
+ delete(rawMsg, key)
+ case "parameters":
+ err = unpopulate(val, "Parameters", &d.Parameters)
+ delete(rawMsg, key)
+ case "parametersLink":
+ err = unpopulate(val, "ParametersLink", &d.ParametersLink)
+ delete(rawMsg, key)
+ case "template":
+ err = unpopulate(val, "Template", &d.Template)
+ delete(rawMsg, key)
+ case "templateLink":
+ err = unpopulate(val, "TemplateLink", &d.TemplateLink)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentPropertiesExtended.
+func (d DeploymentPropertiesExtended) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "correlationId", d.CorrelationID)
+ populate(objectMap, "debugSetting", d.DebugSetting)
+ populate(objectMap, "dependencies", d.Dependencies)
+ populate(objectMap, "duration", d.Duration)
+ populate(objectMap, "error", d.Error)
+ populate(objectMap, "mode", d.Mode)
+ populate(objectMap, "onErrorDeployment", d.OnErrorDeployment)
+ populate(objectMap, "outputResources", d.OutputResources)
+ populateAny(objectMap, "outputs", d.Outputs)
+ populateAny(objectMap, "parameters", d.Parameters)
+ populate(objectMap, "parametersLink", d.ParametersLink)
+ populate(objectMap, "providers", d.Providers)
+ populate(objectMap, "provisioningState", d.ProvisioningState)
+ populate(objectMap, "templateHash", d.TemplateHash)
+ populate(objectMap, "templateLink", d.TemplateLink)
+ populateDateTimeRFC3339(objectMap, "timestamp", d.Timestamp)
+ populate(objectMap, "validatedResources", d.ValidatedResources)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentPropertiesExtended.
+func (d *DeploymentPropertiesExtended) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "correlationId":
+ err = unpopulate(val, "CorrelationID", &d.CorrelationID)
+ delete(rawMsg, key)
+ case "debugSetting":
+ err = unpopulate(val, "DebugSetting", &d.DebugSetting)
+ delete(rawMsg, key)
+ case "dependencies":
+ err = unpopulate(val, "Dependencies", &d.Dependencies)
+ delete(rawMsg, key)
+ case "duration":
+ err = unpopulate(val, "Duration", &d.Duration)
+ delete(rawMsg, key)
+ case "error":
+ err = unpopulate(val, "Error", &d.Error)
+ delete(rawMsg, key)
+ case "mode":
+ err = unpopulate(val, "Mode", &d.Mode)
+ delete(rawMsg, key)
+ case "onErrorDeployment":
+ err = unpopulate(val, "OnErrorDeployment", &d.OnErrorDeployment)
+ delete(rawMsg, key)
+ case "outputResources":
+ err = unpopulate(val, "OutputResources", &d.OutputResources)
+ delete(rawMsg, key)
+ case "outputs":
+ err = unpopulate(val, "Outputs", &d.Outputs)
+ delete(rawMsg, key)
+ case "parameters":
+ err = unpopulate(val, "Parameters", &d.Parameters)
+ delete(rawMsg, key)
+ case "parametersLink":
+ err = unpopulate(val, "ParametersLink", &d.ParametersLink)
+ delete(rawMsg, key)
+ case "providers":
+ err = unpopulate(val, "Providers", &d.Providers)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &d.ProvisioningState)
+ delete(rawMsg, key)
+ case "templateHash":
+ err = unpopulate(val, "TemplateHash", &d.TemplateHash)
+ delete(rawMsg, key)
+ case "templateLink":
+ err = unpopulate(val, "TemplateLink", &d.TemplateLink)
+ delete(rawMsg, key)
+ case "timestamp":
+ err = unpopulateDateTimeRFC3339(val, "Timestamp", &d.Timestamp)
+ delete(rawMsg, key)
+ case "validatedResources":
+ err = unpopulate(val, "ValidatedResources", &d.ValidatedResources)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentValidateResult.
+func (d DeploymentValidateResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", d.Error)
+ populate(objectMap, "properties", d.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentValidateResult.
+func (d *DeploymentValidateResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &d.Error)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentWhatIf.
+func (d DeploymentWhatIf) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "location", d.Location)
+ populate(objectMap, "properties", d.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentWhatIf.
+func (d *DeploymentWhatIf) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "location":
+ err = unpopulate(val, "Location", &d.Location)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentWhatIfProperties.
+func (d DeploymentWhatIfProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "debugSetting", d.DebugSetting)
+ populate(objectMap, "expressionEvaluationOptions", d.ExpressionEvaluationOptions)
+ populate(objectMap, "mode", d.Mode)
+ populate(objectMap, "onErrorDeployment", d.OnErrorDeployment)
+ populateAny(objectMap, "parameters", d.Parameters)
+ populate(objectMap, "parametersLink", d.ParametersLink)
+ populateAny(objectMap, "template", d.Template)
+ populate(objectMap, "templateLink", d.TemplateLink)
+ populate(objectMap, "whatIfSettings", d.WhatIfSettings)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentWhatIfProperties.
+func (d *DeploymentWhatIfProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "debugSetting":
+ err = unpopulate(val, "DebugSetting", &d.DebugSetting)
+ delete(rawMsg, key)
+ case "expressionEvaluationOptions":
+ err = unpopulate(val, "ExpressionEvaluationOptions", &d.ExpressionEvaluationOptions)
+ delete(rawMsg, key)
+ case "mode":
+ err = unpopulate(val, "Mode", &d.Mode)
+ delete(rawMsg, key)
+ case "onErrorDeployment":
+ err = unpopulate(val, "OnErrorDeployment", &d.OnErrorDeployment)
+ delete(rawMsg, key)
+ case "parameters":
+ err = unpopulate(val, "Parameters", &d.Parameters)
+ delete(rawMsg, key)
+ case "parametersLink":
+ err = unpopulate(val, "ParametersLink", &d.ParametersLink)
+ delete(rawMsg, key)
+ case "template":
+ err = unpopulate(val, "Template", &d.Template)
+ delete(rawMsg, key)
+ case "templateLink":
+ err = unpopulate(val, "TemplateLink", &d.TemplateLink)
+ delete(rawMsg, key)
+ case "whatIfSettings":
+ err = unpopulate(val, "WhatIfSettings", &d.WhatIfSettings)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeploymentWhatIfSettings.
+func (d DeploymentWhatIfSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "resultFormat", d.ResultFormat)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentWhatIfSettings.
+func (d *DeploymentWhatIfSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "resultFormat":
+ err = unpopulate(val, "ResultFormat", &d.ResultFormat)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.
+func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateAny(objectMap, "info", e.Info)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.
+func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "info":
+ err = unpopulate(val, "Info", &e.Info)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorResponse.
+func (e ErrorResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "additionalInfo", e.AdditionalInfo)
+ populate(objectMap, "code", e.Code)
+ populate(objectMap, "details", e.Details)
+ populate(objectMap, "message", e.Message)
+ populate(objectMap, "target", e.Target)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.
+func (e *ErrorResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "additionalInfo":
+ err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo)
+ delete(rawMsg, key)
+ case "code":
+ err = unpopulate(val, "Code", &e.Code)
+ delete(rawMsg, key)
+ case "details":
+ err = unpopulate(val, "Details", &e.Details)
+ delete(rawMsg, key)
+ case "message":
+ err = unpopulate(val, "Message", &e.Message)
+ delete(rawMsg, key)
+ case "target":
+ err = unpopulate(val, "Target", &e.Target)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ExportTemplateRequest.
+func (e ExportTemplateRequest) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "options", e.Options)
+ populate(objectMap, "resources", e.Resources)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ExportTemplateRequest.
+func (e *ExportTemplateRequest) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "options":
+ err = unpopulate(val, "Options", &e.Options)
+ delete(rawMsg, key)
+ case "resources":
+ err = unpopulate(val, "Resources", &e.Resources)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ExpressionEvaluationOptions.
+func (e ExpressionEvaluationOptions) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "scope", e.Scope)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ExpressionEvaluationOptions.
+func (e *ExpressionEvaluationOptions) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "scope":
+ err = unpopulate(val, "Scope", &e.Scope)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation.
+func (e ExtendedLocation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", e.Name)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation.
+func (e *ExtendedLocation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &e.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GenericResource.
+func (g GenericResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", g.ExtendedLocation)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "identity", g.Identity)
+ populate(objectMap, "kind", g.Kind)
+ populate(objectMap, "location", g.Location)
+ populate(objectMap, "managedBy", g.ManagedBy)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "plan", g.Plan)
+ populateAny(objectMap, "properties", g.Properties)
+ populate(objectMap, "sku", g.SKU)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GenericResource.
+func (g *GenericResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &g.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &g.Identity)
+ delete(rawMsg, key)
+ case "kind":
+ err = unpopulate(val, "Kind", &g.Kind)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &g.Location)
+ delete(rawMsg, key)
+ case "managedBy":
+ err = unpopulate(val, "ManagedBy", &g.ManagedBy)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "plan":
+ err = unpopulate(val, "Plan", &g.Plan)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &g.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GenericResourceExpanded.
+func (g GenericResourceExpanded) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "changedTime", g.ChangedTime)
+ populateDateTimeRFC3339(objectMap, "createdTime", g.CreatedTime)
+ populate(objectMap, "extendedLocation", g.ExtendedLocation)
+ populate(objectMap, "id", g.ID)
+ populate(objectMap, "identity", g.Identity)
+ populate(objectMap, "kind", g.Kind)
+ populate(objectMap, "location", g.Location)
+ populate(objectMap, "managedBy", g.ManagedBy)
+ populate(objectMap, "name", g.Name)
+ populate(objectMap, "plan", g.Plan)
+ populateAny(objectMap, "properties", g.Properties)
+ populate(objectMap, "provisioningState", g.ProvisioningState)
+ populate(objectMap, "sku", g.SKU)
+ populate(objectMap, "tags", g.Tags)
+ populate(objectMap, "type", g.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GenericResourceExpanded.
+func (g *GenericResourceExpanded) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "changedTime":
+ err = unpopulateDateTimeRFC3339(val, "ChangedTime", &g.ChangedTime)
+ delete(rawMsg, key)
+ case "createdTime":
+ err = unpopulateDateTimeRFC3339(val, "CreatedTime", &g.CreatedTime)
+ delete(rawMsg, key)
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &g.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &g.ID)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &g.Identity)
+ delete(rawMsg, key)
+ case "kind":
+ err = unpopulate(val, "Kind", &g.Kind)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &g.Location)
+ delete(rawMsg, key)
+ case "managedBy":
+ err = unpopulate(val, "ManagedBy", &g.ManagedBy)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &g.Name)
+ delete(rawMsg, key)
+ case "plan":
+ err = unpopulate(val, "Plan", &g.Plan)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &g.Properties)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &g.ProvisioningState)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &g.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &g.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &g.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GenericResourceFilter.
+func (g GenericResourceFilter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "resourceType", g.ResourceType)
+ populate(objectMap, "tagname", g.Tagname)
+ populate(objectMap, "tagvalue", g.Tagvalue)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GenericResourceFilter.
+func (g *GenericResourceFilter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "resourceType":
+ err = unpopulate(val, "ResourceType", &g.ResourceType)
+ delete(rawMsg, key)
+ case "tagname":
+ err = unpopulate(val, "Tagname", &g.Tagname)
+ delete(rawMsg, key)
+ case "tagvalue":
+ err = unpopulate(val, "Tagvalue", &g.Tagvalue)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type HTTPMessage.
+func (h HTTPMessage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateAny(objectMap, "content", h.Content)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPMessage.
+func (h *HTTPMessage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", h, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "content":
+ err = unpopulate(val, "Content", &h.Content)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", h, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Identity.
+func (i Identity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "principalId", i.PrincipalID)
+ populate(objectMap, "tenantId", i.TenantID)
+ populate(objectMap, "type", i.Type)
+ populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Identity.
+func (i *Identity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &i.PrincipalID)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &i.TenantID)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &i.Type)
+ delete(rawMsg, key)
+ case "userAssignedIdentities":
+ err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type IdentityUserAssignedIdentitiesValue.
+func (i IdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "clientId", i.ClientID)
+ populate(objectMap, "principalId", i.PrincipalID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityUserAssignedIdentitiesValue.
+func (i *IdentityUserAssignedIdentitiesValue) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "clientId":
+ err = unpopulate(val, "ClientID", &i.ClientID)
+ delete(rawMsg, key)
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &i.PrincipalID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type MoveInfo.
+func (m MoveInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "resources", m.Resources)
+ populate(objectMap, "targetResourceGroup", m.TargetResourceGroup)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type MoveInfo.
+func (m *MoveInfo) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "resources":
+ err = unpopulate(val, "Resources", &m.Resources)
+ delete(rawMsg, key)
+ case "targetResourceGroup":
+ err = unpopulate(val, "TargetResourceGroup", &m.TargetResourceGroup)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OnErrorDeployment.
+func (o OnErrorDeployment) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "deploymentName", o.DeploymentName)
+ populate(objectMap, "type", o.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OnErrorDeployment.
+func (o *OnErrorDeployment) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "deploymentName":
+ err = unpopulate(val, "DeploymentName", &o.DeploymentName)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &o.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OnErrorDeploymentExtended.
+func (o OnErrorDeploymentExtended) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "deploymentName", o.DeploymentName)
+ populate(objectMap, "provisioningState", o.ProvisioningState)
+ populate(objectMap, "type", o.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OnErrorDeploymentExtended.
+func (o *OnErrorDeploymentExtended) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "deploymentName":
+ err = unpopulate(val, "DeploymentName", &o.DeploymentName)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &o.ProvisioningState)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &o.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Operation.
+func (o Operation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "display", o.Display)
+ populate(objectMap, "name", o.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
+func (o *Operation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "display":
+ err = unpopulate(val, "Display", &o.Display)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
+func (o OperationDisplay) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", o.Description)
+ populate(objectMap, "operation", o.Operation)
+ populate(objectMap, "provider", o.Provider)
+ populate(objectMap, "resource", o.Resource)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
+func (o *OperationDisplay) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &o.Description)
+ delete(rawMsg, key)
+ case "operation":
+ err = unpopulate(val, "Operation", &o.Operation)
+ delete(rawMsg, key)
+ case "provider":
+ err = unpopulate(val, "Provider", &o.Provider)
+ delete(rawMsg, key)
+ case "resource":
+ err = unpopulate(val, "Resource", &o.Resource)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationListResult.
+func (o OperationListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", o.NextLink)
+ populate(objectMap, "value", o.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
+func (o *OperationListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &o.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &o.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ParametersLink.
+func (p ParametersLink) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "contentVersion", p.ContentVersion)
+ populate(objectMap, "uri", p.URI)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ParametersLink.
+func (p *ParametersLink) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "contentVersion":
+ err = unpopulate(val, "ContentVersion", &p.ContentVersion)
+ delete(rawMsg, key)
+ case "uri":
+ err = unpopulate(val, "URI", &p.URI)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Permission.
+func (p Permission) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "actions", p.Actions)
+ populate(objectMap, "dataActions", p.DataActions)
+ populate(objectMap, "notActions", p.NotActions)
+ populate(objectMap, "notDataActions", p.NotDataActions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Permission.
+func (p *Permission) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "actions":
+ err = unpopulate(val, "Actions", &p.Actions)
+ delete(rawMsg, key)
+ case "dataActions":
+ err = unpopulate(val, "DataActions", &p.DataActions)
+ delete(rawMsg, key)
+ case "notActions":
+ err = unpopulate(val, "NotActions", &p.NotActions)
+ delete(rawMsg, key)
+ case "notDataActions":
+ err = unpopulate(val, "NotDataActions", &p.NotDataActions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Plan.
+func (p Plan) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "product", p.Product)
+ populate(objectMap, "promotionCode", p.PromotionCode)
+ populate(objectMap, "publisher", p.Publisher)
+ populate(objectMap, "version", p.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Plan.
+func (p *Plan) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "product":
+ err = unpopulate(val, "Product", &p.Product)
+ delete(rawMsg, key)
+ case "promotionCode":
+ err = unpopulate(val, "PromotionCode", &p.PromotionCode)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &p.Publisher)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &p.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Provider.
+func (p Provider) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "namespace", p.Namespace)
+ populate(objectMap, "providerAuthorizationConsentState", p.ProviderAuthorizationConsentState)
+ populate(objectMap, "registrationPolicy", p.RegistrationPolicy)
+ populate(objectMap, "registrationState", p.RegistrationState)
+ populate(objectMap, "resourceTypes", p.ResourceTypes)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Provider.
+func (p *Provider) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "namespace":
+ err = unpopulate(val, "Namespace", &p.Namespace)
+ delete(rawMsg, key)
+ case "providerAuthorizationConsentState":
+ err = unpopulate(val, "ProviderAuthorizationConsentState", &p.ProviderAuthorizationConsentState)
+ delete(rawMsg, key)
+ case "registrationPolicy":
+ err = unpopulate(val, "RegistrationPolicy", &p.RegistrationPolicy)
+ delete(rawMsg, key)
+ case "registrationState":
+ err = unpopulate(val, "RegistrationState", &p.RegistrationState)
+ delete(rawMsg, key)
+ case "resourceTypes":
+ err = unpopulate(val, "ResourceTypes", &p.ResourceTypes)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProviderConsentDefinition.
+func (p ProviderConsentDefinition) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "consentToAuthorization", p.ConsentToAuthorization)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderConsentDefinition.
+func (p *ProviderConsentDefinition) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "consentToAuthorization":
+ err = unpopulate(val, "ConsentToAuthorization", &p.ConsentToAuthorization)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProviderExtendedLocation.
+func (p ProviderExtendedLocation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocations", p.ExtendedLocations)
+ populate(objectMap, "location", p.Location)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderExtendedLocation.
+func (p *ProviderExtendedLocation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocations":
+ err = unpopulate(val, "ExtendedLocations", &p.ExtendedLocations)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &p.Location)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProviderListResult.
+func (p ProviderListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", p.NextLink)
+ populate(objectMap, "value", p.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderListResult.
+func (p *ProviderListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &p.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &p.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProviderPermission.
+func (p ProviderPermission) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "applicationId", p.ApplicationID)
+ populate(objectMap, "managedByRoleDefinition", p.ManagedByRoleDefinition)
+ populate(objectMap, "providerAuthorizationConsentState", p.ProviderAuthorizationConsentState)
+ populate(objectMap, "roleDefinition", p.RoleDefinition)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderPermission.
+func (p *ProviderPermission) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "applicationId":
+ err = unpopulate(val, "ApplicationID", &p.ApplicationID)
+ delete(rawMsg, key)
+ case "managedByRoleDefinition":
+ err = unpopulate(val, "ManagedByRoleDefinition", &p.ManagedByRoleDefinition)
+ delete(rawMsg, key)
+ case "providerAuthorizationConsentState":
+ err = unpopulate(val, "ProviderAuthorizationConsentState", &p.ProviderAuthorizationConsentState)
+ delete(rawMsg, key)
+ case "roleDefinition":
+ err = unpopulate(val, "RoleDefinition", &p.RoleDefinition)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProviderPermissionListResult.
+func (p ProviderPermissionListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", p.NextLink)
+ populate(objectMap, "value", p.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderPermissionListResult.
+func (p *ProviderPermissionListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &p.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &p.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProviderRegistrationRequest.
+func (p ProviderRegistrationRequest) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "thirdPartyProviderConsent", p.ThirdPartyProviderConsent)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderRegistrationRequest.
+func (p *ProviderRegistrationRequest) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "thirdPartyProviderConsent":
+ err = unpopulate(val, "ThirdPartyProviderConsent", &p.ThirdPartyProviderConsent)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProviderResourceType.
+func (p ProviderResourceType) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "apiProfiles", p.APIProfiles)
+ populate(objectMap, "apiVersions", p.APIVersions)
+ populate(objectMap, "aliases", p.Aliases)
+ populate(objectMap, "capabilities", p.Capabilities)
+ populate(objectMap, "defaultApiVersion", p.DefaultAPIVersion)
+ populate(objectMap, "locationMappings", p.LocationMappings)
+ populate(objectMap, "locations", p.Locations)
+ populate(objectMap, "properties", p.Properties)
+ populate(objectMap, "resourceType", p.ResourceType)
+ populate(objectMap, "zoneMappings", p.ZoneMappings)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderResourceType.
+func (p *ProviderResourceType) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "apiProfiles":
+ err = unpopulate(val, "APIProfiles", &p.APIProfiles)
+ delete(rawMsg, key)
+ case "apiVersions":
+ err = unpopulate(val, "APIVersions", &p.APIVersions)
+ delete(rawMsg, key)
+ case "aliases":
+ err = unpopulate(val, "Aliases", &p.Aliases)
+ delete(rawMsg, key)
+ case "capabilities":
+ err = unpopulate(val, "Capabilities", &p.Capabilities)
+ delete(rawMsg, key)
+ case "defaultApiVersion":
+ err = unpopulate(val, "DefaultAPIVersion", &p.DefaultAPIVersion)
+ delete(rawMsg, key)
+ case "locationMappings":
+ err = unpopulate(val, "LocationMappings", &p.LocationMappings)
+ delete(rawMsg, key)
+ case "locations":
+ err = unpopulate(val, "Locations", &p.Locations)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &p.Properties)
+ delete(rawMsg, key)
+ case "resourceType":
+ err = unpopulate(val, "ResourceType", &p.ResourceType)
+ delete(rawMsg, key)
+ case "zoneMappings":
+ err = unpopulate(val, "ZoneMappings", &p.ZoneMappings)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProviderResourceTypeListResult.
+func (p ProviderResourceTypeListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", p.NextLink)
+ populate(objectMap, "value", p.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProviderResourceTypeListResult.
+func (p *ProviderResourceTypeListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &p.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &p.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Resource.
+func (r Resource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", r.ExtendedLocation)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "location", r.Location)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "tags", r.Tags)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
+func (r *Resource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &r.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &r.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &r.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceGroup.
+func (r ResourceGroup) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "location", r.Location)
+ populate(objectMap, "managedBy", r.ManagedBy)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "properties", r.Properties)
+ populate(objectMap, "tags", r.Tags)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGroup.
+func (r *ResourceGroup) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &r.Location)
+ delete(rawMsg, key)
+ case "managedBy":
+ err = unpopulate(val, "ManagedBy", &r.ManagedBy)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &r.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &r.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceGroupExportResult.
+func (r ResourceGroupExportResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", r.Error)
+ populateAny(objectMap, "template", r.Template)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGroupExportResult.
+func (r *ResourceGroupExportResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &r.Error)
+ delete(rawMsg, key)
+ case "template":
+ err = unpopulate(val, "Template", &r.Template)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceGroupFilter.
+func (r ResourceGroupFilter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "tagName", r.TagName)
+ populate(objectMap, "tagValue", r.TagValue)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGroupFilter.
+func (r *ResourceGroupFilter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "tagName":
+ err = unpopulate(val, "TagName", &r.TagName)
+ delete(rawMsg, key)
+ case "tagValue":
+ err = unpopulate(val, "TagValue", &r.TagValue)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceGroupListResult.
+func (r ResourceGroupListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", r.NextLink)
+ populate(objectMap, "value", r.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGroupListResult.
+func (r *ResourceGroupListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &r.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &r.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceGroupPatchable.
+func (r ResourceGroupPatchable) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "managedBy", r.ManagedBy)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "properties", r.Properties)
+ populate(objectMap, "tags", r.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGroupPatchable.
+func (r *ResourceGroupPatchable) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "managedBy":
+ err = unpopulate(val, "ManagedBy", &r.ManagedBy)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &r.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &r.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceGroupProperties.
+func (r ResourceGroupProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "provisioningState", r.ProvisioningState)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGroupProperties.
+func (r *ResourceGroupProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &r.ProvisioningState)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceListResult.
+func (r ResourceListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", r.NextLink)
+ populate(objectMap, "value", r.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceListResult.
+func (r *ResourceListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &r.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &r.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationDisplayProperties.
+func (r ResourceProviderOperationDisplayProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", r.Description)
+ populate(objectMap, "operation", r.Operation)
+ populate(objectMap, "provider", r.Provider)
+ populate(objectMap, "publisher", r.Publisher)
+ populate(objectMap, "resource", r.Resource)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceProviderOperationDisplayProperties.
+func (r *ResourceProviderOperationDisplayProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &r.Description)
+ delete(rawMsg, key)
+ case "operation":
+ err = unpopulate(val, "Operation", &r.Operation)
+ delete(rawMsg, key)
+ case "provider":
+ err = unpopulate(val, "Provider", &r.Provider)
+ delete(rawMsg, key)
+ case "publisher":
+ err = unpopulate(val, "Publisher", &r.Publisher)
+ delete(rawMsg, key)
+ case "resource":
+ err = unpopulate(val, "Resource", &r.Resource)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceReference.
+func (r ResourceReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReference.
+func (r *ResourceReference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RoleDefinition.
+func (r RoleDefinition) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "isServiceRole", r.IsServiceRole)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "permissions", r.Permissions)
+ populate(objectMap, "scopes", r.Scopes)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RoleDefinition.
+func (r *RoleDefinition) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "isServiceRole":
+ err = unpopulate(val, "IsServiceRole", &r.IsServiceRole)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "permissions":
+ err = unpopulate(val, "Permissions", &r.Permissions)
+ delete(rawMsg, key)
+ case "scopes":
+ err = unpopulate(val, "Scopes", &r.Scopes)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SKU.
+func (s SKU) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capacity", s.Capacity)
+ populate(objectMap, "family", s.Family)
+ populate(objectMap, "model", s.Model)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "size", s.Size)
+ populate(objectMap, "tier", s.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SKU.
+func (s *SKU) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capacity":
+ err = unpopulate(val, "Capacity", &s.Capacity)
+ delete(rawMsg, key)
+ case "family":
+ err = unpopulate(val, "Family", &s.Family)
+ delete(rawMsg, key)
+ case "model":
+ err = unpopulate(val, "Model", &s.Model)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "size":
+ err = unpopulate(val, "Size", &s.Size)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &s.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ScopedDeployment.
+func (s ScopedDeployment) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "location", s.Location)
+ populate(objectMap, "properties", s.Properties)
+ populate(objectMap, "tags", s.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ScopedDeployment.
+func (s *ScopedDeployment) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "location":
+ err = unpopulate(val, "Location", &s.Location)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &s.Properties)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &s.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ScopedDeploymentWhatIf.
+func (s ScopedDeploymentWhatIf) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "location", s.Location)
+ populate(objectMap, "properties", s.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ScopedDeploymentWhatIf.
+func (s *ScopedDeploymentWhatIf) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "location":
+ err = unpopulate(val, "Location", &s.Location)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &s.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type StatusMessage.
+func (s StatusMessage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", s.Error)
+ populate(objectMap, "status", s.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type StatusMessage.
+func (s *StatusMessage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &s.Error)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &s.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SubResource.
+func (s SubResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", s.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SubResource.
+func (s *SubResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TagCount.
+func (t TagCount) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "type", t.Type)
+ populate(objectMap, "value", t.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TagCount.
+func (t *TagCount) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "type":
+ err = unpopulate(val, "Type", &t.Type)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &t.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TagDetails.
+func (t TagDetails) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "count", t.Count)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "tagName", t.TagName)
+ populate(objectMap, "values", t.Values)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TagDetails.
+func (t *TagDetails) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "count":
+ err = unpopulate(val, "Count", &t.Count)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "tagName":
+ err = unpopulate(val, "TagName", &t.TagName)
+ delete(rawMsg, key)
+ case "values":
+ err = unpopulate(val, "Values", &t.Values)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TagValue.
+func (t TagValue) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "count", t.Count)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "tagValue", t.TagValue)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TagValue.
+func (t *TagValue) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "count":
+ err = unpopulate(val, "Count", &t.Count)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "tagValue":
+ err = unpopulate(val, "TagValue", &t.TagValue)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Tags.
+func (t Tags) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "tags", t.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Tags.
+func (t *Tags) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "tags":
+ err = unpopulate(val, "Tags", &t.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TagsListResult.
+func (t TagsListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", t.NextLink)
+ populate(objectMap, "value", t.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TagsListResult.
+func (t *TagsListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &t.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &t.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TagsPatchResource.
+func (t TagsPatchResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "operation", t.Operation)
+ populate(objectMap, "properties", t.Properties)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TagsPatchResource.
+func (t *TagsPatchResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "operation":
+ err = unpopulate(val, "Operation", &t.Operation)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &t.Properties)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TagsResource.
+func (t TagsResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "properties", t.Properties)
+ populate(objectMap, "type", t.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TagsResource.
+func (t *TagsResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &t.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &t.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TargetResource.
+func (t TargetResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "resourceName", t.ResourceName)
+ populate(objectMap, "resourceType", t.ResourceType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TargetResource.
+func (t *TargetResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "resourceName":
+ err = unpopulate(val, "ResourceName", &t.ResourceName)
+ delete(rawMsg, key)
+ case "resourceType":
+ err = unpopulate(val, "ResourceType", &t.ResourceType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TemplateHashResult.
+func (t TemplateHashResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "minifiedTemplate", t.MinifiedTemplate)
+ populate(objectMap, "templateHash", t.TemplateHash)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TemplateHashResult.
+func (t *TemplateHashResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "minifiedTemplate":
+ err = unpopulate(val, "MinifiedTemplate", &t.MinifiedTemplate)
+ delete(rawMsg, key)
+ case "templateHash":
+ err = unpopulate(val, "TemplateHash", &t.TemplateHash)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TemplateLink.
+func (t TemplateLink) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "contentVersion", t.ContentVersion)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "queryString", t.QueryString)
+ populate(objectMap, "relativePath", t.RelativePath)
+ populate(objectMap, "uri", t.URI)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TemplateLink.
+func (t *TemplateLink) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "contentVersion":
+ err = unpopulate(val, "ContentVersion", &t.ContentVersion)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "queryString":
+ err = unpopulate(val, "QueryString", &t.QueryString)
+ delete(rawMsg, key)
+ case "relativePath":
+ err = unpopulate(val, "RelativePath", &t.RelativePath)
+ delete(rawMsg, key)
+ case "uri":
+ err = unpopulate(val, "URI", &t.URI)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WhatIfChange.
+func (w WhatIfChange) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateAny(objectMap, "after", w.After)
+ populateAny(objectMap, "before", w.Before)
+ populate(objectMap, "changeType", w.ChangeType)
+ populate(objectMap, "delta", w.Delta)
+ populate(objectMap, "resourceId", w.ResourceID)
+ populate(objectMap, "unsupportedReason", w.UnsupportedReason)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WhatIfChange.
+func (w *WhatIfChange) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "after":
+ err = unpopulate(val, "After", &w.After)
+ delete(rawMsg, key)
+ case "before":
+ err = unpopulate(val, "Before", &w.Before)
+ delete(rawMsg, key)
+ case "changeType":
+ err = unpopulate(val, "ChangeType", &w.ChangeType)
+ delete(rawMsg, key)
+ case "delta":
+ err = unpopulate(val, "Delta", &w.Delta)
+ delete(rawMsg, key)
+ case "resourceId":
+ err = unpopulate(val, "ResourceID", &w.ResourceID)
+ delete(rawMsg, key)
+ case "unsupportedReason":
+ err = unpopulate(val, "UnsupportedReason", &w.UnsupportedReason)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WhatIfOperationProperties.
+func (w WhatIfOperationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "changes", w.Changes)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WhatIfOperationProperties.
+func (w *WhatIfOperationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "changes":
+ err = unpopulate(val, "Changes", &w.Changes)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WhatIfOperationResult.
+func (w WhatIfOperationResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", w.Error)
+ populate(objectMap, "properties", w.Properties)
+ populate(objectMap, "status", w.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WhatIfOperationResult.
+func (w *WhatIfOperationResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &w.Error)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &w.Properties)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &w.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type WhatIfPropertyChange.
+func (w WhatIfPropertyChange) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateAny(objectMap, "after", w.After)
+ populateAny(objectMap, "before", w.Before)
+ populate(objectMap, "children", w.Children)
+ populate(objectMap, "path", w.Path)
+ populate(objectMap, "propertyChangeType", w.PropertyChangeType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type WhatIfPropertyChange.
+func (w *WhatIfPropertyChange) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "after":
+ err = unpopulate(val, "After", &w.After)
+ delete(rawMsg, key)
+ case "before":
+ err = unpopulate(val, "Before", &w.Before)
+ delete(rawMsg, key)
+ case "children":
+ err = unpopulate(val, "Children", &w.Children)
+ delete(rawMsg, key)
+ case "path":
+ err = unpopulate(val, "Path", &w.Path)
+ delete(rawMsg, key)
+ case "propertyChangeType":
+ err = unpopulate(val, "PropertyChangeType", &w.PropertyChangeType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", w, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ZoneMapping.
+func (z ZoneMapping) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "location", z.Location)
+ populate(objectMap, "zones", z.Zones)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ZoneMapping.
+func (z *ZoneMapping) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", z, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "location":
+ err = unpopulate(val, "Location", &z.Location)
+ delete(rawMsg, key)
+ case "zones":
+ err = unpopulate(val, "Zones", &z.Zones)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", z, err)
+ }
+ }
+ return nil
+}
+
+func populate(m map[string]any, k string, v any) {
+ if v == nil {
+ return
+ } else if azcore.IsNullValue(v) {
+ m[k] = nil
+ } else if !reflect.ValueOf(v).IsNil() {
+ m[k] = v
+ }
+}
+
+func populateAny(m map[string]any, k string, v any) {
+ if v == nil {
+ return
+ } else if azcore.IsNullValue(v) {
+ m[k] = nil
+ } else {
+ m[k] = v
+ }
+}
+
+func unpopulate(data json.RawMessage, fn string, v any) error {
+ if data == nil {
+ return nil
+ }
+ if err := json.Unmarshal(data, v); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ return nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/operations_client.go
new file mode 100644
index 000000000..e0fc6b961
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/operations_client.go
@@ -0,0 +1,88 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+)
+
+// OperationsClient contains the methods for the Operations group.
+// Don't use this type directly, use NewOperationsClient() instead.
+type OperationsClient struct {
+ internal *arm.Client
+}
+
+// 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 NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &OperationsClient{
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - Lists all of the available Microsoft.Resources REST API operations.
+//
+// Generated from API version 2021-04-01
+// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{
+ More: func(page OperationsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Resources/operations"
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) {
+ result := OperationsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/options.go
new file mode 100644
index 000000000..dfdb23b0c
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/options.go
@@ -0,0 +1,654 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+// ClientBeginCreateOrUpdateByIDOptions contains the optional parameters for the Client.BeginCreateOrUpdateByID method.
+type ClientBeginCreateOrUpdateByIDOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ClientBeginCreateOrUpdateOptions contains the optional parameters for the Client.BeginCreateOrUpdate method.
+type ClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ClientBeginDeleteByIDOptions contains the optional parameters for the Client.BeginDeleteByID method.
+type ClientBeginDeleteByIDOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method.
+type ClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ClientBeginMoveResourcesOptions contains the optional parameters for the Client.BeginMoveResources method.
+type ClientBeginMoveResourcesOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ClientBeginUpdateByIDOptions contains the optional parameters for the Client.BeginUpdateByID method.
+type ClientBeginUpdateByIDOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ClientBeginUpdateOptions contains the optional parameters for the Client.BeginUpdate method.
+type ClientBeginUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ClientBeginValidateMoveResourcesOptions contains the optional parameters for the Client.BeginValidateMoveResources method.
+type ClientBeginValidateMoveResourcesOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ClientCheckExistenceByIDOptions contains the optional parameters for the Client.CheckExistenceByID method.
+type ClientCheckExistenceByIDOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ClientCheckExistenceOptions contains the optional parameters for the Client.CheckExistence method.
+type ClientCheckExistenceOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ClientGetByIDOptions contains the optional parameters for the Client.GetByID method.
+type ClientGetByIDOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ClientGetOptions contains the optional parameters for the Client.Get method.
+type ClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager method.
+type ClientListByResourceGroupOptions struct {
+ // Comma-separated list of additional properties to be included in the response. Valid values include createdTime, changedTime
+ // and provisioningState. For example, $expand=createdTime,changedTime.
+ Expand *string
+
+ // The filter to apply on the operation.
+ // The properties you can use for eq (equals) or ne (not equals) are: location, resourceType, name, resourceGroup, identity,
+ // identity/principalId, plan, plan/publisher, plan/product, plan/name,
+ // plan/version, and plan/promotionCode.
+ // For example, to filter by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
+ // You can use substringof(value, property) in the filter. The properties you can use for substring are: name and resourceGroup.
+ // For example, to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', name)
+ // You can link more than one substringof together by adding and/or operators.
+ // You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1'
+ // and tagValue eq 'Value1'. When you filter by a tag name and value, the tags for
+ // each resource are not returned in the results.
+ // You can use some properties together when filtering. The combinations you can use are: substringof and/or resourceType,
+ // plan and plan/publisher and plan/name, identity and identity/principalId.
+ Filter *string
+
+ // The number of results to return. If null is passed, returns all resources.
+ Top *int32
+}
+
+// ClientListOptions contains the optional parameters for the Client.NewListPager method.
+type ClientListOptions struct {
+ // Comma-separated list of additional properties to be included in the response. Valid values include createdTime, changedTime
+ // and provisioningState. For example, $expand=createdTime,changedTime.
+ Expand *string
+
+ // The filter to apply on the operation.
+ // Filter comparison operators include eq (equals) and ne (not equals) and may be used with the following properties: location,
+ // resourceType, name, resourceGroup, identity, identity/principalId, plan,
+ // plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.
+ // For example, to filter by a resource type, use $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
+ // substringof(value, property) can be used to filter for substrings of the following currently-supported properties: name
+ // and resourceGroup
+ // For example, to get all resources with 'demo' anywhere in the resource name, use $filter=substringof('demo', name)
+ // Multiple substring operations can also be combined using and/or operators.
+ // Note that any truncated number of results queried via $top may also not be compatible when using a filter.
+ // Resources can be filtered by tag names and values. For example, to filter for a tag name and value, use $filter=tagName
+ // eq 'tag1' and tagValue eq 'Value1'. Note that when resources are filtered by tag
+ // name and value, the original tags for each resource will not be returned in the results. Any list of additional properties
+ // queried via $expand may also not be compatible when filtering by tag
+ // names/values.
+ // For tag names only, resources can be filtered by prefix using the following syntax: $filter=startswith(tagName, 'depart').
+ // This query will return all resources with a tag name prefixed by the phrase
+ // depart (i.e.department, departureDate, departureTime, etc.)
+ // Note that some properties can be combined when filtering resources, which include the following: substringof() and/or resourceType,
+ // plan and plan/publisher and plan/name, and identity and
+ // identity/principalId.
+ Filter *string
+
+ // The number of results to return. If null is passed, returns all resources.
+ Top *int32
+}
+
+// DeploymentOperationsClientGetAtManagementGroupScopeOptions contains the optional parameters for the DeploymentOperationsClient.GetAtManagementGroupScope
+// method.
+type DeploymentOperationsClientGetAtManagementGroupScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentOperationsClientGetAtScopeOptions contains the optional parameters for the DeploymentOperationsClient.GetAtScope
+// method.
+type DeploymentOperationsClientGetAtScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentOperationsClientGetAtSubscriptionScopeOptions contains the optional parameters for the DeploymentOperationsClient.GetAtSubscriptionScope
+// method.
+type DeploymentOperationsClientGetAtSubscriptionScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentOperationsClientGetAtTenantScopeOptions contains the optional parameters for the DeploymentOperationsClient.GetAtTenantScope
+// method.
+type DeploymentOperationsClientGetAtTenantScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentOperationsClientGetOptions contains the optional parameters for the DeploymentOperationsClient.Get method.
+type DeploymentOperationsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentOperationsClientListAtManagementGroupScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtManagementGroupScopePager
+// method.
+type DeploymentOperationsClientListAtManagementGroupScopeOptions struct {
+ // The number of results to return.
+ Top *int32
+}
+
+// DeploymentOperationsClientListAtScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtScopePager
+// method.
+type DeploymentOperationsClientListAtScopeOptions struct {
+ // The number of results to return.
+ Top *int32
+}
+
+// DeploymentOperationsClientListAtSubscriptionScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtSubscriptionScopePager
+// method.
+type DeploymentOperationsClientListAtSubscriptionScopeOptions struct {
+ // The number of results to return.
+ Top *int32
+}
+
+// DeploymentOperationsClientListAtTenantScopeOptions contains the optional parameters for the DeploymentOperationsClient.NewListAtTenantScopePager
+// method.
+type DeploymentOperationsClientListAtTenantScopeOptions struct {
+ // The number of results to return.
+ Top *int32
+}
+
+// DeploymentOperationsClientListOptions contains the optional parameters for the DeploymentOperationsClient.NewListPager
+// method.
+type DeploymentOperationsClientListOptions struct {
+ // The number of results to return.
+ Top *int32
+}
+
+// DeploymentsClientBeginCreateOrUpdateAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtManagementGroupScope
+// method.
+type DeploymentsClientBeginCreateOrUpdateAtManagementGroupScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginCreateOrUpdateAtScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtScope
+// method.
+type DeploymentsClientBeginCreateOrUpdateAtScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginCreateOrUpdateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtSubscriptionScope
+// method.
+type DeploymentsClientBeginCreateOrUpdateAtSubscriptionScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginCreateOrUpdateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdateAtTenantScope
+// method.
+type DeploymentsClientBeginCreateOrUpdateAtTenantScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdate
+// method.
+type DeploymentsClientBeginCreateOrUpdateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginDeleteAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtManagementGroupScope
+// method.
+type DeploymentsClientBeginDeleteAtManagementGroupScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginDeleteAtScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtScope
+// method.
+type DeploymentsClientBeginDeleteAtScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginDeleteAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtSubscriptionScope
+// method.
+type DeploymentsClientBeginDeleteAtSubscriptionScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginDeleteAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginDeleteAtTenantScope
+// method.
+type DeploymentsClientBeginDeleteAtTenantScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginDeleteOptions contains the optional parameters for the DeploymentsClient.BeginDelete method.
+type DeploymentsClientBeginDeleteOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginValidateAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtManagementGroupScope
+// method.
+type DeploymentsClientBeginValidateAtManagementGroupScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginValidateAtScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtScope
+// method.
+type DeploymentsClientBeginValidateAtScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginValidateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtSubscriptionScope
+// method.
+type DeploymentsClientBeginValidateAtSubscriptionScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginValidateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginValidateAtTenantScope
+// method.
+type DeploymentsClientBeginValidateAtTenantScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginValidateOptions contains the optional parameters for the DeploymentsClient.BeginValidate method.
+type DeploymentsClientBeginValidateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginWhatIfAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.BeginWhatIfAtManagementGroupScope
+// method.
+type DeploymentsClientBeginWhatIfAtManagementGroupScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginWhatIfAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.BeginWhatIfAtSubscriptionScope
+// method.
+type DeploymentsClientBeginWhatIfAtSubscriptionScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginWhatIfAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.BeginWhatIfAtTenantScope
+// method.
+type DeploymentsClientBeginWhatIfAtTenantScopeOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientBeginWhatIfOptions contains the optional parameters for the DeploymentsClient.BeginWhatIf method.
+type DeploymentsClientBeginWhatIfOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// DeploymentsClientCalculateTemplateHashOptions contains the optional parameters for the DeploymentsClient.CalculateTemplateHash
+// method.
+type DeploymentsClientCalculateTemplateHashOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientCancelAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtManagementGroupScope
+// method.
+type DeploymentsClientCancelAtManagementGroupScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientCancelAtScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtScope method.
+type DeploymentsClientCancelAtScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientCancelAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtSubscriptionScope
+// method.
+type DeploymentsClientCancelAtSubscriptionScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientCancelAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.CancelAtTenantScope
+// method.
+type DeploymentsClientCancelAtTenantScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientCancelOptions contains the optional parameters for the DeploymentsClient.Cancel method.
+type DeploymentsClientCancelOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientCheckExistenceAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtManagementGroupScope
+// method.
+type DeploymentsClientCheckExistenceAtManagementGroupScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientCheckExistenceAtScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtScope
+// method.
+type DeploymentsClientCheckExistenceAtScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientCheckExistenceAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtSubscriptionScope
+// method.
+type DeploymentsClientCheckExistenceAtSubscriptionScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientCheckExistenceAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.CheckExistenceAtTenantScope
+// method.
+type DeploymentsClientCheckExistenceAtTenantScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientCheckExistenceOptions contains the optional parameters for the DeploymentsClient.CheckExistence method.
+type DeploymentsClientCheckExistenceOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientExportTemplateAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtManagementGroupScope
+// method.
+type DeploymentsClientExportTemplateAtManagementGroupScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientExportTemplateAtScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtScope
+// method.
+type DeploymentsClientExportTemplateAtScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientExportTemplateAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtSubscriptionScope
+// method.
+type DeploymentsClientExportTemplateAtSubscriptionScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientExportTemplateAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.ExportTemplateAtTenantScope
+// method.
+type DeploymentsClientExportTemplateAtTenantScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientExportTemplateOptions contains the optional parameters for the DeploymentsClient.ExportTemplate method.
+type DeploymentsClientExportTemplateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientGetAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.GetAtManagementGroupScope
+// method.
+type DeploymentsClientGetAtManagementGroupScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientGetAtScopeOptions contains the optional parameters for the DeploymentsClient.GetAtScope method.
+type DeploymentsClientGetAtScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientGetAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.GetAtSubscriptionScope
+// method.
+type DeploymentsClientGetAtSubscriptionScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientGetAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.GetAtTenantScope method.
+type DeploymentsClientGetAtTenantScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method.
+type DeploymentsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeploymentsClientListAtManagementGroupScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtManagementGroupScopePager
+// method.
+type DeploymentsClientListAtManagementGroupScopeOptions struct {
+ // The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'.
+ Filter *string
+
+ // The number of results to get. If null is passed, returns all deployments.
+ Top *int32
+}
+
+// DeploymentsClientListAtScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtScopePager method.
+type DeploymentsClientListAtScopeOptions struct {
+ // The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'.
+ Filter *string
+
+ // The number of results to get. If null is passed, returns all deployments.
+ Top *int32
+}
+
+// DeploymentsClientListAtSubscriptionScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtSubscriptionScopePager
+// method.
+type DeploymentsClientListAtSubscriptionScopeOptions struct {
+ // The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'.
+ Filter *string
+
+ // The number of results to get. If null is passed, returns all deployments.
+ Top *int32
+}
+
+// DeploymentsClientListAtTenantScopeOptions contains the optional parameters for the DeploymentsClient.NewListAtTenantScopePager
+// method.
+type DeploymentsClientListAtTenantScopeOptions struct {
+ // The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'.
+ Filter *string
+
+ // The number of results to get. If null is passed, returns all deployments.
+ Top *int32
+}
+
+// DeploymentsClientListByResourceGroupOptions contains the optional parameters for the DeploymentsClient.NewListByResourceGroupPager
+// method.
+type DeploymentsClientListByResourceGroupOptions struct {
+ // The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'.
+ Filter *string
+
+ // The number of results to get. If null is passed, returns all deployments.
+ Top *int32
+}
+
+// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+type OperationsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ProviderResourceTypesClientListOptions contains the optional parameters for the ProviderResourceTypesClient.List method.
+type ProviderResourceTypesClientListOptions struct {
+ // The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases.
+ Expand *string
+}
+
+// ProvidersClientGetAtTenantScopeOptions contains the optional parameters for the ProvidersClient.GetAtTenantScope method.
+type ProvidersClientGetAtTenantScopeOptions struct {
+ // The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases.
+ Expand *string
+}
+
+// ProvidersClientGetOptions contains the optional parameters for the ProvidersClient.Get method.
+type ProvidersClientGetOptions struct {
+ // The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases.
+ Expand *string
+}
+
+// ProvidersClientListAtTenantScopeOptions contains the optional parameters for the ProvidersClient.NewListAtTenantScopePager
+// method.
+type ProvidersClientListAtTenantScopeOptions struct {
+ // The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider
+ // metadata. To include property aliases in response, use
+ // $expand=resourceTypes/aliases.
+ Expand *string
+}
+
+// ProvidersClientListOptions contains the optional parameters for the ProvidersClient.NewListPager method.
+type ProvidersClientListOptions struct {
+ // The properties to include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider
+ // metadata. To include property aliases in response, use
+ // $expand=resourceTypes/aliases.
+ Expand *string
+}
+
+// ProvidersClientProviderPermissionsOptions contains the optional parameters for the ProvidersClient.ProviderPermissions
+// method.
+type ProvidersClientProviderPermissionsOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ProvidersClientRegisterAtManagementGroupScopeOptions contains the optional parameters for the ProvidersClient.RegisterAtManagementGroupScope
+// method.
+type ProvidersClientRegisterAtManagementGroupScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ProvidersClientRegisterOptions contains the optional parameters for the ProvidersClient.Register method.
+type ProvidersClientRegisterOptions struct {
+ // The third party consent for S2S.
+ Properties *ProviderRegistrationRequest
+}
+
+// ProvidersClientUnregisterOptions contains the optional parameters for the ProvidersClient.Unregister method.
+type ProvidersClientUnregisterOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ResourceGroupsClientBeginDeleteOptions contains the optional parameters for the ResourceGroupsClient.BeginDelete method.
+type ResourceGroupsClientBeginDeleteOptions struct {
+ // The resource types you want to force delete. Currently, only the following is supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets
+ ForceDeletionTypes *string
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ResourceGroupsClientBeginExportTemplateOptions contains the optional parameters for the ResourceGroupsClient.BeginExportTemplate
+// method.
+type ResourceGroupsClientBeginExportTemplateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// ResourceGroupsClientCheckExistenceOptions contains the optional parameters for the ResourceGroupsClient.CheckExistence
+// method.
+type ResourceGroupsClientCheckExistenceOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ResourceGroupsClientCreateOrUpdateOptions contains the optional parameters for the ResourceGroupsClient.CreateOrUpdate
+// method.
+type ResourceGroupsClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ResourceGroupsClientGetOptions contains the optional parameters for the ResourceGroupsClient.Get method.
+type ResourceGroupsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ResourceGroupsClientListOptions contains the optional parameters for the ResourceGroupsClient.NewListPager method.
+type ResourceGroupsClientListOptions struct {
+ // The filter to apply on the operation.
+ // You can filter by tag names and values. For example, to filter for a tag name and value, use $filter=tagName eq 'tag1'
+ // and tagValue eq 'Value1'
+ Filter *string
+
+ // The number of results to return. If null is passed, returns all resource groups.
+ Top *int32
+}
+
+// ResourceGroupsClientUpdateOptions contains the optional parameters for the ResourceGroupsClient.Update method.
+type ResourceGroupsClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TagsClientCreateOrUpdateAtScopeOptions contains the optional parameters for the TagsClient.CreateOrUpdateAtScope method.
+type TagsClientCreateOrUpdateAtScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TagsClientCreateOrUpdateOptions contains the optional parameters for the TagsClient.CreateOrUpdate method.
+type TagsClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TagsClientCreateOrUpdateValueOptions contains the optional parameters for the TagsClient.CreateOrUpdateValue method.
+type TagsClientCreateOrUpdateValueOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TagsClientDeleteAtScopeOptions contains the optional parameters for the TagsClient.DeleteAtScope method.
+type TagsClientDeleteAtScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TagsClientDeleteOptions contains the optional parameters for the TagsClient.Delete method.
+type TagsClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TagsClientDeleteValueOptions contains the optional parameters for the TagsClient.DeleteValue method.
+type TagsClientDeleteValueOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TagsClientGetAtScopeOptions contains the optional parameters for the TagsClient.GetAtScope method.
+type TagsClientGetAtScopeOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TagsClientListOptions contains the optional parameters for the TagsClient.NewListPager method.
+type TagsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TagsClientUpdateAtScopeOptions contains the optional parameters for the TagsClient.UpdateAtScope method.
+type TagsClientUpdateAtScopeOptions struct {
+ // placeholder for future optional parameters
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go
new file mode 100644
index 000000000..a64c08f02
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go
@@ -0,0 +1,107 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// ProviderResourceTypesClient contains the methods for the ProviderResourceTypes group.
+// Don't use this type directly, use NewProviderResourceTypesClient() instead.
+type ProviderResourceTypesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewProviderResourceTypesClient creates a new instance of ProviderResourceTypesClient with the specified values.
+// - subscriptionID - The Microsoft Azure subscription ID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewProviderResourceTypesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProviderResourceTypesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &ProviderResourceTypesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// List - List the resource types for a specified resource provider.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceProviderNamespace - The namespace of the resource provider.
+// - options - ProviderResourceTypesClientListOptions contains the optional parameters for the ProviderResourceTypesClient.List
+// method.
+func (client *ProviderResourceTypesClient) List(ctx context.Context, resourceProviderNamespace string, options *ProviderResourceTypesClientListOptions) (ProviderResourceTypesClientListResponse, error) {
+ var err error
+ const operationName = "ProviderResourceTypesClient.List"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listCreateRequest(ctx, resourceProviderNamespace, options)
+ if err != nil {
+ return ProviderResourceTypesClientListResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ProviderResourceTypesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ProviderResourceTypesClientListResponse{}, err
+ }
+ resp, err := client.listHandleResponse(httpResp)
+ return resp, err
+}
+
+// listCreateRequest creates the List request.
+func (client *ProviderResourceTypesClient) listCreateRequest(ctx context.Context, resourceProviderNamespace string, options *ProviderResourceTypesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/resourceTypes"
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *ProviderResourceTypesClient) listHandleResponse(resp *http.Response) (ProviderResourceTypesClientListResponse, error) {
+ result := ProviderResourceTypesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ProviderResourceTypeListResult); err != nil {
+ return ProviderResourceTypesClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/providers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/providers_client.go
new file mode 100644
index 000000000..e1612d160
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/providers_client.go
@@ -0,0 +1,511 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// ProvidersClient contains the methods for the Providers group.
+// Don't use this type directly, use NewProvidersClient() instead.
+type ProvidersClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewProvidersClient creates a new instance of ProvidersClient with the specified values.
+// - subscriptionID - The Microsoft Azure subscription ID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewProvidersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProvidersClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &ProvidersClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Gets the specified resource provider.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceProviderNamespace - The namespace of the resource provider.
+// - options - ProvidersClientGetOptions contains the optional parameters for the ProvidersClient.Get method.
+func (client *ProvidersClient) Get(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientGetOptions) (ProvidersClientGetResponse, error) {
+ var err error
+ const operationName = "ProvidersClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceProviderNamespace, options)
+ if err != nil {
+ return ProvidersClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ProvidersClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ProvidersClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *ProvidersClient) getCreateRequest(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}"
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *ProvidersClient) getHandleResponse(resp *http.Response) (ProvidersClientGetResponse, error) {
+ result := ProvidersClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Provider); err != nil {
+ return ProvidersClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetAtTenantScope - Gets the specified resource provider at the tenant level.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceProviderNamespace - The namespace of the resource provider.
+// - options - ProvidersClientGetAtTenantScopeOptions contains the optional parameters for the ProvidersClient.GetAtTenantScope
+// method.
+func (client *ProvidersClient) GetAtTenantScope(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientGetAtTenantScopeOptions) (ProvidersClientGetAtTenantScopeResponse, error) {
+ var err error
+ const operationName = "ProvidersClient.GetAtTenantScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getAtTenantScopeCreateRequest(ctx, resourceProviderNamespace, options)
+ if err != nil {
+ return ProvidersClientGetAtTenantScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ProvidersClientGetAtTenantScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ProvidersClientGetAtTenantScopeResponse{}, err
+ }
+ resp, err := client.getAtTenantScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// getAtTenantScopeCreateRequest creates the GetAtTenantScope request.
+func (client *ProvidersClient) getAtTenantScopeCreateRequest(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientGetAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/{resourceProviderNamespace}"
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getAtTenantScopeHandleResponse handles the GetAtTenantScope response.
+func (client *ProvidersClient) getAtTenantScopeHandleResponse(resp *http.Response) (ProvidersClientGetAtTenantScopeResponse, error) {
+ result := ProvidersClientGetAtTenantScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Provider); err != nil {
+ return ProvidersClientGetAtTenantScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets all resource providers for a subscription.
+//
+// Generated from API version 2021-04-01
+// - options - ProvidersClientListOptions contains the optional parameters for the ProvidersClient.NewListPager method.
+func (client *ProvidersClient) NewListPager(options *ProvidersClientListOptions) *runtime.Pager[ProvidersClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ProvidersClientListResponse]{
+ More: func(page ProvidersClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *ProvidersClientListResponse) (ProvidersClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ProvidersClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return ProvidersClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *ProvidersClient) listCreateRequest(ctx context.Context, options *ProvidersClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *ProvidersClient) listHandleResponse(resp *http.Response) (ProvidersClientListResponse, error) {
+ result := ProvidersClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ProviderListResult); err != nil {
+ return ProvidersClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListAtTenantScopePager - Gets all resource providers for the tenant.
+//
+// Generated from API version 2021-04-01
+// - options - ProvidersClientListAtTenantScopeOptions contains the optional parameters for the ProvidersClient.NewListAtTenantScopePager
+// method.
+func (client *ProvidersClient) NewListAtTenantScopePager(options *ProvidersClientListAtTenantScopeOptions) *runtime.Pager[ProvidersClientListAtTenantScopeResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ProvidersClientListAtTenantScopeResponse]{
+ More: func(page ProvidersClientListAtTenantScopeResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *ProvidersClientListAtTenantScopeResponse) (ProvidersClientListAtTenantScopeResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ProvidersClient.NewListAtTenantScopePager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listAtTenantScopeCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return ProvidersClientListAtTenantScopeResponse{}, err
+ }
+ return client.listAtTenantScopeHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listAtTenantScopeCreateRequest creates the ListAtTenantScope request.
+func (client *ProvidersClient) listAtTenantScopeCreateRequest(ctx context.Context, options *ProvidersClientListAtTenantScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers"
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listAtTenantScopeHandleResponse handles the ListAtTenantScope response.
+func (client *ProvidersClient) listAtTenantScopeHandleResponse(resp *http.Response) (ProvidersClientListAtTenantScopeResponse, error) {
+ result := ProvidersClientListAtTenantScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ProviderListResult); err != nil {
+ return ProvidersClientListAtTenantScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// ProviderPermissions - Get the provider permissions.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceProviderNamespace - The namespace of the resource provider.
+// - options - ProvidersClientProviderPermissionsOptions contains the optional parameters for the ProvidersClient.ProviderPermissions
+// method.
+func (client *ProvidersClient) ProviderPermissions(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientProviderPermissionsOptions) (ProvidersClientProviderPermissionsResponse, error) {
+ var err error
+ const operationName = "ProvidersClient.ProviderPermissions"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.providerPermissionsCreateRequest(ctx, resourceProviderNamespace, options)
+ if err != nil {
+ return ProvidersClientProviderPermissionsResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ProvidersClientProviderPermissionsResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ProvidersClientProviderPermissionsResponse{}, err
+ }
+ resp, err := client.providerPermissionsHandleResponse(httpResp)
+ return resp, err
+}
+
+// providerPermissionsCreateRequest creates the ProviderPermissions request.
+func (client *ProvidersClient) providerPermissionsCreateRequest(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientProviderPermissionsOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/providerPermissions"
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// providerPermissionsHandleResponse handles the ProviderPermissions response.
+func (client *ProvidersClient) providerPermissionsHandleResponse(resp *http.Response) (ProvidersClientProviderPermissionsResponse, error) {
+ result := ProvidersClientProviderPermissionsResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ProviderPermissionListResult); err != nil {
+ return ProvidersClientProviderPermissionsResponse{}, err
+ }
+ return result, nil
+}
+
+// Register - Registers a subscription with a resource provider.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceProviderNamespace - The namespace of the resource provider to register.
+// - options - ProvidersClientRegisterOptions contains the optional parameters for the ProvidersClient.Register method.
+func (client *ProvidersClient) Register(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientRegisterOptions) (ProvidersClientRegisterResponse, error) {
+ var err error
+ const operationName = "ProvidersClient.Register"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.registerCreateRequest(ctx, resourceProviderNamespace, options)
+ if err != nil {
+ return ProvidersClientRegisterResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ProvidersClientRegisterResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ProvidersClientRegisterResponse{}, err
+ }
+ resp, err := client.registerHandleResponse(httpResp)
+ return resp, err
+}
+
+// registerCreateRequest creates the Register request.
+func (client *ProvidersClient) registerCreateRequest(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientRegisterOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register"
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Properties != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// registerHandleResponse handles the Register response.
+func (client *ProvidersClient) registerHandleResponse(resp *http.Response) (ProvidersClientRegisterResponse, error) {
+ result := ProvidersClientRegisterResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Provider); err != nil {
+ return ProvidersClientRegisterResponse{}, err
+ }
+ return result, nil
+}
+
+// RegisterAtManagementGroupScope - Registers a management group with a resource provider.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceProviderNamespace - The namespace of the resource provider to register.
+// - groupID - The management group ID.
+// - options - ProvidersClientRegisterAtManagementGroupScopeOptions contains the optional parameters for the ProvidersClient.RegisterAtManagementGroupScope
+// method.
+func (client *ProvidersClient) RegisterAtManagementGroupScope(ctx context.Context, resourceProviderNamespace string, groupID string, options *ProvidersClientRegisterAtManagementGroupScopeOptions) (ProvidersClientRegisterAtManagementGroupScopeResponse, error) {
+ var err error
+ const operationName = "ProvidersClient.RegisterAtManagementGroupScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.registerAtManagementGroupScopeCreateRequest(ctx, resourceProviderNamespace, groupID, options)
+ if err != nil {
+ return ProvidersClientRegisterAtManagementGroupScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ProvidersClientRegisterAtManagementGroupScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ProvidersClientRegisterAtManagementGroupScopeResponse{}, err
+ }
+ return ProvidersClientRegisterAtManagementGroupScopeResponse{}, nil
+}
+
+// registerAtManagementGroupScopeCreateRequest creates the RegisterAtManagementGroupScope request.
+func (client *ProvidersClient) registerAtManagementGroupScopeCreateRequest(ctx context.Context, resourceProviderNamespace string, groupID string, options *ProvidersClientRegisterAtManagementGroupScopeOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register"
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ if groupID == "" {
+ return nil, errors.New("parameter groupID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Unregister - Unregisters a subscription from a resource provider.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceProviderNamespace - The namespace of the resource provider to unregister.
+// - options - ProvidersClientUnregisterOptions contains the optional parameters for the ProvidersClient.Unregister method.
+func (client *ProvidersClient) Unregister(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientUnregisterOptions) (ProvidersClientUnregisterResponse, error) {
+ var err error
+ const operationName = "ProvidersClient.Unregister"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.unregisterCreateRequest(ctx, resourceProviderNamespace, options)
+ if err != nil {
+ return ProvidersClientUnregisterResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ProvidersClientUnregisterResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ProvidersClientUnregisterResponse{}, err
+ }
+ resp, err := client.unregisterHandleResponse(httpResp)
+ return resp, err
+}
+
+// unregisterCreateRequest creates the Unregister request.
+func (client *ProvidersClient) unregisterCreateRequest(ctx context.Context, resourceProviderNamespace string, options *ProvidersClientUnregisterOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister"
+ if resourceProviderNamespace == "" {
+ return nil, errors.New("parameter resourceProviderNamespace cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// unregisterHandleResponse handles the Unregister response.
+func (client *ProvidersClient) unregisterHandleResponse(resp *http.Response) (ProvidersClientUnregisterResponse, error) {
+ result := ProvidersClientUnregisterResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Provider); err != nil {
+ return ProvidersClientUnregisterResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/resourcegroups_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/resourcegroups_client.go
new file mode 100644
index 000000000..b228d9f64
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/resourcegroups_client.go
@@ -0,0 +1,495 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// ResourceGroupsClient contains the methods for the ResourceGroups group.
+// Don't use this type directly, use NewResourceGroupsClient() instead.
+type ResourceGroupsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewResourceGroupsClient creates a new instance of ResourceGroupsClient with the specified values.
+// - subscriptionID - The Microsoft Azure subscription ID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewResourceGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceGroupsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &ResourceGroupsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CheckExistence - Checks whether a resource group exists.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group to check. The name is case insensitive.
+// - options - ResourceGroupsClientCheckExistenceOptions contains the optional parameters for the ResourceGroupsClient.CheckExistence
+// method.
+func (client *ResourceGroupsClient) CheckExistence(ctx context.Context, resourceGroupName string, options *ResourceGroupsClientCheckExistenceOptions) (ResourceGroupsClientCheckExistenceResponse, error) {
+ var err error
+ const operationName = "ResourceGroupsClient.CheckExistence"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.checkExistenceCreateRequest(ctx, resourceGroupName, options)
+ if err != nil {
+ return ResourceGroupsClientCheckExistenceResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ResourceGroupsClientCheckExistenceResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent, http.StatusNotFound) {
+ err = runtime.NewResponseError(httpResp)
+ return ResourceGroupsClientCheckExistenceResponse{}, err
+ }
+ return ResourceGroupsClientCheckExistenceResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil
+}
+
+// checkExistenceCreateRequest creates the CheckExistence request.
+func (client *ResourceGroupsClient) checkExistenceCreateRequest(ctx context.Context, resourceGroupName string, options *ResourceGroupsClientCheckExistenceOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CreateOrUpdate - Creates or updates a resource group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group to create or update. Can include alphanumeric, underscore, parentheses,
+// hyphen, period (except at end), and Unicode characters that match the allowed characters.
+// - parameters - Parameters supplied to the create or update a resource group.
+// - options - ResourceGroupsClientCreateOrUpdateOptions contains the optional parameters for the ResourceGroupsClient.CreateOrUpdate
+// method.
+func (client *ResourceGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, parameters ResourceGroup, options *ResourceGroupsClientCreateOrUpdateOptions) (ResourceGroupsClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "ResourceGroupsClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, parameters, options)
+ if err != nil {
+ return ResourceGroupsClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ResourceGroupsClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return ResourceGroupsClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *ResourceGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, parameters ResourceGroup, options *ResourceGroupsClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *ResourceGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (ResourceGroupsClientCreateOrUpdateResponse, error) {
+ result := ResourceGroupsClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ResourceGroup); err != nil {
+ return ResourceGroupsClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginDelete - When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes
+// all of its template deployments and currently stored operations.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group to delete. The name is case insensitive.
+// - options - ResourceGroupsClientBeginDeleteOptions contains the optional parameters for the ResourceGroupsClient.BeginDelete
+// method.
+func (client *ResourceGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, options *ResourceGroupsClientBeginDeleteOptions) (*runtime.Poller[ResourceGroupsClientDeleteResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.deleteOperation(ctx, resourceGroupName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ResourceGroupsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ResourceGroupsClientDeleteResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Delete - When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all
+// of its template deployments and currently stored operations.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *ResourceGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, options *ResourceGroupsClientBeginDeleteOptions) (*http.Response, error) {
+ var err error
+ const operationName = "ResourceGroupsClient.BeginDelete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *ResourceGroupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, options *ResourceGroupsClientBeginDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.ForceDeletionTypes != nil {
+ reqQP.Set("forceDeletionTypes", *options.ForceDeletionTypes)
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// BeginExportTemplate - Captures the specified resource group as a template.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group. The name is case insensitive.
+// - parameters - Parameters for exporting the template.
+// - options - ResourceGroupsClientBeginExportTemplateOptions contains the optional parameters for the ResourceGroupsClient.BeginExportTemplate
+// method.
+func (client *ResourceGroupsClient) BeginExportTemplate(ctx context.Context, resourceGroupName string, parameters ExportTemplateRequest, options *ResourceGroupsClientBeginExportTemplateOptions) (*runtime.Poller[ResourceGroupsClientExportTemplateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.exportTemplate(ctx, resourceGroupName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ResourceGroupsClientExportTemplateResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ResourceGroupsClientExportTemplateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ExportTemplate - Captures the specified resource group as a template.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+func (client *ResourceGroupsClient) exportTemplate(ctx context.Context, resourceGroupName string, parameters ExportTemplateRequest, options *ResourceGroupsClientBeginExportTemplateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "ResourceGroupsClient.BeginExportTemplate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.exportTemplateCreateRequest(ctx, resourceGroupName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// exportTemplateCreateRequest creates the ExportTemplate request.
+func (client *ResourceGroupsClient) exportTemplateCreateRequest(ctx context.Context, resourceGroupName string, parameters ExportTemplateRequest, options *ResourceGroupsClientBeginExportTemplateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// Get - Gets a resource group.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group to get. The name is case insensitive.
+// - options - ResourceGroupsClientGetOptions contains the optional parameters for the ResourceGroupsClient.Get method.
+func (client *ResourceGroupsClient) Get(ctx context.Context, resourceGroupName string, options *ResourceGroupsClientGetOptions) (ResourceGroupsClientGetResponse, error) {
+ var err error
+ const operationName = "ResourceGroupsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, options)
+ if err != nil {
+ return ResourceGroupsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ResourceGroupsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ResourceGroupsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *ResourceGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, options *ResourceGroupsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *ResourceGroupsClient) getHandleResponse(resp *http.Response) (ResourceGroupsClientGetResponse, error) {
+ result := ResourceGroupsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ResourceGroup); err != nil {
+ return ResourceGroupsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets all the resource groups for a subscription.
+//
+// Generated from API version 2021-04-01
+// - options - ResourceGroupsClientListOptions contains the optional parameters for the ResourceGroupsClient.NewListPager method.
+func (client *ResourceGroupsClient) NewListPager(options *ResourceGroupsClientListOptions) *runtime.Pager[ResourceGroupsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ResourceGroupsClientListResponse]{
+ More: func(page ResourceGroupsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *ResourceGroupsClientListResponse) (ResourceGroupsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ResourceGroupsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return ResourceGroupsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *ResourceGroupsClient) listCreateRequest(ctx context.Context, options *ResourceGroupsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Top != nil {
+ reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10))
+ }
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *ResourceGroupsClient) listHandleResponse(resp *http.Response) (ResourceGroupsClientListResponse, error) {
+ result := ResourceGroupsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ResourceGroupListResult); err != nil {
+ return ResourceGroupsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - Resource groups can be updated through a simple PATCH operation to a group address. The format of the request
+// is the same as that for creating a resource group. If a field is unspecified, the current
+// value is retained.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - resourceGroupName - The name of the resource group to update. The name is case insensitive.
+// - parameters - Parameters supplied to update a resource group.
+// - options - ResourceGroupsClientUpdateOptions contains the optional parameters for the ResourceGroupsClient.Update method.
+func (client *ResourceGroupsClient) Update(ctx context.Context, resourceGroupName string, parameters ResourceGroupPatchable, options *ResourceGroupsClientUpdateOptions) (ResourceGroupsClientUpdateResponse, error) {
+ var err error
+ const operationName = "ResourceGroupsClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, parameters, options)
+ if err != nil {
+ return ResourceGroupsClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ResourceGroupsClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ResourceGroupsClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *ResourceGroupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, parameters ResourceGroupPatchable, options *ResourceGroupsClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *ResourceGroupsClient) updateHandleResponse(resp *http.Response) (ResourceGroupsClientUpdateResponse, error) {
+ result := ResourceGroupsClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ResourceGroup); err != nil {
+ return ResourceGroupsClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/response_types.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/response_types.go
new file mode 100644
index 000000000..fb04138cd
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/response_types.go
@@ -0,0 +1,561 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+// ClientCheckExistenceByIDResponse contains the response from method Client.CheckExistenceByID.
+type ClientCheckExistenceByIDResponse struct {
+ // Success indicates if the operation succeeded or failed.
+ Success bool
+}
+
+// ClientCheckExistenceResponse contains the response from method Client.CheckExistence.
+type ClientCheckExistenceResponse struct {
+ // Success indicates if the operation succeeded or failed.
+ Success bool
+}
+
+// ClientCreateOrUpdateByIDResponse contains the response from method Client.BeginCreateOrUpdateByID.
+type ClientCreateOrUpdateByIDResponse struct {
+ // Resource information.
+ GenericResource
+}
+
+// ClientCreateOrUpdateResponse contains the response from method Client.BeginCreateOrUpdate.
+type ClientCreateOrUpdateResponse struct {
+ // Resource information.
+ GenericResource
+}
+
+// ClientDeleteByIDResponse contains the response from method Client.BeginDeleteByID.
+type ClientDeleteByIDResponse struct {
+ // placeholder for future response values
+}
+
+// ClientDeleteResponse contains the response from method Client.BeginDelete.
+type ClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// ClientGetByIDResponse contains the response from method Client.GetByID.
+type ClientGetByIDResponse struct {
+ // Resource information.
+ GenericResource
+}
+
+// ClientGetResponse contains the response from method Client.Get.
+type ClientGetResponse struct {
+ // Resource information.
+ GenericResource
+}
+
+// ClientListByResourceGroupResponse contains the response from method Client.NewListByResourceGroupPager.
+type ClientListByResourceGroupResponse struct {
+ // List of resource groups.
+ ResourceListResult
+}
+
+// ClientListResponse contains the response from method Client.NewListPager.
+type ClientListResponse struct {
+ // List of resource groups.
+ ResourceListResult
+}
+
+// ClientMoveResourcesResponse contains the response from method Client.BeginMoveResources.
+type ClientMoveResourcesResponse struct {
+ // placeholder for future response values
+}
+
+// ClientUpdateByIDResponse contains the response from method Client.BeginUpdateByID.
+type ClientUpdateByIDResponse struct {
+ // Resource information.
+ GenericResource
+}
+
+// ClientUpdateResponse contains the response from method Client.BeginUpdate.
+type ClientUpdateResponse struct {
+ // Resource information.
+ GenericResource
+}
+
+// ClientValidateMoveResourcesResponse contains the response from method Client.BeginValidateMoveResources.
+type ClientValidateMoveResourcesResponse struct {
+ // placeholder for future response values
+}
+
+// DeploymentOperationsClientGetAtManagementGroupScopeResponse contains the response from method DeploymentOperationsClient.GetAtManagementGroupScope.
+type DeploymentOperationsClientGetAtManagementGroupScopeResponse struct {
+ // Deployment operation information.
+ DeploymentOperation
+}
+
+// DeploymentOperationsClientGetAtScopeResponse contains the response from method DeploymentOperationsClient.GetAtScope.
+type DeploymentOperationsClientGetAtScopeResponse struct {
+ // Deployment operation information.
+ DeploymentOperation
+}
+
+// DeploymentOperationsClientGetAtSubscriptionScopeResponse contains the response from method DeploymentOperationsClient.GetAtSubscriptionScope.
+type DeploymentOperationsClientGetAtSubscriptionScopeResponse struct {
+ // Deployment operation information.
+ DeploymentOperation
+}
+
+// DeploymentOperationsClientGetAtTenantScopeResponse contains the response from method DeploymentOperationsClient.GetAtTenantScope.
+type DeploymentOperationsClientGetAtTenantScopeResponse struct {
+ // Deployment operation information.
+ DeploymentOperation
+}
+
+// DeploymentOperationsClientGetResponse contains the response from method DeploymentOperationsClient.Get.
+type DeploymentOperationsClientGetResponse struct {
+ // Deployment operation information.
+ DeploymentOperation
+}
+
+// DeploymentOperationsClientListAtManagementGroupScopeResponse contains the response from method DeploymentOperationsClient.NewListAtManagementGroupScopePager.
+type DeploymentOperationsClientListAtManagementGroupScopeResponse struct {
+ // List of deployment operations.
+ DeploymentOperationsListResult
+}
+
+// DeploymentOperationsClientListAtScopeResponse contains the response from method DeploymentOperationsClient.NewListAtScopePager.
+type DeploymentOperationsClientListAtScopeResponse struct {
+ // List of deployment operations.
+ DeploymentOperationsListResult
+}
+
+// DeploymentOperationsClientListAtSubscriptionScopeResponse contains the response from method DeploymentOperationsClient.NewListAtSubscriptionScopePager.
+type DeploymentOperationsClientListAtSubscriptionScopeResponse struct {
+ // List of deployment operations.
+ DeploymentOperationsListResult
+}
+
+// DeploymentOperationsClientListAtTenantScopeResponse contains the response from method DeploymentOperationsClient.NewListAtTenantScopePager.
+type DeploymentOperationsClientListAtTenantScopeResponse struct {
+ // List of deployment operations.
+ DeploymentOperationsListResult
+}
+
+// DeploymentOperationsClientListResponse contains the response from method DeploymentOperationsClient.NewListPager.
+type DeploymentOperationsClientListResponse struct {
+ // List of deployment operations.
+ DeploymentOperationsListResult
+}
+
+// DeploymentsClientCalculateTemplateHashResponse contains the response from method DeploymentsClient.CalculateTemplateHash.
+type DeploymentsClientCalculateTemplateHashResponse struct {
+ // Result of the request to calculate template hash. It contains a string of minified template and its hash.
+ TemplateHashResult
+}
+
+// DeploymentsClientCancelAtManagementGroupScopeResponse contains the response from method DeploymentsClient.CancelAtManagementGroupScope.
+type DeploymentsClientCancelAtManagementGroupScopeResponse struct {
+ // placeholder for future response values
+}
+
+// DeploymentsClientCancelAtScopeResponse contains the response from method DeploymentsClient.CancelAtScope.
+type DeploymentsClientCancelAtScopeResponse struct {
+ // placeholder for future response values
+}
+
+// DeploymentsClientCancelAtSubscriptionScopeResponse contains the response from method DeploymentsClient.CancelAtSubscriptionScope.
+type DeploymentsClientCancelAtSubscriptionScopeResponse struct {
+ // placeholder for future response values
+}
+
+// DeploymentsClientCancelAtTenantScopeResponse contains the response from method DeploymentsClient.CancelAtTenantScope.
+type DeploymentsClientCancelAtTenantScopeResponse struct {
+ // placeholder for future response values
+}
+
+// DeploymentsClientCancelResponse contains the response from method DeploymentsClient.Cancel.
+type DeploymentsClientCancelResponse struct {
+ // placeholder for future response values
+}
+
+// DeploymentsClientCheckExistenceAtManagementGroupScopeResponse contains the response from method DeploymentsClient.CheckExistenceAtManagementGroupScope.
+type DeploymentsClientCheckExistenceAtManagementGroupScopeResponse struct {
+ // Success indicates if the operation succeeded or failed.
+ Success bool
+}
+
+// DeploymentsClientCheckExistenceAtScopeResponse contains the response from method DeploymentsClient.CheckExistenceAtScope.
+type DeploymentsClientCheckExistenceAtScopeResponse struct {
+ // Success indicates if the operation succeeded or failed.
+ Success bool
+}
+
+// DeploymentsClientCheckExistenceAtSubscriptionScopeResponse contains the response from method DeploymentsClient.CheckExistenceAtSubscriptionScope.
+type DeploymentsClientCheckExistenceAtSubscriptionScopeResponse struct {
+ // Success indicates if the operation succeeded or failed.
+ Success bool
+}
+
+// DeploymentsClientCheckExistenceAtTenantScopeResponse contains the response from method DeploymentsClient.CheckExistenceAtTenantScope.
+type DeploymentsClientCheckExistenceAtTenantScopeResponse struct {
+ // Success indicates if the operation succeeded or failed.
+ Success bool
+}
+
+// DeploymentsClientCheckExistenceResponse contains the response from method DeploymentsClient.CheckExistence.
+type DeploymentsClientCheckExistenceResponse struct {
+ // Success indicates if the operation succeeded or failed.
+ Success bool
+}
+
+// DeploymentsClientCreateOrUpdateAtManagementGroupScopeResponse contains the response from method DeploymentsClient.BeginCreateOrUpdateAtManagementGroupScope.
+type DeploymentsClientCreateOrUpdateAtManagementGroupScopeResponse struct {
+ // Deployment information.
+ DeploymentExtended
+}
+
+// DeploymentsClientCreateOrUpdateAtScopeResponse contains the response from method DeploymentsClient.BeginCreateOrUpdateAtScope.
+type DeploymentsClientCreateOrUpdateAtScopeResponse struct {
+ // Deployment information.
+ DeploymentExtended
+}
+
+// DeploymentsClientCreateOrUpdateAtSubscriptionScopeResponse contains the response from method DeploymentsClient.BeginCreateOrUpdateAtSubscriptionScope.
+type DeploymentsClientCreateOrUpdateAtSubscriptionScopeResponse struct {
+ // Deployment information.
+ DeploymentExtended
+}
+
+// DeploymentsClientCreateOrUpdateAtTenantScopeResponse contains the response from method DeploymentsClient.BeginCreateOrUpdateAtTenantScope.
+type DeploymentsClientCreateOrUpdateAtTenantScopeResponse struct {
+ // Deployment information.
+ DeploymentExtended
+}
+
+// DeploymentsClientCreateOrUpdateResponse contains the response from method DeploymentsClient.BeginCreateOrUpdate.
+type DeploymentsClientCreateOrUpdateResponse struct {
+ // Deployment information.
+ DeploymentExtended
+}
+
+// DeploymentsClientDeleteAtManagementGroupScopeResponse contains the response from method DeploymentsClient.BeginDeleteAtManagementGroupScope.
+type DeploymentsClientDeleteAtManagementGroupScopeResponse struct {
+ // placeholder for future response values
+}
+
+// DeploymentsClientDeleteAtScopeResponse contains the response from method DeploymentsClient.BeginDeleteAtScope.
+type DeploymentsClientDeleteAtScopeResponse struct {
+ // placeholder for future response values
+}
+
+// DeploymentsClientDeleteAtSubscriptionScopeResponse contains the response from method DeploymentsClient.BeginDeleteAtSubscriptionScope.
+type DeploymentsClientDeleteAtSubscriptionScopeResponse struct {
+ // placeholder for future response values
+}
+
+// DeploymentsClientDeleteAtTenantScopeResponse contains the response from method DeploymentsClient.BeginDeleteAtTenantScope.
+type DeploymentsClientDeleteAtTenantScopeResponse struct {
+ // placeholder for future response values
+}
+
+// DeploymentsClientDeleteResponse contains the response from method DeploymentsClient.BeginDelete.
+type DeploymentsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// DeploymentsClientExportTemplateAtManagementGroupScopeResponse contains the response from method DeploymentsClient.ExportTemplateAtManagementGroupScope.
+type DeploymentsClientExportTemplateAtManagementGroupScopeResponse struct {
+ // The deployment export result.
+ DeploymentExportResult
+}
+
+// DeploymentsClientExportTemplateAtScopeResponse contains the response from method DeploymentsClient.ExportTemplateAtScope.
+type DeploymentsClientExportTemplateAtScopeResponse struct {
+ // The deployment export result.
+ DeploymentExportResult
+}
+
+// DeploymentsClientExportTemplateAtSubscriptionScopeResponse contains the response from method DeploymentsClient.ExportTemplateAtSubscriptionScope.
+type DeploymentsClientExportTemplateAtSubscriptionScopeResponse struct {
+ // The deployment export result.
+ DeploymentExportResult
+}
+
+// DeploymentsClientExportTemplateAtTenantScopeResponse contains the response from method DeploymentsClient.ExportTemplateAtTenantScope.
+type DeploymentsClientExportTemplateAtTenantScopeResponse struct {
+ // The deployment export result.
+ DeploymentExportResult
+}
+
+// DeploymentsClientExportTemplateResponse contains the response from method DeploymentsClient.ExportTemplate.
+type DeploymentsClientExportTemplateResponse struct {
+ // The deployment export result.
+ DeploymentExportResult
+}
+
+// DeploymentsClientGetAtManagementGroupScopeResponse contains the response from method DeploymentsClient.GetAtManagementGroupScope.
+type DeploymentsClientGetAtManagementGroupScopeResponse struct {
+ // Deployment information.
+ DeploymentExtended
+}
+
+// DeploymentsClientGetAtScopeResponse contains the response from method DeploymentsClient.GetAtScope.
+type DeploymentsClientGetAtScopeResponse struct {
+ // Deployment information.
+ DeploymentExtended
+}
+
+// DeploymentsClientGetAtSubscriptionScopeResponse contains the response from method DeploymentsClient.GetAtSubscriptionScope.
+type DeploymentsClientGetAtSubscriptionScopeResponse struct {
+ // Deployment information.
+ DeploymentExtended
+}
+
+// DeploymentsClientGetAtTenantScopeResponse contains the response from method DeploymentsClient.GetAtTenantScope.
+type DeploymentsClientGetAtTenantScopeResponse struct {
+ // Deployment information.
+ DeploymentExtended
+}
+
+// DeploymentsClientGetResponse contains the response from method DeploymentsClient.Get.
+type DeploymentsClientGetResponse struct {
+ // Deployment information.
+ DeploymentExtended
+}
+
+// DeploymentsClientListAtManagementGroupScopeResponse contains the response from method DeploymentsClient.NewListAtManagementGroupScopePager.
+type DeploymentsClientListAtManagementGroupScopeResponse struct {
+ // List of deployments.
+ DeploymentListResult
+}
+
+// DeploymentsClientListAtScopeResponse contains the response from method DeploymentsClient.NewListAtScopePager.
+type DeploymentsClientListAtScopeResponse struct {
+ // List of deployments.
+ DeploymentListResult
+}
+
+// DeploymentsClientListAtSubscriptionScopeResponse contains the response from method DeploymentsClient.NewListAtSubscriptionScopePager.
+type DeploymentsClientListAtSubscriptionScopeResponse struct {
+ // List of deployments.
+ DeploymentListResult
+}
+
+// DeploymentsClientListAtTenantScopeResponse contains the response from method DeploymentsClient.NewListAtTenantScopePager.
+type DeploymentsClientListAtTenantScopeResponse struct {
+ // List of deployments.
+ DeploymentListResult
+}
+
+// DeploymentsClientListByResourceGroupResponse contains the response from method DeploymentsClient.NewListByResourceGroupPager.
+type DeploymentsClientListByResourceGroupResponse struct {
+ // List of deployments.
+ DeploymentListResult
+}
+
+// DeploymentsClientValidateAtManagementGroupScopeResponse contains the response from method DeploymentsClient.BeginValidateAtManagementGroupScope.
+type DeploymentsClientValidateAtManagementGroupScopeResponse struct {
+ // Information from validate template deployment response.
+ DeploymentValidateResult
+}
+
+// DeploymentsClientValidateAtScopeResponse contains the response from method DeploymentsClient.BeginValidateAtScope.
+type DeploymentsClientValidateAtScopeResponse struct {
+ // Information from validate template deployment response.
+ DeploymentValidateResult
+}
+
+// DeploymentsClientValidateAtSubscriptionScopeResponse contains the response from method DeploymentsClient.BeginValidateAtSubscriptionScope.
+type DeploymentsClientValidateAtSubscriptionScopeResponse struct {
+ // Information from validate template deployment response.
+ DeploymentValidateResult
+}
+
+// DeploymentsClientValidateAtTenantScopeResponse contains the response from method DeploymentsClient.BeginValidateAtTenantScope.
+type DeploymentsClientValidateAtTenantScopeResponse struct {
+ // Information from validate template deployment response.
+ DeploymentValidateResult
+}
+
+// DeploymentsClientValidateResponse contains the response from method DeploymentsClient.BeginValidate.
+type DeploymentsClientValidateResponse struct {
+ // Information from validate template deployment response.
+ DeploymentValidateResult
+}
+
+// DeploymentsClientWhatIfAtManagementGroupScopeResponse contains the response from method DeploymentsClient.BeginWhatIfAtManagementGroupScope.
+type DeploymentsClientWhatIfAtManagementGroupScopeResponse struct {
+ // Result of the What-If operation. Contains a list of predicted changes and a URL link to get to the next set of results.
+ WhatIfOperationResult
+}
+
+// DeploymentsClientWhatIfAtSubscriptionScopeResponse contains the response from method DeploymentsClient.BeginWhatIfAtSubscriptionScope.
+type DeploymentsClientWhatIfAtSubscriptionScopeResponse struct {
+ // Result of the What-If operation. Contains a list of predicted changes and a URL link to get to the next set of results.
+ WhatIfOperationResult
+}
+
+// DeploymentsClientWhatIfAtTenantScopeResponse contains the response from method DeploymentsClient.BeginWhatIfAtTenantScope.
+type DeploymentsClientWhatIfAtTenantScopeResponse struct {
+ // Result of the What-If operation. Contains a list of predicted changes and a URL link to get to the next set of results.
+ WhatIfOperationResult
+}
+
+// DeploymentsClientWhatIfResponse contains the response from method DeploymentsClient.BeginWhatIf.
+type DeploymentsClientWhatIfResponse struct {
+ // Result of the What-If operation. Contains a list of predicted changes and a URL link to get to the next set of results.
+ WhatIfOperationResult
+}
+
+// OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
+type OperationsClientListResponse struct {
+ // Result of the request to list Microsoft.Resources operations. It contains a list of operations and a URL link to get the
+ // next set of results.
+ OperationListResult
+}
+
+// ProviderResourceTypesClientListResponse contains the response from method ProviderResourceTypesClient.List.
+type ProviderResourceTypesClientListResponse struct {
+ // List of resource types of a resource provider.
+ ProviderResourceTypeListResult
+}
+
+// ProvidersClientGetAtTenantScopeResponse contains the response from method ProvidersClient.GetAtTenantScope.
+type ProvidersClientGetAtTenantScopeResponse struct {
+ // Resource provider information.
+ Provider
+}
+
+// ProvidersClientGetResponse contains the response from method ProvidersClient.Get.
+type ProvidersClientGetResponse struct {
+ // Resource provider information.
+ Provider
+}
+
+// ProvidersClientListAtTenantScopeResponse contains the response from method ProvidersClient.NewListAtTenantScopePager.
+type ProvidersClientListAtTenantScopeResponse struct {
+ // List of resource providers.
+ ProviderListResult
+}
+
+// ProvidersClientListResponse contains the response from method ProvidersClient.NewListPager.
+type ProvidersClientListResponse struct {
+ // List of resource providers.
+ ProviderListResult
+}
+
+// ProvidersClientProviderPermissionsResponse contains the response from method ProvidersClient.ProviderPermissions.
+type ProvidersClientProviderPermissionsResponse struct {
+ // List of provider permissions.
+ ProviderPermissionListResult
+}
+
+// ProvidersClientRegisterAtManagementGroupScopeResponse contains the response from method ProvidersClient.RegisterAtManagementGroupScope.
+type ProvidersClientRegisterAtManagementGroupScopeResponse struct {
+ // placeholder for future response values
+}
+
+// ProvidersClientRegisterResponse contains the response from method ProvidersClient.Register.
+type ProvidersClientRegisterResponse struct {
+ // Resource provider information.
+ Provider
+}
+
+// ProvidersClientUnregisterResponse contains the response from method ProvidersClient.Unregister.
+type ProvidersClientUnregisterResponse struct {
+ // Resource provider information.
+ Provider
+}
+
+// ResourceGroupsClientCheckExistenceResponse contains the response from method ResourceGroupsClient.CheckExistence.
+type ResourceGroupsClientCheckExistenceResponse struct {
+ // Success indicates if the operation succeeded or failed.
+ Success bool
+}
+
+// ResourceGroupsClientCreateOrUpdateResponse contains the response from method ResourceGroupsClient.CreateOrUpdate.
+type ResourceGroupsClientCreateOrUpdateResponse struct {
+ // Resource group information.
+ ResourceGroup
+}
+
+// ResourceGroupsClientDeleteResponse contains the response from method ResourceGroupsClient.BeginDelete.
+type ResourceGroupsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// ResourceGroupsClientExportTemplateResponse contains the response from method ResourceGroupsClient.BeginExportTemplate.
+type ResourceGroupsClientExportTemplateResponse struct {
+ // Resource group export result.
+ ResourceGroupExportResult
+}
+
+// ResourceGroupsClientGetResponse contains the response from method ResourceGroupsClient.Get.
+type ResourceGroupsClientGetResponse struct {
+ // Resource group information.
+ ResourceGroup
+}
+
+// ResourceGroupsClientListResponse contains the response from method ResourceGroupsClient.NewListPager.
+type ResourceGroupsClientListResponse struct {
+ // List of resource groups.
+ ResourceGroupListResult
+}
+
+// ResourceGroupsClientUpdateResponse contains the response from method ResourceGroupsClient.Update.
+type ResourceGroupsClientUpdateResponse struct {
+ // Resource group information.
+ ResourceGroup
+}
+
+// TagsClientCreateOrUpdateAtScopeResponse contains the response from method TagsClient.CreateOrUpdateAtScope.
+type TagsClientCreateOrUpdateAtScopeResponse struct {
+ // Wrapper resource for tags API requests and responses.
+ TagsResource
+}
+
+// TagsClientCreateOrUpdateResponse contains the response from method TagsClient.CreateOrUpdate.
+type TagsClientCreateOrUpdateResponse struct {
+ // Tag details.
+ TagDetails
+}
+
+// TagsClientCreateOrUpdateValueResponse contains the response from method TagsClient.CreateOrUpdateValue.
+type TagsClientCreateOrUpdateValueResponse struct {
+ // Tag information.
+ TagValue
+}
+
+// TagsClientDeleteAtScopeResponse contains the response from method TagsClient.DeleteAtScope.
+type TagsClientDeleteAtScopeResponse struct {
+ // placeholder for future response values
+}
+
+// TagsClientDeleteResponse contains the response from method TagsClient.Delete.
+type TagsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// TagsClientDeleteValueResponse contains the response from method TagsClient.DeleteValue.
+type TagsClientDeleteValueResponse struct {
+ // placeholder for future response values
+}
+
+// TagsClientGetAtScopeResponse contains the response from method TagsClient.GetAtScope.
+type TagsClientGetAtScopeResponse struct {
+ // Wrapper resource for tags API requests and responses.
+ TagsResource
+}
+
+// TagsClientListResponse contains the response from method TagsClient.NewListPager.
+type TagsClientListResponse struct {
+ // List of subscription tags.
+ TagsListResult
+}
+
+// TagsClientUpdateAtScopeResponse contains the response from method TagsClient.UpdateAtScope.
+type TagsClientUpdateAtScopeResponse struct {
+ // Wrapper resource for tags API requests and responses.
+ TagsResource
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/tags_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/tags_client.go
new file mode 100644
index 000000000..b6d0fc249
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/tags_client.go
@@ -0,0 +1,544 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// TagsClient contains the methods for the Tags group.
+// Don't use this type directly, use NewTagsClient() instead.
+type TagsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewTagsClient creates a new instance of TagsClient with the specified values.
+// - subscriptionID - The Microsoft Azure subscription ID.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewTagsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TagsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &TagsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - This operation allows adding a name to the list of predefined tag names for the given subscription. A
+// tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the
+// following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - tagName - The name of the tag to create.
+// - options - TagsClientCreateOrUpdateOptions contains the optional parameters for the TagsClient.CreateOrUpdate method.
+func (client *TagsClient) CreateOrUpdate(ctx context.Context, tagName string, options *TagsClientCreateOrUpdateOptions) (TagsClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "TagsClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, tagName, options)
+ if err != nil {
+ return TagsClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TagsClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return TagsClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *TagsClient) createOrUpdateCreateRequest(ctx context.Context, tagName string, options *TagsClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/tagNames/{tagName}"
+ if tagName == "" {
+ return nil, errors.New("parameter tagName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tagName}", url.PathEscape(tagName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *TagsClient) createOrUpdateHandleResponse(resp *http.Response) (TagsClientCreateOrUpdateResponse, error) {
+ result := TagsClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TagDetails); err != nil {
+ return TagsClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// CreateOrUpdateAtScope - This operation allows adding or replacing the entire set of tags on the specified resource or subscription.
+// The specified entity can have a maximum of 50 tags.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - options - TagsClientCreateOrUpdateAtScopeOptions contains the optional parameters for the TagsClient.CreateOrUpdateAtScope
+// method.
+func (client *TagsClient) CreateOrUpdateAtScope(ctx context.Context, scope string, parameters TagsResource, options *TagsClientCreateOrUpdateAtScopeOptions) (TagsClientCreateOrUpdateAtScopeResponse, error) {
+ var err error
+ const operationName = "TagsClient.CreateOrUpdateAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateAtScopeCreateRequest(ctx, scope, parameters, options)
+ if err != nil {
+ return TagsClientCreateOrUpdateAtScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TagsClientCreateOrUpdateAtScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TagsClientCreateOrUpdateAtScopeResponse{}, err
+ }
+ resp, err := client.createOrUpdateAtScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateAtScopeCreateRequest creates the CreateOrUpdateAtScope request.
+func (client *TagsClient) createOrUpdateAtScopeCreateRequest(ctx context.Context, scope string, parameters TagsResource, options *TagsClientCreateOrUpdateAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/tags/default"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateAtScopeHandleResponse handles the CreateOrUpdateAtScope response.
+func (client *TagsClient) createOrUpdateAtScopeHandleResponse(resp *http.Response) (TagsClientCreateOrUpdateAtScopeResponse, error) {
+ result := TagsClientCreateOrUpdateAtScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TagsResource); err != nil {
+ return TagsClientCreateOrUpdateAtScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// CreateOrUpdateValue - This operation allows adding a value to the list of predefined values for an existing predefined
+// tag name. A tag value can have a maximum of 256 characters.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - tagName - The name of the tag.
+// - tagValue - The value of the tag to create.
+// - options - TagsClientCreateOrUpdateValueOptions contains the optional parameters for the TagsClient.CreateOrUpdateValue
+// method.
+func (client *TagsClient) CreateOrUpdateValue(ctx context.Context, tagName string, tagValue string, options *TagsClientCreateOrUpdateValueOptions) (TagsClientCreateOrUpdateValueResponse, error) {
+ var err error
+ const operationName = "TagsClient.CreateOrUpdateValue"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateValueCreateRequest(ctx, tagName, tagValue, options)
+ if err != nil {
+ return TagsClientCreateOrUpdateValueResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TagsClientCreateOrUpdateValueResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return TagsClientCreateOrUpdateValueResponse{}, err
+ }
+ resp, err := client.createOrUpdateValueHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateValueCreateRequest creates the CreateOrUpdateValue request.
+func (client *TagsClient) createOrUpdateValueCreateRequest(ctx context.Context, tagName string, tagValue string, options *TagsClientCreateOrUpdateValueOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}"
+ if tagName == "" {
+ return nil, errors.New("parameter tagName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tagName}", url.PathEscape(tagName))
+ if tagValue == "" {
+ return nil, errors.New("parameter tagValue cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tagValue}", url.PathEscape(tagValue))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// createOrUpdateValueHandleResponse handles the CreateOrUpdateValue response.
+func (client *TagsClient) createOrUpdateValueHandleResponse(resp *http.Response) (TagsClientCreateOrUpdateValueResponse, error) {
+ result := TagsClientCreateOrUpdateValueResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TagValue); err != nil {
+ return TagsClientCreateOrUpdateValueResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - This operation allows deleting a name from the list of predefined tag names for the given subscription. The name
+// being deleted must not be in use as a tag name for any resource. All predefined values
+// for the given name must have already been deleted.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - tagName - The name of the tag.
+// - options - TagsClientDeleteOptions contains the optional parameters for the TagsClient.Delete method.
+func (client *TagsClient) Delete(ctx context.Context, tagName string, options *TagsClientDeleteOptions) (TagsClientDeleteResponse, error) {
+ var err error
+ const operationName = "TagsClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, tagName, options)
+ if err != nil {
+ return TagsClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TagsClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return TagsClientDeleteResponse{}, err
+ }
+ return TagsClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *TagsClient) deleteCreateRequest(ctx context.Context, tagName string, options *TagsClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/tagNames/{tagName}"
+ if tagName == "" {
+ return nil, errors.New("parameter tagName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tagName}", url.PathEscape(tagName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// DeleteAtScope - Deletes the entire set of tags on a resource or subscription.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - options - TagsClientDeleteAtScopeOptions contains the optional parameters for the TagsClient.DeleteAtScope method.
+func (client *TagsClient) DeleteAtScope(ctx context.Context, scope string, options *TagsClientDeleteAtScopeOptions) (TagsClientDeleteAtScopeResponse, error) {
+ var err error
+ const operationName = "TagsClient.DeleteAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteAtScopeCreateRequest(ctx, scope, options)
+ if err != nil {
+ return TagsClientDeleteAtScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TagsClientDeleteAtScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TagsClientDeleteAtScopeResponse{}, err
+ }
+ return TagsClientDeleteAtScopeResponse{}, nil
+}
+
+// deleteAtScopeCreateRequest creates the DeleteAtScope request.
+func (client *TagsClient) deleteAtScopeCreateRequest(ctx context.Context, scope string, options *TagsClientDeleteAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/tags/default"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// DeleteValue - This operation allows deleting a value from the list of predefined values for an existing predefined tag
+// name. The value being deleted must not be in use as a tag value for the given tag name for any
+// resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - tagName - The name of the tag.
+// - tagValue - The value of the tag to delete.
+// - options - TagsClientDeleteValueOptions contains the optional parameters for the TagsClient.DeleteValue method.
+func (client *TagsClient) DeleteValue(ctx context.Context, tagName string, tagValue string, options *TagsClientDeleteValueOptions) (TagsClientDeleteValueResponse, error) {
+ var err error
+ const operationName = "TagsClient.DeleteValue"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteValueCreateRequest(ctx, tagName, tagValue, options)
+ if err != nil {
+ return TagsClientDeleteValueResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TagsClientDeleteValueResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return TagsClientDeleteValueResponse{}, err
+ }
+ return TagsClientDeleteValueResponse{}, nil
+}
+
+// deleteValueCreateRequest creates the DeleteValue request.
+func (client *TagsClient) deleteValueCreateRequest(ctx context.Context, tagName string, tagValue string, options *TagsClientDeleteValueOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}"
+ if tagName == "" {
+ return nil, errors.New("parameter tagName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tagName}", url.PathEscape(tagName))
+ if tagValue == "" {
+ return nil, errors.New("parameter tagValue cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tagValue}", url.PathEscape(tagValue))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// GetAtScope - Gets the entire set of tags on a resource or subscription.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - options - TagsClientGetAtScopeOptions contains the optional parameters for the TagsClient.GetAtScope method.
+func (client *TagsClient) GetAtScope(ctx context.Context, scope string, options *TagsClientGetAtScopeOptions) (TagsClientGetAtScopeResponse, error) {
+ var err error
+ const operationName = "TagsClient.GetAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getAtScopeCreateRequest(ctx, scope, options)
+ if err != nil {
+ return TagsClientGetAtScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TagsClientGetAtScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TagsClientGetAtScopeResponse{}, err
+ }
+ resp, err := client.getAtScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// getAtScopeCreateRequest creates the GetAtScope request.
+func (client *TagsClient) getAtScopeCreateRequest(ctx context.Context, scope string, options *TagsClientGetAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/tags/default"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getAtScopeHandleResponse handles the GetAtScope response.
+func (client *TagsClient) getAtScopeHandleResponse(resp *http.Response) (TagsClientGetAtScopeResponse, error) {
+ result := TagsClientGetAtScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TagsResource); err != nil {
+ return TagsClientGetAtScopeResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - This operation performs a union of predefined tags, resource tags, resource group tags and subscription
+// tags, and returns a summary of usage for each tag name and value under the given subscription.
+// In case of a large number of tags, this operation may return a previously cached result.
+//
+// Generated from API version 2021-04-01
+// - options - TagsClientListOptions contains the optional parameters for the TagsClient.NewListPager method.
+func (client *TagsClient) NewListPager(options *TagsClientListOptions) *runtime.Pager[TagsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[TagsClientListResponse]{
+ More: func(page TagsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *TagsClientListResponse) (TagsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TagsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return TagsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *TagsClient) listCreateRequest(ctx context.Context, options *TagsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/tagNames"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *TagsClient) listHandleResponse(resp *http.Response) (TagsClientListResponse, error) {
+ result := TagsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TagsListResult); err != nil {
+ return TagsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// UpdateAtScope - This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription.
+// The specified entity can have a maximum of 50 tags at the end of the operation. The
+// 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new
+// names and updating the values of tags with existing names. The 'delete' option
+// allows selectively deleting tags based on given names or name/value pairs.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2021-04-01
+// - scope - The resource scope.
+// - options - TagsClientUpdateAtScopeOptions contains the optional parameters for the TagsClient.UpdateAtScope method.
+func (client *TagsClient) UpdateAtScope(ctx context.Context, scope string, parameters TagsPatchResource, options *TagsClientUpdateAtScopeOptions) (TagsClientUpdateAtScopeResponse, error) {
+ var err error
+ const operationName = "TagsClient.UpdateAtScope"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateAtScopeCreateRequest(ctx, scope, parameters, options)
+ if err != nil {
+ return TagsClientUpdateAtScopeResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TagsClientUpdateAtScopeResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TagsClientUpdateAtScopeResponse{}, err
+ }
+ resp, err := client.updateAtScopeHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateAtScopeCreateRequest creates the UpdateAtScope request.
+func (client *TagsClient) updateAtScopeCreateRequest(ctx context.Context, scope string, parameters TagsPatchResource, options *TagsClientUpdateAtScopeOptions) (*policy.Request, error) {
+ urlPath := "/{scope}/providers/Microsoft.Resources/tags/default"
+ urlPath = strings.ReplaceAll(urlPath, "{scope}", scope)
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2021-04-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateAtScopeHandleResponse handles the UpdateAtScope response.
+func (client *TagsClient) updateAtScopeHandleResponse(resp *http.Response) (TagsClientUpdateAtScopeResponse, error) {
+ result := TagsClientUpdateAtScopeResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TagsResource); err != nil {
+ return TagsClientUpdateAtScopeResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/time_rfc3339.go
new file mode 100644
index 000000000..5026e349b
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/time_rfc3339.go
@@ -0,0 +1,86 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armresources
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+ "regexp"
+ "strings"
+ "time"
+)
+
+// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases.
+var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`)
+
+const (
+ utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"`
+ utcDateTime = "2006-01-02T15:04:05.999999999"
+ dateTimeJSON = `"` + time.RFC3339Nano + `"`
+)
+
+type dateTimeRFC3339 time.Time
+
+func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalJSON()
+}
+
+func (t dateTimeRFC3339) MarshalText() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalText()
+}
+
+func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error {
+ layout := utcDateTimeJSON
+ if tzOffsetRegex.Match(data) {
+ layout = dateTimeJSON
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) UnmarshalText(data []byte) error {
+ layout := utcDateTime
+ if tzOffsetRegex.Match(data) {
+ layout = time.RFC3339Nano
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) Parse(layout, value string) error {
+ p, err := time.Parse(layout, strings.ToUpper(value))
+ *t = dateTimeRFC3339(p)
+ return err
+}
+
+func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) {
+ if t == nil {
+ return
+ } else if azcore.IsNullValue(t) {
+ m[k] = nil
+ return
+ } else if reflect.ValueOf(t).IsNil() {
+ return
+ }
+ m[k] = (*dateTimeRFC3339)(t)
+}
+
+func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error {
+ if data == nil || strings.EqualFold(string(data), "null") {
+ return nil
+ }
+ var aux dateTimeRFC3339
+ if err := json.Unmarshal(data, &aux); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ *t = (*time.Time)(&aux)
+ return nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/CHANGELOG.md
new file mode 100644
index 000000000..c9aefb399
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/CHANGELOG.md
@@ -0,0 +1,68 @@
+# Release History
+
+## 1.5.0 (2023-11-24)
+### Features Added
+
+- Support for test fakes and OpenTelemetry trace spans.
+
+
+## 1.5.0-beta.1 (2023-10-09)
+### Features Added
+
+- Support for test fakes and OpenTelemetry trace spans.
+
+## 1.4.0 (2023-08-25)
+### Features Added
+
+- New value `CorsRuleAllowedMethodsItemCONNECT`, `CorsRuleAllowedMethodsItemTRACE` added to enum type `CorsRuleAllowedMethodsItem`
+- New enum type `MigrationName` with values `MigrationNameDefault`
+- New enum type `MigrationStatus` with values `MigrationStatusComplete`, `MigrationStatusFailed`, `MigrationStatusInProgress`, `MigrationStatusInvalid`, `MigrationStatusSubmittedForConversion`
+- New enum type `PostFailoverRedundancy` with values `PostFailoverRedundancyStandardLRS`, `PostFailoverRedundancyStandardZRS`
+- New enum type `PostPlannedFailoverRedundancy` with values `PostPlannedFailoverRedundancyStandardGRS`, `PostPlannedFailoverRedundancyStandardGZRS`, `PostPlannedFailoverRedundancyStandardRAGRS`, `PostPlannedFailoverRedundancyStandardRAGZRS`
+- New function `*AccountsClient.BeginCustomerInitiatedMigration(context.Context, string, string, AccountMigration, *AccountsClientBeginCustomerInitiatedMigrationOptions) (*runtime.Poller[AccountsClientCustomerInitiatedMigrationResponse], error)`
+- New function `*AccountsClient.GetCustomerInitiatedMigration(context.Context, string, string, MigrationName, *AccountsClientGetCustomerInitiatedMigrationOptions) (AccountsClientGetCustomerInitiatedMigrationResponse, error)`
+- New struct `AccountMigration`
+- New struct `AccountMigrationProperties`
+- New struct `BlobInventoryCreationTime`
+- New struct `ErrorAdditionalInfo`
+- New struct `ErrorDetail`
+- New struct `ErrorResponseAutoGenerated`
+- New field `AccountMigrationInProgress`, `IsSKUConversionBlocked` in struct `AccountProperties`
+- New field `CreationTime` in struct `BlobInventoryPolicyFilter`
+- New field `CanPlannedFailover`, `PostFailoverRedundancy`, `PostPlannedFailoverRedundancy` in struct `GeoReplicationStats`
+
+
+## 1.3.0 (2023-03-27)
+### Features Added
+
+- New struct `ClientFactory` which is a client factory used to create any client in this module
+
+## 1.2.0 (2022-12-23)
+### Features Added
+
+- New type alias `ListEncryptionScopesInclude`
+- New field `FailoverType` in struct `AccountsClientBeginFailoverOptions`
+- New field `TierToCold` in struct `ManagementPolicyBaseBlob`
+- New field `TierToHot` in struct `ManagementPolicyBaseBlob`
+- New field `Filter` in struct `EncryptionScopesClientListOptions`
+- New field `Include` in struct `EncryptionScopesClientListOptions`
+- New field `Maxpagesize` in struct `EncryptionScopesClientListOptions`
+- New field `TierToHot` in struct `ManagementPolicyVersion`
+- New field `TierToCold` in struct `ManagementPolicyVersion`
+- New field `TierToCold` in struct `ManagementPolicySnapShot`
+- New field `TierToHot` in struct `ManagementPolicySnapShot`
+
+
+## 1.1.0 (2022-08-10)
+### Features Added
+
+- New const `DirectoryServiceOptionsAADKERB`
+
+
+## 1.0.0 (2022-05-16)
+
+The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes.
+
+To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration).
+
+To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt).
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/LICENSE.txt
new file mode 100644
index 000000000..dc0c2ffb3
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/README.md
new file mode 100644
index 000000000..9f7fe2b72
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/README.md
@@ -0,0 +1,102 @@
+# Azure Storage Module for Go
+
+[](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage)
+
+The `armstorage` module provides operations for working with Azure Storage.
+
+[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/storage/armstorage)
+
+# Getting started
+
+## Prerequisites
+
+- an [Azure subscription](https://azure.microsoft.com/free/)
+- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). 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](https://go.dev/doc/manage-install).)
+
+## Install the package
+
+This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
+
+Install the Azure Storage module:
+
+```sh
+go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage
+```
+
+## Authorization
+
+When creating a client, you will need to provide a credential for authenticating with Azure Storage. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.
+
+```go
+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](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity).
+
+## Client Factory
+
+Azure Storage module consists of one or more clients. We provide a client factory which could be used to create any client in this module.
+
+```go
+clientFactory, err := armstorage.NewClientFactory(, 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](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore).
+
+```go
+options := arm.ClientOptions {
+ ClientOptions: azcore.ClientOptions {
+ Cloud: cloud.AzureChina,
+ },
+}
+clientFactory, err := armstorage.NewClientFactory(, 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.
+
+```go
+client := clientFactory.NewAccountsClient()
+```
+
+## 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.
+
+## More sample code
+
+- [Blob](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/blob)
+- [Creating a Fake](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/resourcemanager/storage/armstorage/fake_example_test.go)
+- [File](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/file)
+- [Management Policy](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/managementpolicy)
+- [Queue](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/queue)
+- [Storage Account](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/storageaccount)
+- [Table](https://aka.ms/azsdk/go/mgmt/samples?path=sdk/resourcemanager/storage/table)
+
+## Provide Feedback
+
+If you encounter bugs or have suggestions, please
+[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Storage` 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](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](https://opensource.microsoft.com/codeofconduct/).
+For more information, see the
+[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
+or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
+additional questions or comments.
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/accounts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/accounts_client.go
new file mode 100644
index 000000000..81c6bc011
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/accounts_client.go
@@ -0,0 +1,1330 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// AccountsClient contains the methods for the StorageAccounts group.
+// Don't use this type directly, use NewAccountsClient() instead.
+type AccountsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewAccountsClient creates a new instance of AccountsClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &AccountsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// BeginAbortHierarchicalNamespaceMigration - Abort live Migration of storage account to enable Hns
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginAbortHierarchicalNamespaceMigration
+// method.
+func (client *AccountsClient) BeginAbortHierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*runtime.Poller[AccountsClientAbortHierarchicalNamespaceMigrationResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.abortHierarchicalNamespaceMigration(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientAbortHierarchicalNamespaceMigrationResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientAbortHierarchicalNamespaceMigrationResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// AbortHierarchicalNamespaceMigration - Abort live Migration of storage account to enable Hns
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+func (client *AccountsClient) abortHierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginAbortHierarchicalNamespaceMigration"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.abortHierarchicalNamespaceMigrationCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// abortHierarchicalNamespaceMigrationCreateRequest creates the AbortHierarchicalNamespaceMigration request.
+func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// CheckNameAvailability - Checks that the storage account name is valid and is not already in use.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientCheckNameAvailabilityOptions contains the optional parameters for the AccountsClient.CheckNameAvailability
+// method.
+func (client *AccountsClient) CheckNameAvailability(ctx context.Context, accountName AccountCheckNameAvailabilityParameters, options *AccountsClientCheckNameAvailabilityOptions) (AccountsClientCheckNameAvailabilityResponse, error) {
+ var err error
+ const operationName = "AccountsClient.CheckNameAvailability"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.checkNameAvailabilityCreateRequest(ctx, accountName, options)
+ if err != nil {
+ return AccountsClientCheckNameAvailabilityResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientCheckNameAvailabilityResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientCheckNameAvailabilityResponse{}, err
+ }
+ resp, err := client.checkNameAvailabilityHandleResponse(httpResp)
+ return resp, err
+}
+
+// checkNameAvailabilityCreateRequest creates the CheckNameAvailability request.
+func (client *AccountsClient) checkNameAvailabilityCreateRequest(ctx context.Context, accountName AccountCheckNameAvailabilityParameters, options *AccountsClientCheckNameAvailabilityOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, accountName); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// checkNameAvailabilityHandleResponse handles the CheckNameAvailability response.
+func (client *AccountsClient) checkNameAvailabilityHandleResponse(resp *http.Response) (AccountsClientCheckNameAvailabilityResponse, error) {
+ result := AccountsClientCheckNameAvailabilityResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.CheckNameAvailabilityResult); err != nil {
+ return AccountsClientCheckNameAvailabilityResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginCreate - Asynchronously creates a new storage account with the specified parameters. If an account is already created
+// and a subsequent create request is issued with different properties, the account properties
+// will be updated. If an account is already created and a subsequent create or update request is issued with the exact same
+// set of properties, the request will succeed.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to provide for the created account.
+// - options - AccountsClientBeginCreateOptions contains the optional parameters for the AccountsClient.BeginCreate method.
+func (client *AccountsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountsClientBeginCreateOptions) (*runtime.Poller[AccountsClientCreateResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.create(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientCreateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientCreateResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Create - Asynchronously creates a new storage account with the specified parameters. If an account is already created and
+// a subsequent create request is issued with different properties, the account properties
+// will be updated. If an account is already created and a subsequent create or update request is issued with the exact same
+// set of properties, the request will succeed.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+func (client *AccountsClient) create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountsClientBeginCreateOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginCreate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// createCreateRequest creates the Create request.
+func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountsClientBeginCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// BeginCustomerInitiatedMigration - Account Migration request can be triggered for a storage account to change its redundancy
+// level. The migration updates the non-zonal redundant storage account to a zonal redundant account or
+// vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account
+// synchronously across three Azure availability zones in the primary region.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The request parameters required to perform storage account migration.
+// - options - AccountsClientBeginCustomerInitiatedMigrationOptions contains the optional parameters for the AccountsClient.BeginCustomerInitiatedMigration
+// method.
+func (client *AccountsClient) BeginCustomerInitiatedMigration(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, options *AccountsClientBeginCustomerInitiatedMigrationOptions) (*runtime.Poller[AccountsClientCustomerInitiatedMigrationResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.customerInitiatedMigration(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientCustomerInitiatedMigrationResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientCustomerInitiatedMigrationResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// CustomerInitiatedMigration - Account Migration request can be triggered for a storage account to change its redundancy
+// level. The migration updates the non-zonal redundant storage account to a zonal redundant account or
+// vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account
+// synchronously across three Azure availability zones in the primary region.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+func (client *AccountsClient) customerInitiatedMigration(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, options *AccountsClientBeginCustomerInitiatedMigrationOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginCustomerInitiatedMigration"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.customerInitiatedMigrationCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// customerInitiatedMigrationCreateRequest creates the CustomerInitiatedMigration request.
+func (client *AccountsClient) customerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, options *AccountsClientBeginCustomerInitiatedMigrationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// Delete - Deletes a storage account in Microsoft Azure.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientDeleteOptions contains the optional parameters for the AccountsClient.Delete method.
+func (client *AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientDeleteOptions) (AccountsClientDeleteResponse, error) {
+ var err error
+ const operationName = "AccountsClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return AccountsClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientDeleteResponse{}, err
+ }
+ return AccountsClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// BeginFailover - A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable
+// for any reason. The failover occurs from the storage account's primary cluster to the
+// secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover and the account is converted
+// to LRS. In the case of a Planned Failover, the primary and secondary
+// clusters are swapped after failover and the account remains geo-replicated. Failover should continue to be used in the
+// event of availability issues as Planned failover is only available while the
+// primary and secondary endpoints are available. The primary use case of a Planned Failover is disaster recovery testing
+// drills. This type of failover is invoked by setting FailoverType parameter to
+// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientBeginFailoverOptions contains the optional parameters for the AccountsClient.BeginFailover method.
+func (client *AccountsClient) BeginFailover(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginFailoverOptions) (*runtime.Poller[AccountsClientFailoverResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.failover(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientFailoverResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientFailoverResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// Failover - A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable
+// for any reason. The failover occurs from the storage account's primary cluster to the
+// secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover and the account is converted
+// to LRS. In the case of a Planned Failover, the primary and secondary
+// clusters are swapped after failover and the account remains geo-replicated. Failover should continue to be used in the
+// event of availability issues as Planned failover is only available while the
+// primary and secondary endpoints are available. The primary use case of a Planned Failover is disaster recovery testing
+// drills. This type of failover is invoked by setting FailoverType parameter to
+// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+func (client *AccountsClient) failover(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginFailoverOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginFailover"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.failoverCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// failoverCreateRequest creates the Failover request.
+func (client *AccountsClient) failoverCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginFailoverOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ if options != nil && options.FailoverType != nil {
+ reqQP.Set("failoverType", "Planned")
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// GetCustomerInitiatedMigration - Gets the status of the ongoing migration for the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - migrationName - The name of the Storage Account Migration. It should always be 'default'
+// - options - AccountsClientGetCustomerInitiatedMigrationOptions contains the optional parameters for the AccountsClient.GetCustomerInitiatedMigration
+// method.
+func (client *AccountsClient) GetCustomerInitiatedMigration(ctx context.Context, resourceGroupName string, accountName string, migrationName MigrationName, options *AccountsClientGetCustomerInitiatedMigrationOptions) (AccountsClientGetCustomerInitiatedMigrationResponse, error) {
+ var err error
+ const operationName = "AccountsClient.GetCustomerInitiatedMigration"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCustomerInitiatedMigrationCreateRequest(ctx, resourceGroupName, accountName, migrationName, options)
+ if err != nil {
+ return AccountsClientGetCustomerInitiatedMigrationResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientGetCustomerInitiatedMigrationResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientGetCustomerInitiatedMigrationResponse{}, err
+ }
+ resp, err := client.getCustomerInitiatedMigrationHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCustomerInitiatedMigrationCreateRequest creates the GetCustomerInitiatedMigration request.
+func (client *AccountsClient) getCustomerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, migrationName MigrationName, options *AccountsClientGetCustomerInitiatedMigrationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/{migrationName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if migrationName == "" {
+ return nil, errors.New("parameter migrationName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{migrationName}", url.PathEscape(string(migrationName)))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getCustomerInitiatedMigrationHandleResponse handles the GetCustomerInitiatedMigration response.
+func (client *AccountsClient) getCustomerInitiatedMigrationHandleResponse(resp *http.Response) (AccountsClientGetCustomerInitiatedMigrationResponse, error) {
+ result := AccountsClientGetCustomerInitiatedMigrationResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AccountMigration); err != nil {
+ return AccountsClientGetCustomerInitiatedMigrationResponse{}, err
+ }
+ return result, nil
+}
+
+// GetProperties - Returns the properties for the specified storage account including but not limited to name, SKU name, location,
+// and account status. The ListKeys operation should be used to retrieve storage keys.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientGetPropertiesOptions contains the optional parameters for the AccountsClient.GetProperties method.
+func (client *AccountsClient) GetProperties(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientGetPropertiesOptions) (AccountsClientGetPropertiesResponse, error) {
+ var err error
+ const operationName = "AccountsClient.GetProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getPropertiesCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return AccountsClientGetPropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientGetPropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientGetPropertiesResponse{}, err
+ }
+ resp, err := client.getPropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// getPropertiesCreateRequest creates the GetProperties request.
+func (client *AccountsClient) getPropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientGetPropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", string(*options.Expand))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getPropertiesHandleResponse handles the GetProperties response.
+func (client *AccountsClient) getPropertiesHandleResponse(resp *http.Response) (AccountsClientGetPropertiesResponse, error) {
+ result := AccountsClientGetPropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Account); err != nil {
+ return AccountsClientGetPropertiesResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginHierarchicalNamespaceMigration - Live Migration of storage account to enable Hns
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - requestType - Required. Hierarchical namespace migration type can either be a hierarchical namespace validation request
+// 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation
+// request will validate the migration whereas the hydration request will migrate the account.
+// - options - AccountsClientBeginHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginHierarchicalNamespaceMigration
+// method.
+func (client *AccountsClient) BeginHierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, requestType string, options *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*runtime.Poller[AccountsClientHierarchicalNamespaceMigrationResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.hierarchicalNamespaceMigration(ctx, resourceGroupName, accountName, requestType, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientHierarchicalNamespaceMigrationResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientHierarchicalNamespaceMigrationResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// HierarchicalNamespaceMigration - Live Migration of storage account to enable Hns
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+func (client *AccountsClient) hierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, requestType string, options *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginHierarchicalNamespaceMigration"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.hierarchicalNamespaceMigrationCreateRequest(ctx, resourceGroupName, accountName, requestType, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// hierarchicalNamespaceMigrationCreateRequest creates the HierarchicalNamespaceMigration request.
+func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, requestType string, options *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ reqQP.Set("requestType", requestType)
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// NewListPager - Lists all the storage accounts available under the subscription. Note that storage keys are not returned;
+// use the ListKeys operation for this.
+//
+// Generated from API version 2023-01-01
+// - options - AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method.
+func (client *AccountsClient) NewListPager(options *AccountsClientListOptions) *runtime.Pager[AccountsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[AccountsClientListResponse]{
+ More: func(page AccountsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *AccountsClientListResponse) (AccountsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AccountsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return AccountsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *AccountsClient) listCreateRequest(ctx context.Context, options *AccountsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *AccountsClient) listHandleResponse(resp *http.Response) (AccountsClientListResponse, error) {
+ result := AccountsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AccountListResult); err != nil {
+ return AccountsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// ListAccountSAS - List SAS credentials of a storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to provide to list SAS credentials for the storage account.
+// - options - AccountsClientListAccountSASOptions contains the optional parameters for the AccountsClient.ListAccountSAS method.
+func (client *AccountsClient) ListAccountSAS(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters, options *AccountsClientListAccountSASOptions) (AccountsClientListAccountSASResponse, error) {
+ var err error
+ const operationName = "AccountsClient.ListAccountSAS"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listAccountSASCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return AccountsClientListAccountSASResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientListAccountSASResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientListAccountSASResponse{}, err
+ }
+ resp, err := client.listAccountSASHandleResponse(httpResp)
+ return resp, err
+}
+
+// listAccountSASCreateRequest creates the ListAccountSAS request.
+func (client *AccountsClient) listAccountSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters, options *AccountsClientListAccountSASOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// listAccountSASHandleResponse handles the ListAccountSAS response.
+func (client *AccountsClient) listAccountSASHandleResponse(resp *http.Response) (AccountsClientListAccountSASResponse, error) {
+ result := AccountsClientListAccountSASResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListAccountSasResponse); err != nil {
+ return AccountsClientListAccountSASResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListByResourceGroupPager - Lists all the storage accounts available under the given resource group. Note that storage
+// keys are not returned; use the ListKeys operation for this.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - options - AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.NewListByResourceGroupPager
+// method.
+func (client *AccountsClient) NewListByResourceGroupPager(resourceGroupName string, options *AccountsClientListByResourceGroupOptions) *runtime.Pager[AccountsClientListByResourceGroupResponse] {
+ return runtime.NewPager(runtime.PagingHandler[AccountsClientListByResourceGroupResponse]{
+ More: func(page AccountsClientListByResourceGroupResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *AccountsClientListByResourceGroupResponse) (AccountsClientListByResourceGroupResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AccountsClient.NewListByResourceGroupPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
+ }, nil)
+ if err != nil {
+ return AccountsClientListByResourceGroupResponse{}, err
+ }
+ return client.listByResourceGroupHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
+func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AccountsClientListByResourceGroupOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
+func (client *AccountsClient) listByResourceGroupHandleResponse(resp *http.Response) (AccountsClientListByResourceGroupResponse, error) {
+ result := AccountsClientListByResourceGroupResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AccountListResult); err != nil {
+ return AccountsClientListByResourceGroupResponse{}, err
+ }
+ return result, nil
+}
+
+// ListKeys - Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientListKeysOptions contains the optional parameters for the AccountsClient.ListKeys method.
+func (client *AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListKeysOptions) (AccountsClientListKeysResponse, error) {
+ var err error
+ const operationName = "AccountsClient.ListKeys"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listKeysCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return AccountsClientListKeysResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientListKeysResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientListKeysResponse{}, err
+ }
+ resp, err := client.listKeysHandleResponse(httpResp)
+ return resp, err
+}
+
+// listKeysCreateRequest creates the ListKeys request.
+func (client *AccountsClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientListKeysOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", "kerb")
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listKeysHandleResponse handles the ListKeys response.
+func (client *AccountsClient) listKeysHandleResponse(resp *http.Response) (AccountsClientListKeysResponse, error) {
+ result := AccountsClientListKeysResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AccountListKeysResult); err != nil {
+ return AccountsClientListKeysResponse{}, err
+ }
+ return result, nil
+}
+
+// ListServiceSAS - List service SAS credentials of a specific resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to provide to list service SAS credentials.
+// - options - AccountsClientListServiceSASOptions contains the optional parameters for the AccountsClient.ListServiceSAS method.
+func (client *AccountsClient) ListServiceSAS(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters, options *AccountsClientListServiceSASOptions) (AccountsClientListServiceSASResponse, error) {
+ var err error
+ const operationName = "AccountsClient.ListServiceSAS"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listServiceSASCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return AccountsClientListServiceSASResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientListServiceSASResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientListServiceSASResponse{}, err
+ }
+ resp, err := client.listServiceSASHandleResponse(httpResp)
+ return resp, err
+}
+
+// listServiceSASCreateRequest creates the ListServiceSAS request.
+func (client *AccountsClient) listServiceSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters, options *AccountsClientListServiceSASOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// listServiceSASHandleResponse handles the ListServiceSAS response.
+func (client *AccountsClient) listServiceSASHandleResponse(resp *http.Response) (AccountsClientListServiceSASResponse, error) {
+ result := AccountsClientListServiceSASResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListServiceSasResponse); err != nil {
+ return AccountsClientListServiceSASResponse{}, err
+ }
+ return result, nil
+}
+
+// RegenerateKey - Regenerates one of the access keys or Kerberos keys for the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - regenerateKey - Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2.
+// - options - AccountsClientRegenerateKeyOptions contains the optional parameters for the AccountsClient.RegenerateKey method.
+func (client *AccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters, options *AccountsClientRegenerateKeyOptions) (AccountsClientRegenerateKeyResponse, error) {
+ var err error
+ const operationName = "AccountsClient.RegenerateKey"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, accountName, regenerateKey, options)
+ if err != nil {
+ return AccountsClientRegenerateKeyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientRegenerateKeyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientRegenerateKeyResponse{}, err
+ }
+ resp, err := client.regenerateKeyHandleResponse(httpResp)
+ return resp, err
+}
+
+// regenerateKeyCreateRequest creates the RegenerateKey request.
+func (client *AccountsClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters, options *AccountsClientRegenerateKeyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, regenerateKey); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// regenerateKeyHandleResponse handles the RegenerateKey response.
+func (client *AccountsClient) regenerateKeyHandleResponse(resp *http.Response) (AccountsClientRegenerateKeyResponse, error) {
+ result := AccountsClientRegenerateKeyResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.AccountListKeysResult); err != nil {
+ return AccountsClientRegenerateKeyResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginRestoreBlobRanges - Restore blobs in the specified blob ranges
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to provide for restore blob ranges.
+// - options - AccountsClientBeginRestoreBlobRangesOptions contains the optional parameters for the AccountsClient.BeginRestoreBlobRanges
+// method.
+func (client *AccountsClient) BeginRestoreBlobRanges(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, options *AccountsClientBeginRestoreBlobRangesOptions) (*runtime.Poller[AccountsClientRestoreBlobRangesResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.restoreBlobRanges(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientRestoreBlobRangesResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientRestoreBlobRangesResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// RestoreBlobRanges - Restore blobs in the specified blob ranges
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+func (client *AccountsClient) restoreBlobRanges(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, options *AccountsClientBeginRestoreBlobRangesOptions) (*http.Response, error) {
+ var err error
+ const operationName = "AccountsClient.BeginRestoreBlobRanges"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.restoreBlobRangesCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// restoreBlobRangesCreateRequest creates the RestoreBlobRanges request.
+func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, options *AccountsClientBeginRestoreBlobRangesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// RevokeUserDelegationKeys - Revoke user delegation keys.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - AccountsClientRevokeUserDelegationKeysOptions contains the optional parameters for the AccountsClient.RevokeUserDelegationKeys
+// method.
+func (client *AccountsClient) RevokeUserDelegationKeys(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientRevokeUserDelegationKeysOptions) (AccountsClientRevokeUserDelegationKeysResponse, error) {
+ var err error
+ const operationName = "AccountsClient.RevokeUserDelegationKeys"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.revokeUserDelegationKeysCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return AccountsClientRevokeUserDelegationKeysResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientRevokeUserDelegationKeysResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientRevokeUserDelegationKeysResponse{}, err
+ }
+ return AccountsClientRevokeUserDelegationKeysResponse{}, nil
+}
+
+// revokeUserDelegationKeysCreateRequest creates the RevokeUserDelegationKeys request.
+func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientRevokeUserDelegationKeysOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// Update - The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It
+// can also be used to map the account to a custom domain. Only one custom domain is
+// supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom
+// domain, the old value must be cleared/unregistered before a new value can be
+// set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you
+// want to change the storage account keys, use the regenerate keys operation. The
+// location and name of the storage account cannot be changed after creation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The parameters to provide for the updated account.
+// - options - AccountsClientUpdateOptions contains the optional parameters for the AccountsClient.Update method.
+func (client *AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters, options *AccountsClientUpdateOptions) (AccountsClientUpdateResponse, error) {
+ var err error
+ const operationName = "AccountsClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return AccountsClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return AccountsClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return AccountsClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters, options *AccountsClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *AccountsClient) updateHandleResponse(resp *http.Response) (AccountsClientUpdateResponse, error) {
+ result := AccountsClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Account); err != nil {
+ return AccountsClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/assets.json
new file mode 100644
index 000000000..799f7afd7
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/assets.json
@@ -0,0 +1,6 @@
+{
+ "AssetsRepo": "Azure/azure-sdk-assets",
+ "AssetsRepoPrefixPath": "go",
+ "TagPrefix": "go/resourcemanager/storage/armstorage",
+ "Tag": "go/resourcemanager/storage/armstorage_c9d59e874d"
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/autorest.md
new file mode 100644
index 000000000..2a581188e
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/autorest.md
@@ -0,0 +1,15 @@
+### AutoRest Configuration
+
+> see https://aka.ms/autorest
+
+``` yaml
+azure-arm: true
+require:
+- https://github.com/Azure/azure-rest-api-specs/blob/0baf811c3c76c87b3c127d098519bd97141222dd/specification/storage/resource-manager/readme.md
+- https://github.com/Azure/azure-rest-api-specs/blob/0baf811c3c76c87b3c127d098519bd97141222dd/specification/storage/resource-manager/readme.go.md
+license-header: MICROSOFT_MIT_NO_VERSION
+module-version: 1.5.0
+modelerfour:
+ seal-single-value-enum-by-default: true
+tag: package-2023-01
+```
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobcontainers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobcontainers_client.go
new file mode 100644
index 000000000..666afdcd8
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobcontainers_client.go
@@ -0,0 +1,1151 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// BlobContainersClient contains the methods for the BlobContainers group.
+// Don't use this type directly, use NewBlobContainersClient() instead.
+type BlobContainersClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewBlobContainersClient creates a new instance of BlobContainersClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewBlobContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BlobContainersClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &BlobContainersClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// ClearLegalHold - Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold
+// clears out only the specified tags in the request.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - legalHold - The LegalHold property that will be clear from a blob container.
+// - options - BlobContainersClientClearLegalHoldOptions contains the optional parameters for the BlobContainersClient.ClearLegalHold
+// method.
+func (client *BlobContainersClient) ClearLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, options *BlobContainersClientClearLegalHoldOptions) (BlobContainersClientClearLegalHoldResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.ClearLegalHold"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.clearLegalHoldCreateRequest(ctx, resourceGroupName, accountName, containerName, legalHold, options)
+ if err != nil {
+ return BlobContainersClientClearLegalHoldResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientClearLegalHoldResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientClearLegalHoldResponse{}, err
+ }
+ resp, err := client.clearLegalHoldHandleResponse(httpResp)
+ return resp, err
+}
+
+// clearLegalHoldCreateRequest creates the ClearLegalHold request.
+func (client *BlobContainersClient) clearLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, options *BlobContainersClientClearLegalHoldOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, legalHold); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// clearLegalHoldHandleResponse handles the ClearLegalHold response.
+func (client *BlobContainersClient) clearLegalHoldHandleResponse(resp *http.Response) (BlobContainersClientClearLegalHoldResponse, error) {
+ result := BlobContainersClientClearLegalHoldResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LegalHold); err != nil {
+ return BlobContainersClientClearLegalHoldResponse{}, err
+ }
+ return result, nil
+}
+
+// Create - Creates a new container under the specified account as described by request body. The container resource includes
+// metadata and properties for that container. It does not include a list of the blobs
+// contained by the container.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - blobContainer - Properties of the blob container to create.
+// - options - BlobContainersClientCreateOptions contains the optional parameters for the BlobContainersClient.Create method.
+func (client *BlobContainersClient) Create(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, options *BlobContainersClientCreateOptions) (BlobContainersClientCreateResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.Create"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, containerName, blobContainer, options)
+ if err != nil {
+ return BlobContainersClientCreateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientCreateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientCreateResponse{}, err
+ }
+ resp, err := client.createHandleResponse(httpResp)
+ return resp, err
+}
+
+// createCreateRequest creates the Create request.
+func (client *BlobContainersClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, options *BlobContainersClientCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, blobContainer); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createHandleResponse handles the Create response.
+func (client *BlobContainersClient) createHandleResponse(resp *http.Response) (BlobContainersClientCreateResponse, error) {
+ result := BlobContainersClientCreateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobContainer); err != nil {
+ return BlobContainersClientCreateResponse{}, err
+ }
+ return result, nil
+}
+
+// CreateOrUpdateImmutabilityPolicy - Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given
+// but not required for this operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.CreateOrUpdateImmutabilityPolicy
+// method.
+func (client *BlobContainersClient) CreateOrUpdateImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions) (BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.CreateOrUpdateImmutabilityPolicy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse{}, err
+ }
+ resp, err := client.createOrUpdateImmutabilityPolicyHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateImmutabilityPolicyCreateRequest creates the CreateOrUpdateImmutabilityPolicy request.
+func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ urlPath = strings.ReplaceAll(urlPath, "{immutabilityPolicyName}", url.PathEscape("default"))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ if options != nil && options.IfMatch != nil {
+ req.Raw().Header["If-Match"] = []string{*options.IfMatch}
+ }
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// createOrUpdateImmutabilityPolicyHandleResponse handles the CreateOrUpdateImmutabilityPolicy response.
+func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyHandleResponse(resp *http.Response) (BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse, error) {
+ result := BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImmutabilityPolicy); err != nil {
+ return BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes specified container under its account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientDeleteOptions contains the optional parameters for the BlobContainersClient.Delete method.
+func (client *BlobContainersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientDeleteOptions) (BlobContainersClientDeleteResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return BlobContainersClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientDeleteResponse{}, err
+ }
+ return BlobContainersClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// DeleteImmutabilityPolicy - Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays
+// set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability
+// policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked
+// container.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - ifMatch - The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the
+// operation only if the immutability policy already exists. If omitted, this operation will
+// always be applied.
+// - options - BlobContainersClientDeleteImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.DeleteImmutabilityPolicy
+// method.
+func (client *BlobContainersClient) DeleteImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientDeleteImmutabilityPolicyOptions) (BlobContainersClientDeleteImmutabilityPolicyResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.DeleteImmutabilityPolicy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, ifMatch, options)
+ if err != nil {
+ return BlobContainersClientDeleteImmutabilityPolicyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientDeleteImmutabilityPolicyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientDeleteImmutabilityPolicyResponse{}, err
+ }
+ resp, err := client.deleteImmutabilityPolicyHandleResponse(httpResp)
+ return resp, err
+}
+
+// deleteImmutabilityPolicyCreateRequest creates the DeleteImmutabilityPolicy request.
+func (client *BlobContainersClient) deleteImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientDeleteImmutabilityPolicyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ urlPath = strings.ReplaceAll(urlPath, "{immutabilityPolicyName}", url.PathEscape("default"))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["If-Match"] = []string{ifMatch}
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// deleteImmutabilityPolicyHandleResponse handles the DeleteImmutabilityPolicy response.
+func (client *BlobContainersClient) deleteImmutabilityPolicyHandleResponse(resp *http.Response) (BlobContainersClientDeleteImmutabilityPolicyResponse, error) {
+ result := BlobContainersClientDeleteImmutabilityPolicyResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImmutabilityPolicy); err != nil {
+ return BlobContainersClientDeleteImmutabilityPolicyResponse{}, err
+ }
+ return result, nil
+}
+
+// ExtendImmutabilityPolicy - Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action
+// allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - ifMatch - The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the
+// operation only if the immutability policy already exists. If omitted, this operation will
+// always be applied.
+// - options - BlobContainersClientExtendImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.ExtendImmutabilityPolicy
+// method.
+func (client *BlobContainersClient) ExtendImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientExtendImmutabilityPolicyOptions) (BlobContainersClientExtendImmutabilityPolicyResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.ExtendImmutabilityPolicy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.extendImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, ifMatch, options)
+ if err != nil {
+ return BlobContainersClientExtendImmutabilityPolicyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientExtendImmutabilityPolicyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientExtendImmutabilityPolicyResponse{}, err
+ }
+ resp, err := client.extendImmutabilityPolicyHandleResponse(httpResp)
+ return resp, err
+}
+
+// extendImmutabilityPolicyCreateRequest creates the ExtendImmutabilityPolicy request.
+func (client *BlobContainersClient) extendImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientExtendImmutabilityPolicyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["If-Match"] = []string{ifMatch}
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// extendImmutabilityPolicyHandleResponse handles the ExtendImmutabilityPolicy response.
+func (client *BlobContainersClient) extendImmutabilityPolicyHandleResponse(resp *http.Response) (BlobContainersClientExtendImmutabilityPolicyResponse, error) {
+ result := BlobContainersClientExtendImmutabilityPolicyResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImmutabilityPolicy); err != nil {
+ return BlobContainersClientExtendImmutabilityPolicyResponse{}, err
+ }
+ return result, nil
+}
+
+// Get - Gets properties of a specified container.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientGetOptions contains the optional parameters for the BlobContainersClient.Get method.
+func (client *BlobContainersClient) Get(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientGetOptions) (BlobContainersClientGetResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return BlobContainersClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *BlobContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *BlobContainersClient) getHandleResponse(resp *http.Response) (BlobContainersClientGetResponse, error) {
+ result := BlobContainersClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobContainer); err != nil {
+ return BlobContainersClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// GetImmutabilityPolicy - Gets the existing immutability policy along with the corresponding ETag in response headers and
+// body.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientGetImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.GetImmutabilityPolicy
+// method.
+func (client *BlobContainersClient) GetImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientGetImmutabilityPolicyOptions) (BlobContainersClientGetImmutabilityPolicyResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.GetImmutabilityPolicy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return BlobContainersClientGetImmutabilityPolicyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientGetImmutabilityPolicyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientGetImmutabilityPolicyResponse{}, err
+ }
+ resp, err := client.getImmutabilityPolicyHandleResponse(httpResp)
+ return resp, err
+}
+
+// getImmutabilityPolicyCreateRequest creates the GetImmutabilityPolicy request.
+func (client *BlobContainersClient) getImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientGetImmutabilityPolicyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ urlPath = strings.ReplaceAll(urlPath, "{immutabilityPolicyName}", url.PathEscape("default"))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ if options != nil && options.IfMatch != nil {
+ req.Raw().Header["If-Match"] = []string{*options.IfMatch}
+ }
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getImmutabilityPolicyHandleResponse handles the GetImmutabilityPolicy response.
+func (client *BlobContainersClient) getImmutabilityPolicyHandleResponse(resp *http.Response) (BlobContainersClientGetImmutabilityPolicyResponse, error) {
+ result := BlobContainersClientGetImmutabilityPolicyResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImmutabilityPolicy); err != nil {
+ return BlobContainersClientGetImmutabilityPolicyResponse{}, err
+ }
+ return result, nil
+}
+
+// Lease - The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration
+// can be 15 to 60 seconds, or can be infinite.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientLeaseOptions contains the optional parameters for the BlobContainersClient.Lease method.
+func (client *BlobContainersClient) Lease(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientLeaseOptions) (BlobContainersClientLeaseResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.Lease"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.leaseCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return BlobContainersClientLeaseResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientLeaseResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientLeaseResponse{}, err
+ }
+ resp, err := client.leaseHandleResponse(httpResp)
+ return resp, err
+}
+
+// leaseCreateRequest creates the Lease request.
+func (client *BlobContainersClient) leaseCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientLeaseOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// leaseHandleResponse handles the Lease response.
+func (client *BlobContainersClient) leaseHandleResponse(resp *http.Response) (BlobContainersClientLeaseResponse, error) {
+ result := BlobContainersClientLeaseResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LeaseContainerResponse); err != nil {
+ return BlobContainersClientLeaseResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation
+// token.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - BlobContainersClientListOptions contains the optional parameters for the BlobContainersClient.NewListPager method.
+func (client *BlobContainersClient) NewListPager(resourceGroupName string, accountName string, options *BlobContainersClientListOptions) *runtime.Pager[BlobContainersClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[BlobContainersClientListResponse]{
+ More: func(page BlobContainersClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *BlobContainersClientListResponse) (BlobContainersClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BlobContainersClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return BlobContainersClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *BlobContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BlobContainersClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", *options.Maxpagesize)
+ }
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Include != nil {
+ reqQP.Set("$include", string(*options.Include))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *BlobContainersClient) listHandleResponse(resp *http.Response) (BlobContainersClientListResponse, error) {
+ result := BlobContainersClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListContainerItems); err != nil {
+ return BlobContainersClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// LockImmutabilityPolicy - Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy
+// action. ETag in If-Match is required for this operation.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - ifMatch - The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the
+// operation only if the immutability policy already exists. If omitted, this operation will
+// always be applied.
+// - options - BlobContainersClientLockImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.LockImmutabilityPolicy
+// method.
+func (client *BlobContainersClient) LockImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientLockImmutabilityPolicyOptions) (BlobContainersClientLockImmutabilityPolicyResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.LockImmutabilityPolicy"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.lockImmutabilityPolicyCreateRequest(ctx, resourceGroupName, accountName, containerName, ifMatch, options)
+ if err != nil {
+ return BlobContainersClientLockImmutabilityPolicyResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientLockImmutabilityPolicyResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientLockImmutabilityPolicyResponse{}, err
+ }
+ resp, err := client.lockImmutabilityPolicyHandleResponse(httpResp)
+ return resp, err
+}
+
+// lockImmutabilityPolicyCreateRequest creates the LockImmutabilityPolicy request.
+func (client *BlobContainersClient) lockImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientLockImmutabilityPolicyOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["If-Match"] = []string{ifMatch}
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// lockImmutabilityPolicyHandleResponse handles the LockImmutabilityPolicy response.
+func (client *BlobContainersClient) lockImmutabilityPolicyHandleResponse(resp *http.Response) (BlobContainersClientLockImmutabilityPolicyResponse, error) {
+ result := BlobContainersClientLockImmutabilityPolicyResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.ImmutabilityPolicy); err != nil {
+ return BlobContainersClientLockImmutabilityPolicyResponse{}, err
+ }
+ return result, nil
+}
+
+// BeginObjectLevelWorm - This operation migrates a blob container from container level WORM to object level immutability
+// enabled container. Prerequisites require a container level immutability policy either in locked or
+// unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - BlobContainersClientBeginObjectLevelWormOptions contains the optional parameters for the BlobContainersClient.BeginObjectLevelWorm
+// method.
+func (client *BlobContainersClient) BeginObjectLevelWorm(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientBeginObjectLevelWormOptions) (*runtime.Poller[BlobContainersClientObjectLevelWormResponse], error) {
+ if options == nil || options.ResumeToken == "" {
+ resp, err := client.objectLevelWorm(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return nil, err
+ }
+ poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BlobContainersClientObjectLevelWormResponse]{
+ FinalStateVia: runtime.FinalStateViaLocation,
+ Tracer: client.internal.Tracer(),
+ })
+ return poller, err
+ } else {
+ return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BlobContainersClientObjectLevelWormResponse]{
+ Tracer: client.internal.Tracer(),
+ })
+ }
+}
+
+// ObjectLevelWorm - This operation migrates a blob container from container level WORM to object level immutability enabled
+// container. Prerequisites require a container level immutability policy either in locked or
+// unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+func (client *BlobContainersClient) objectLevelWorm(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientBeginObjectLevelWormOptions) (*http.Response, error) {
+ var err error
+ const operationName = "BlobContainersClient.BeginObjectLevelWorm"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.objectLevelWormCreateRequest(ctx, resourceGroupName, accountName, containerName, options)
+ if err != nil {
+ return nil, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return nil, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) {
+ err = runtime.NewResponseError(httpResp)
+ return nil, err
+ }
+ return httpResp, nil
+}
+
+// objectLevelWormCreateRequest creates the ObjectLevelWorm request.
+func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientBeginObjectLevelWormOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// SetLegalHold - Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append
+// pattern and does not clear out the existing tags that are not specified in the request.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - legalHold - The LegalHold property that will be set to a blob container.
+// - options - BlobContainersClientSetLegalHoldOptions contains the optional parameters for the BlobContainersClient.SetLegalHold
+// method.
+func (client *BlobContainersClient) SetLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, options *BlobContainersClientSetLegalHoldOptions) (BlobContainersClientSetLegalHoldResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.SetLegalHold"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.setLegalHoldCreateRequest(ctx, resourceGroupName, accountName, containerName, legalHold, options)
+ if err != nil {
+ return BlobContainersClientSetLegalHoldResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientSetLegalHoldResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientSetLegalHoldResponse{}, err
+ }
+ resp, err := client.setLegalHoldHandleResponse(httpResp)
+ return resp, err
+}
+
+// setLegalHoldCreateRequest creates the SetLegalHold request.
+func (client *BlobContainersClient) setLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, options *BlobContainersClientSetLegalHoldOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, legalHold); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// setLegalHoldHandleResponse handles the SetLegalHold response.
+func (client *BlobContainersClient) setLegalHoldHandleResponse(resp *http.Response) (BlobContainersClientSetLegalHoldResponse, error) {
+ result := BlobContainersClientSetLegalHoldResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LegalHold); err != nil {
+ return BlobContainersClientSetLegalHoldResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged.
+// Update fails if the specified container doesn't already exist.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - containerName - The name of the blob container within the specified storage account. Blob container names must be between
+// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - blobContainer - Properties to update for the blob container.
+// - options - BlobContainersClientUpdateOptions contains the optional parameters for the BlobContainersClient.Update method.
+func (client *BlobContainersClient) Update(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, options *BlobContainersClientUpdateOptions) (BlobContainersClientUpdateResponse, error) {
+ var err error
+ const operationName = "BlobContainersClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, containerName, blobContainer, options)
+ if err != nil {
+ return BlobContainersClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobContainersClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobContainersClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *BlobContainersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, options *BlobContainersClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if containerName == "" {
+ return nil, errors.New("parameter containerName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, blobContainer); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *BlobContainersClient) updateHandleResponse(resp *http.Response) (BlobContainersClientUpdateResponse, error) {
+ result := BlobContainersClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobContainer); err != nil {
+ return BlobContainersClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobinventorypolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobinventorypolicies_client.go
new file mode 100644
index 000000000..5fd736aae
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobinventorypolicies_client.go
@@ -0,0 +1,318 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// BlobInventoryPoliciesClient contains the methods for the BlobInventoryPolicies group.
+// Don't use this type directly, use NewBlobInventoryPoliciesClient() instead.
+type BlobInventoryPoliciesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewBlobInventoryPoliciesClient creates a new instance of BlobInventoryPoliciesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewBlobInventoryPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BlobInventoryPoliciesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &BlobInventoryPoliciesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Sets the blob inventory policy to the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - blobInventoryPolicyName - The name of the storage account blob inventory policy. It should always be 'default'
+// - properties - The blob inventory policy set to a storage account.
+// - options - BlobInventoryPoliciesClientCreateOrUpdateOptions contains the optional parameters for the BlobInventoryPoliciesClient.CreateOrUpdate
+// method.
+func (client *BlobInventoryPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, properties BlobInventoryPolicy, options *BlobInventoryPoliciesClientCreateOrUpdateOptions) (BlobInventoryPoliciesClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "BlobInventoryPoliciesClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, blobInventoryPolicyName, properties, options)
+ if err != nil {
+ return BlobInventoryPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobInventoryPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobInventoryPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *BlobInventoryPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, properties BlobInventoryPolicy, options *BlobInventoryPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if blobInventoryPolicyName == "" {
+ return nil, errors.New("parameter blobInventoryPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{blobInventoryPolicyName}", url.PathEscape(string(blobInventoryPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *BlobInventoryPoliciesClient) createOrUpdateHandleResponse(resp *http.Response) (BlobInventoryPoliciesClientCreateOrUpdateResponse, error) {
+ result := BlobInventoryPoliciesClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobInventoryPolicy); err != nil {
+ return BlobInventoryPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the blob inventory policy associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - blobInventoryPolicyName - The name of the storage account blob inventory policy. It should always be 'default'
+// - options - BlobInventoryPoliciesClientDeleteOptions contains the optional parameters for the BlobInventoryPoliciesClient.Delete
+// method.
+func (client *BlobInventoryPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, options *BlobInventoryPoliciesClientDeleteOptions) (BlobInventoryPoliciesClientDeleteResponse, error) {
+ var err error
+ const operationName = "BlobInventoryPoliciesClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, blobInventoryPolicyName, options)
+ if err != nil {
+ return BlobInventoryPoliciesClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobInventoryPoliciesClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobInventoryPoliciesClientDeleteResponse{}, err
+ }
+ return BlobInventoryPoliciesClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, options *BlobInventoryPoliciesClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if blobInventoryPolicyName == "" {
+ return nil, errors.New("parameter blobInventoryPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{blobInventoryPolicyName}", url.PathEscape(string(blobInventoryPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets the blob inventory policy associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - blobInventoryPolicyName - The name of the storage account blob inventory policy. It should always be 'default'
+// - options - BlobInventoryPoliciesClientGetOptions contains the optional parameters for the BlobInventoryPoliciesClient.Get
+// method.
+func (client *BlobInventoryPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, options *BlobInventoryPoliciesClientGetOptions) (BlobInventoryPoliciesClientGetResponse, error) {
+ var err error
+ const operationName = "BlobInventoryPoliciesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, blobInventoryPolicyName, options)
+ if err != nil {
+ return BlobInventoryPoliciesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobInventoryPoliciesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobInventoryPoliciesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *BlobInventoryPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, options *BlobInventoryPoliciesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if blobInventoryPolicyName == "" {
+ return nil, errors.New("parameter blobInventoryPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{blobInventoryPolicyName}", url.PathEscape(string(blobInventoryPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *BlobInventoryPoliciesClient) getHandleResponse(resp *http.Response) (BlobInventoryPoliciesClientGetResponse, error) {
+ result := BlobInventoryPoliciesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobInventoryPolicy); err != nil {
+ return BlobInventoryPoliciesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets the blob inventory policy associated with the specified storage account.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - BlobInventoryPoliciesClientListOptions contains the optional parameters for the BlobInventoryPoliciesClient.NewListPager
+// method.
+func (client *BlobInventoryPoliciesClient) NewListPager(resourceGroupName string, accountName string, options *BlobInventoryPoliciesClientListOptions) *runtime.Pager[BlobInventoryPoliciesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[BlobInventoryPoliciesClientListResponse]{
+ More: func(page BlobInventoryPoliciesClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *BlobInventoryPoliciesClientListResponse) (BlobInventoryPoliciesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BlobInventoryPoliciesClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return BlobInventoryPoliciesClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobInventoryPoliciesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return BlobInventoryPoliciesClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *BlobInventoryPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BlobInventoryPoliciesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *BlobInventoryPoliciesClient) listHandleResponse(resp *http.Response) (BlobInventoryPoliciesClientListResponse, error) {
+ result := BlobInventoryPoliciesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListBlobInventoryPolicy); err != nil {
+ return BlobInventoryPoliciesClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobservices_client.go
new file mode 100644
index 000000000..18122f925
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobservices_client.go
@@ -0,0 +1,251 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// BlobServicesClient contains the methods for the BlobServices group.
+// Don't use this type directly, use NewBlobServicesClient() instead.
+type BlobServicesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewBlobServicesClient creates a new instance of BlobServicesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewBlobServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BlobServicesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &BlobServicesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// GetServiceProperties - Gets the properties of a storage account’s Blob service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - BlobServicesClientGetServicePropertiesOptions contains the optional parameters for the BlobServicesClient.GetServiceProperties
+// method.
+func (client *BlobServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, options *BlobServicesClientGetServicePropertiesOptions) (BlobServicesClientGetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "BlobServicesClient.GetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return BlobServicesClientGetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobServicesClientGetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobServicesClientGetServicePropertiesResponse{}, err
+ }
+ resp, err := client.getServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// getServicePropertiesCreateRequest creates the GetServiceProperties request.
+func (client *BlobServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BlobServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{BlobServicesName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getServicePropertiesHandleResponse handles the GetServiceProperties response.
+func (client *BlobServicesClient) getServicePropertiesHandleResponse(resp *http.Response) (BlobServicesClientGetServicePropertiesResponse, error) {
+ result := BlobServicesClientGetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobServiceProperties); err != nil {
+ return BlobServicesClientGetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List blob services of storage account. It returns a collection of one object named default.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - BlobServicesClientListOptions contains the optional parameters for the BlobServicesClient.NewListPager method.
+func (client *BlobServicesClient) NewListPager(resourceGroupName string, accountName string, options *BlobServicesClientListOptions) *runtime.Pager[BlobServicesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[BlobServicesClientListResponse]{
+ More: func(page BlobServicesClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *BlobServicesClientListResponse) (BlobServicesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BlobServicesClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return BlobServicesClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobServicesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return BlobServicesClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *BlobServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BlobServicesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *BlobServicesClient) listHandleResponse(resp *http.Response) (BlobServicesClientListResponse, error) {
+ result := BlobServicesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobServiceItems); err != nil {
+ return BlobServicesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// SetServiceProperties - Sets the properties of a storage account’s Blob service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin
+// Resource Sharing) rules.
+// - options - BlobServicesClientSetServicePropertiesOptions contains the optional parameters for the BlobServicesClient.SetServiceProperties
+// method.
+func (client *BlobServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters BlobServiceProperties, options *BlobServicesClientSetServicePropertiesOptions) (BlobServicesClientSetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "BlobServicesClient.SetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.setServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return BlobServicesClientSetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return BlobServicesClientSetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return BlobServicesClientSetServicePropertiesResponse{}, err
+ }
+ resp, err := client.setServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// setServicePropertiesCreateRequest creates the SetServiceProperties request.
+func (client *BlobServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobServiceProperties, options *BlobServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{BlobServicesName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// setServicePropertiesHandleResponse handles the SetServiceProperties response.
+func (client *BlobServicesClient) setServicePropertiesHandleResponse(resp *http.Response) (BlobServicesClientSetServicePropertiesResponse, error) {
+ result := BlobServicesClientSetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.BlobServiceProperties); err != nil {
+ return BlobServicesClientSetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/build.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/build.go
new file mode 100644
index 000000000..9c22bcd53
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/build.go
@@ -0,0 +1,7 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+// This file enables 'go generate' to regenerate this specific SDK
+//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/storage/armstorage
+
+package armstorage
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/ci.yml
new file mode 100644
index 000000000..56efca76c
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/ci.yml
@@ -0,0 +1,28 @@
+# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
+trigger:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/storage/armstorage/
+
+pr:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/resourcemanager/storage/armstorage/
+
+stages:
+- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
+ parameters:
+ IncludeRelease: true
+ ServiceDirectory: 'resourcemanager/storage/armstorage'
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/client_factory.go
new file mode 100644
index 000000000..d0da80d15
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/client_factory.go
@@ -0,0 +1,158 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+)
+
+// ClientFactory is a client factory used to create any client in this module.
+// Don't use this type directly, use NewClientFactory instead.
+type ClientFactory struct {
+ subscriptionID string
+ credential azcore.TokenCredential
+ options *arm.ClientOptions
+}
+
+// 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 ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {
+ _, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ return &ClientFactory{
+ subscriptionID: subscriptionID, credential: credential,
+ options: options.Clone(),
+ }, nil
+}
+
+// NewAccountsClient creates a new instance of AccountsClient.
+func (c *ClientFactory) NewAccountsClient() *AccountsClient {
+ subClient, _ := NewAccountsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewBlobContainersClient creates a new instance of BlobContainersClient.
+func (c *ClientFactory) NewBlobContainersClient() *BlobContainersClient {
+ subClient, _ := NewBlobContainersClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewBlobInventoryPoliciesClient creates a new instance of BlobInventoryPoliciesClient.
+func (c *ClientFactory) NewBlobInventoryPoliciesClient() *BlobInventoryPoliciesClient {
+ subClient, _ := NewBlobInventoryPoliciesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewBlobServicesClient creates a new instance of BlobServicesClient.
+func (c *ClientFactory) NewBlobServicesClient() *BlobServicesClient {
+ subClient, _ := NewBlobServicesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewDeletedAccountsClient creates a new instance of DeletedAccountsClient.
+func (c *ClientFactory) NewDeletedAccountsClient() *DeletedAccountsClient {
+ subClient, _ := NewDeletedAccountsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewEncryptionScopesClient creates a new instance of EncryptionScopesClient.
+func (c *ClientFactory) NewEncryptionScopesClient() *EncryptionScopesClient {
+ subClient, _ := NewEncryptionScopesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewFileServicesClient creates a new instance of FileServicesClient.
+func (c *ClientFactory) NewFileServicesClient() *FileServicesClient {
+ subClient, _ := NewFileServicesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewFileSharesClient creates a new instance of FileSharesClient.
+func (c *ClientFactory) NewFileSharesClient() *FileSharesClient {
+ subClient, _ := NewFileSharesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewLocalUsersClient creates a new instance of LocalUsersClient.
+func (c *ClientFactory) NewLocalUsersClient() *LocalUsersClient {
+ subClient, _ := NewLocalUsersClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewManagementPoliciesClient creates a new instance of ManagementPoliciesClient.
+func (c *ClientFactory) NewManagementPoliciesClient() *ManagementPoliciesClient {
+ subClient, _ := NewManagementPoliciesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewObjectReplicationPoliciesClient creates a new instance of ObjectReplicationPoliciesClient.
+func (c *ClientFactory) NewObjectReplicationPoliciesClient() *ObjectReplicationPoliciesClient {
+ subClient, _ := NewObjectReplicationPoliciesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewOperationsClient creates a new instance of OperationsClient.
+func (c *ClientFactory) NewOperationsClient() *OperationsClient {
+ subClient, _ := NewOperationsClient(c.credential, c.options)
+ return subClient
+}
+
+// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient.
+func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient {
+ subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient.
+func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient {
+ subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewQueueClient creates a new instance of QueueClient.
+func (c *ClientFactory) NewQueueClient() *QueueClient {
+ subClient, _ := NewQueueClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewQueueServicesClient creates a new instance of QueueServicesClient.
+func (c *ClientFactory) NewQueueServicesClient() *QueueServicesClient {
+ subClient, _ := NewQueueServicesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewSKUsClient creates a new instance of SKUsClient.
+func (c *ClientFactory) NewSKUsClient() *SKUsClient {
+ subClient, _ := NewSKUsClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewTableClient creates a new instance of TableClient.
+func (c *ClientFactory) NewTableClient() *TableClient {
+ subClient, _ := NewTableClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewTableServicesClient creates a new instance of TableServicesClient.
+func (c *ClientFactory) NewTableServicesClient() *TableServicesClient {
+ subClient, _ := NewTableServicesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
+
+// NewUsagesClient creates a new instance of UsagesClient.
+func (c *ClientFactory) NewUsagesClient() *UsagesClient {
+ subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options)
+ return subClient
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/constants.go
new file mode 100644
index 000000000..bfd1b531c
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/constants.go
@@ -0,0 +1,1274 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+const (
+ moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
+ moduleVersion = "v1.5.0"
+)
+
+// AccessTier - Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium'
+// access tier is the default value for premium block blobs storage account type and it cannot
+// be changed for the premium block blobs storage account type.
+type AccessTier string
+
+const (
+ AccessTierCool AccessTier = "Cool"
+ AccessTierHot AccessTier = "Hot"
+ AccessTierPremium AccessTier = "Premium"
+)
+
+// PossibleAccessTierValues returns the possible values for the AccessTier const type.
+func PossibleAccessTierValues() []AccessTier {
+ return []AccessTier{
+ AccessTierCool,
+ AccessTierHot,
+ AccessTierPremium,
+ }
+}
+
+// AccountImmutabilityPolicyState - The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the
+// policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling
+// allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy
+// can only be created in a Disabled or Unlocked state and can be toggled between
+// the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.
+type AccountImmutabilityPolicyState string
+
+const (
+ AccountImmutabilityPolicyStateDisabled AccountImmutabilityPolicyState = "Disabled"
+ AccountImmutabilityPolicyStateLocked AccountImmutabilityPolicyState = "Locked"
+ AccountImmutabilityPolicyStateUnlocked AccountImmutabilityPolicyState = "Unlocked"
+)
+
+// PossibleAccountImmutabilityPolicyStateValues returns the possible values for the AccountImmutabilityPolicyState const type.
+func PossibleAccountImmutabilityPolicyStateValues() []AccountImmutabilityPolicyState {
+ return []AccountImmutabilityPolicyState{
+ AccountImmutabilityPolicyStateDisabled,
+ AccountImmutabilityPolicyStateLocked,
+ AccountImmutabilityPolicyStateUnlocked,
+ }
+}
+
+// AccountStatus - Gets the status indicating whether the primary location of the storage account is available or unavailable.
+type AccountStatus string
+
+const (
+ AccountStatusAvailable AccountStatus = "available"
+ AccountStatusUnavailable AccountStatus = "unavailable"
+)
+
+// PossibleAccountStatusValues returns the possible values for the AccountStatus const type.
+func PossibleAccountStatusValues() []AccountStatus {
+ return []AccountStatus{
+ AccountStatusAvailable,
+ AccountStatusUnavailable,
+ }
+}
+
+// ActiveDirectoryPropertiesAccountType - Specifies the Active Directory account type for Azure Storage.
+type ActiveDirectoryPropertiesAccountType string
+
+const (
+ ActiveDirectoryPropertiesAccountTypeComputer ActiveDirectoryPropertiesAccountType = "Computer"
+ ActiveDirectoryPropertiesAccountTypeUser ActiveDirectoryPropertiesAccountType = "User"
+)
+
+// PossibleActiveDirectoryPropertiesAccountTypeValues returns the possible values for the ActiveDirectoryPropertiesAccountType const type.
+func PossibleActiveDirectoryPropertiesAccountTypeValues() []ActiveDirectoryPropertiesAccountType {
+ return []ActiveDirectoryPropertiesAccountType{
+ ActiveDirectoryPropertiesAccountTypeComputer,
+ ActiveDirectoryPropertiesAccountTypeUser,
+ }
+}
+
+// AllowedCopyScope - Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.
+type AllowedCopyScope string
+
+const (
+ AllowedCopyScopeAAD AllowedCopyScope = "AAD"
+ AllowedCopyScopePrivateLink AllowedCopyScope = "PrivateLink"
+)
+
+// PossibleAllowedCopyScopeValues returns the possible values for the AllowedCopyScope const type.
+func PossibleAllowedCopyScopeValues() []AllowedCopyScope {
+ return []AllowedCopyScope{
+ AllowedCopyScopeAAD,
+ AllowedCopyScopePrivateLink,
+ }
+}
+
+type BlobInventoryPolicyName string
+
+const (
+ BlobInventoryPolicyNameDefault BlobInventoryPolicyName = "default"
+)
+
+// PossibleBlobInventoryPolicyNameValues returns the possible values for the BlobInventoryPolicyName const type.
+func PossibleBlobInventoryPolicyNameValues() []BlobInventoryPolicyName {
+ return []BlobInventoryPolicyName{
+ BlobInventoryPolicyNameDefault,
+ }
+}
+
+// BlobRestoreProgressStatus - The status of blob restore progress. Possible values are: - InProgress: Indicates that blob
+// restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - Failed:
+// Indicates that blob restore is failed.
+type BlobRestoreProgressStatus string
+
+const (
+ BlobRestoreProgressStatusComplete BlobRestoreProgressStatus = "Complete"
+ BlobRestoreProgressStatusFailed BlobRestoreProgressStatus = "Failed"
+ BlobRestoreProgressStatusInProgress BlobRestoreProgressStatus = "InProgress"
+)
+
+// PossibleBlobRestoreProgressStatusValues returns the possible values for the BlobRestoreProgressStatus const type.
+func PossibleBlobRestoreProgressStatusValues() []BlobRestoreProgressStatus {
+ return []BlobRestoreProgressStatus{
+ BlobRestoreProgressStatusComplete,
+ BlobRestoreProgressStatusFailed,
+ BlobRestoreProgressStatusInProgress,
+ }
+}
+
+// Bypass - Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of
+// Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none
+// of those traffics.
+type Bypass string
+
+const (
+ BypassAzureServices Bypass = "AzureServices"
+ BypassLogging Bypass = "Logging"
+ BypassMetrics Bypass = "Metrics"
+ BypassNone Bypass = "None"
+)
+
+// PossibleBypassValues returns the possible values for the Bypass const type.
+func PossibleBypassValues() []Bypass {
+ return []Bypass{
+ BypassAzureServices,
+ BypassLogging,
+ BypassMetrics,
+ BypassNone,
+ }
+}
+
+type CorsRuleAllowedMethodsItem string
+
+const (
+ CorsRuleAllowedMethodsItemCONNECT CorsRuleAllowedMethodsItem = "CONNECT"
+ CorsRuleAllowedMethodsItemDELETE CorsRuleAllowedMethodsItem = "DELETE"
+ CorsRuleAllowedMethodsItemGET CorsRuleAllowedMethodsItem = "GET"
+ CorsRuleAllowedMethodsItemHEAD CorsRuleAllowedMethodsItem = "HEAD"
+ CorsRuleAllowedMethodsItemMERGE CorsRuleAllowedMethodsItem = "MERGE"
+ CorsRuleAllowedMethodsItemOPTIONS CorsRuleAllowedMethodsItem = "OPTIONS"
+ CorsRuleAllowedMethodsItemPATCH CorsRuleAllowedMethodsItem = "PATCH"
+ CorsRuleAllowedMethodsItemPOST CorsRuleAllowedMethodsItem = "POST"
+ CorsRuleAllowedMethodsItemPUT CorsRuleAllowedMethodsItem = "PUT"
+ CorsRuleAllowedMethodsItemTRACE CorsRuleAllowedMethodsItem = "TRACE"
+)
+
+// PossibleCorsRuleAllowedMethodsItemValues returns the possible values for the CorsRuleAllowedMethodsItem const type.
+func PossibleCorsRuleAllowedMethodsItemValues() []CorsRuleAllowedMethodsItem {
+ return []CorsRuleAllowedMethodsItem{
+ CorsRuleAllowedMethodsItemCONNECT,
+ CorsRuleAllowedMethodsItemDELETE,
+ CorsRuleAllowedMethodsItemGET,
+ CorsRuleAllowedMethodsItemHEAD,
+ CorsRuleAllowedMethodsItemMERGE,
+ CorsRuleAllowedMethodsItemOPTIONS,
+ CorsRuleAllowedMethodsItemPATCH,
+ CorsRuleAllowedMethodsItemPOST,
+ CorsRuleAllowedMethodsItemPUT,
+ CorsRuleAllowedMethodsItemTRACE,
+ }
+}
+
+// CreatedByType - The type of identity that created the resource.
+type CreatedByType string
+
+const (
+ CreatedByTypeApplication CreatedByType = "Application"
+ CreatedByTypeKey CreatedByType = "Key"
+ CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
+ CreatedByTypeUser CreatedByType = "User"
+)
+
+// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
+func PossibleCreatedByTypeValues() []CreatedByType {
+ return []CreatedByType{
+ CreatedByTypeApplication,
+ CreatedByTypeKey,
+ CreatedByTypeManagedIdentity,
+ CreatedByTypeUser,
+ }
+}
+
+// DNSEndpointType - Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts
+// in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL
+// will have an alphanumeric DNS Zone identifier.
+type DNSEndpointType string
+
+const (
+ DNSEndpointTypeAzureDNSZone DNSEndpointType = "AzureDnsZone"
+ DNSEndpointTypeStandard DNSEndpointType = "Standard"
+)
+
+// PossibleDNSEndpointTypeValues returns the possible values for the DNSEndpointType const type.
+func PossibleDNSEndpointTypeValues() []DNSEndpointType {
+ return []DNSEndpointType{
+ DNSEndpointTypeAzureDNSZone,
+ DNSEndpointTypeStandard,
+ }
+}
+
+// DefaultAction - Specifies the default action of allow or deny when no other rules match.
+type DefaultAction string
+
+const (
+ DefaultActionAllow DefaultAction = "Allow"
+ DefaultActionDeny DefaultAction = "Deny"
+)
+
+// PossibleDefaultActionValues returns the possible values for the DefaultAction const type.
+func PossibleDefaultActionValues() []DefaultAction {
+ return []DefaultAction{
+ DefaultActionAllow,
+ DefaultActionDeny,
+ }
+}
+
+// DefaultSharePermission - Default share permission for users using Kerberos authentication if RBAC role is not assigned.
+type DefaultSharePermission string
+
+const (
+ DefaultSharePermissionNone DefaultSharePermission = "None"
+ DefaultSharePermissionStorageFileDataSmbShareContributor DefaultSharePermission = "StorageFileDataSmbShareContributor"
+ DefaultSharePermissionStorageFileDataSmbShareElevatedContributor DefaultSharePermission = "StorageFileDataSmbShareElevatedContributor"
+ DefaultSharePermissionStorageFileDataSmbShareReader DefaultSharePermission = "StorageFileDataSmbShareReader"
+)
+
+// PossibleDefaultSharePermissionValues returns the possible values for the DefaultSharePermission const type.
+func PossibleDefaultSharePermissionValues() []DefaultSharePermission {
+ return []DefaultSharePermission{
+ DefaultSharePermissionNone,
+ DefaultSharePermissionStorageFileDataSmbShareContributor,
+ DefaultSharePermissionStorageFileDataSmbShareElevatedContributor,
+ DefaultSharePermissionStorageFileDataSmbShareReader,
+ }
+}
+
+// DirectoryServiceOptions - Indicates the directory service used. Note that this enum may be extended in the future.
+type DirectoryServiceOptions string
+
+const (
+ DirectoryServiceOptionsAADDS DirectoryServiceOptions = "AADDS"
+ DirectoryServiceOptionsAADKERB DirectoryServiceOptions = "AADKERB"
+ DirectoryServiceOptionsAD DirectoryServiceOptions = "AD"
+ DirectoryServiceOptionsNone DirectoryServiceOptions = "None"
+)
+
+// PossibleDirectoryServiceOptionsValues returns the possible values for the DirectoryServiceOptions const type.
+func PossibleDirectoryServiceOptionsValues() []DirectoryServiceOptions {
+ return []DirectoryServiceOptions{
+ DirectoryServiceOptionsAADDS,
+ DirectoryServiceOptionsAADKERB,
+ DirectoryServiceOptionsAD,
+ DirectoryServiceOptionsNone,
+ }
+}
+
+// EnabledProtocols - The authentication protocol that is used for the file share. Can only be specified when creating a share.
+type EnabledProtocols string
+
+const (
+ EnabledProtocolsNFS EnabledProtocols = "NFS"
+ EnabledProtocolsSMB EnabledProtocols = "SMB"
+)
+
+// PossibleEnabledProtocolsValues returns the possible values for the EnabledProtocols const type.
+func PossibleEnabledProtocolsValues() []EnabledProtocols {
+ return []EnabledProtocols{
+ EnabledProtocolsNFS,
+ EnabledProtocolsSMB,
+ }
+}
+
+// EncryptionScopeSource - The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault.
+type EncryptionScopeSource string
+
+const (
+ EncryptionScopeSourceMicrosoftKeyVault EncryptionScopeSource = "Microsoft.KeyVault"
+ EncryptionScopeSourceMicrosoftStorage EncryptionScopeSource = "Microsoft.Storage"
+)
+
+// PossibleEncryptionScopeSourceValues returns the possible values for the EncryptionScopeSource const type.
+func PossibleEncryptionScopeSourceValues() []EncryptionScopeSource {
+ return []EncryptionScopeSource{
+ EncryptionScopeSourceMicrosoftKeyVault,
+ EncryptionScopeSourceMicrosoftStorage,
+ }
+}
+
+// EncryptionScopeState - The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled.
+type EncryptionScopeState string
+
+const (
+ EncryptionScopeStateDisabled EncryptionScopeState = "Disabled"
+ EncryptionScopeStateEnabled EncryptionScopeState = "Enabled"
+)
+
+// PossibleEncryptionScopeStateValues returns the possible values for the EncryptionScopeState const type.
+func PossibleEncryptionScopeStateValues() []EncryptionScopeState {
+ return []EncryptionScopeState{
+ EncryptionScopeStateDisabled,
+ EncryptionScopeStateEnabled,
+ }
+}
+
+// ExpirationAction - The SAS expiration action. Can only be Log.
+type ExpirationAction string
+
+const (
+ ExpirationActionLog ExpirationAction = "Log"
+)
+
+// PossibleExpirationActionValues returns the possible values for the ExpirationAction const type.
+func PossibleExpirationActionValues() []ExpirationAction {
+ return []ExpirationAction{
+ ExpirationActionLog,
+ }
+}
+
+// ExtendedLocationTypes - The type of extendedLocation.
+type ExtendedLocationTypes string
+
+const (
+ ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone"
+)
+
+// PossibleExtendedLocationTypesValues returns the possible values for the ExtendedLocationTypes const type.
+func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes {
+ return []ExtendedLocationTypes{
+ ExtendedLocationTypesEdgeZone,
+ }
+}
+
+// Format - This is a required field, it specifies the format for the inventory files.
+type Format string
+
+const (
+ FormatCSV Format = "Csv"
+ FormatParquet Format = "Parquet"
+)
+
+// PossibleFormatValues returns the possible values for the Format const type.
+func PossibleFormatValues() []Format {
+ return []Format{
+ FormatCSV,
+ FormatParquet,
+ }
+}
+
+// GeoReplicationStatus - The status of the secondary location. Possible values are: - Live: Indicates that the secondary
+// location is active and operational. - Bootstrap: Indicates initial synchronization from the primary
+// location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable:
+// Indicates that the secondary location is temporarily unavailable.
+type GeoReplicationStatus string
+
+const (
+ GeoReplicationStatusBootstrap GeoReplicationStatus = "Bootstrap"
+ GeoReplicationStatusLive GeoReplicationStatus = "Live"
+ GeoReplicationStatusUnavailable GeoReplicationStatus = "Unavailable"
+)
+
+// PossibleGeoReplicationStatusValues returns the possible values for the GeoReplicationStatus const type.
+func PossibleGeoReplicationStatusValues() []GeoReplicationStatus {
+ return []GeoReplicationStatus{
+ GeoReplicationStatusBootstrap,
+ GeoReplicationStatusLive,
+ GeoReplicationStatusUnavailable,
+ }
+}
+
+// HTTPProtocol - The protocol permitted for a request made with the account SAS.
+type HTTPProtocol string
+
+const (
+ HTTPProtocolHTTPS HTTPProtocol = "https"
+ HTTPProtocolHTTPSHTTP HTTPProtocol = "https,http"
+)
+
+// PossibleHTTPProtocolValues returns the possible values for the HTTPProtocol const type.
+func PossibleHTTPProtocolValues() []HTTPProtocol {
+ return []HTTPProtocol{
+ HTTPProtocolHTTPS,
+ HTTPProtocolHTTPSHTTP,
+ }
+}
+
+// IdentityType - The identity type.
+type IdentityType string
+
+const (
+ IdentityTypeNone IdentityType = "None"
+ IdentityTypeSystemAssigned IdentityType = "SystemAssigned"
+ IdentityTypeSystemAssignedUserAssigned IdentityType = "SystemAssigned,UserAssigned"
+ IdentityTypeUserAssigned IdentityType = "UserAssigned"
+)
+
+// PossibleIdentityTypeValues returns the possible values for the IdentityType const type.
+func PossibleIdentityTypeValues() []IdentityType {
+ return []IdentityType{
+ IdentityTypeNone,
+ IdentityTypeSystemAssigned,
+ IdentityTypeSystemAssignedUserAssigned,
+ IdentityTypeUserAssigned,
+ }
+}
+
+// ImmutabilityPolicyState - The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.
+type ImmutabilityPolicyState string
+
+const (
+ ImmutabilityPolicyStateLocked ImmutabilityPolicyState = "Locked"
+ ImmutabilityPolicyStateUnlocked ImmutabilityPolicyState = "Unlocked"
+)
+
+// PossibleImmutabilityPolicyStateValues returns the possible values for the ImmutabilityPolicyState const type.
+func PossibleImmutabilityPolicyStateValues() []ImmutabilityPolicyState {
+ return []ImmutabilityPolicyState{
+ ImmutabilityPolicyStateLocked,
+ ImmutabilityPolicyStateUnlocked,
+ }
+}
+
+// ImmutabilityPolicyUpdateType - The ImmutabilityPolicy update type of a blob container, possible values include: put, lock
+// and extend.
+type ImmutabilityPolicyUpdateType string
+
+const (
+ ImmutabilityPolicyUpdateTypeExtend ImmutabilityPolicyUpdateType = "extend"
+ ImmutabilityPolicyUpdateTypeLock ImmutabilityPolicyUpdateType = "lock"
+ ImmutabilityPolicyUpdateTypePut ImmutabilityPolicyUpdateType = "put"
+)
+
+// PossibleImmutabilityPolicyUpdateTypeValues returns the possible values for the ImmutabilityPolicyUpdateType const type.
+func PossibleImmutabilityPolicyUpdateTypeValues() []ImmutabilityPolicyUpdateType {
+ return []ImmutabilityPolicyUpdateType{
+ ImmutabilityPolicyUpdateTypeExtend,
+ ImmutabilityPolicyUpdateTypeLock,
+ ImmutabilityPolicyUpdateTypePut,
+ }
+}
+
+// InventoryRuleType - The valid value is Inventory
+type InventoryRuleType string
+
+const (
+ InventoryRuleTypeInventory InventoryRuleType = "Inventory"
+)
+
+// PossibleInventoryRuleTypeValues returns the possible values for the InventoryRuleType const type.
+func PossibleInventoryRuleTypeValues() []InventoryRuleType {
+ return []InventoryRuleType{
+ InventoryRuleTypeInventory,
+ }
+}
+
+// KeyPermission - Permissions for the key -- read-only or full permissions.
+type KeyPermission string
+
+const (
+ KeyPermissionFull KeyPermission = "Full"
+ KeyPermissionRead KeyPermission = "Read"
+)
+
+// PossibleKeyPermissionValues returns the possible values for the KeyPermission const type.
+func PossibleKeyPermissionValues() []KeyPermission {
+ return []KeyPermission{
+ KeyPermissionFull,
+ KeyPermissionRead,
+ }
+}
+
+// KeySource - The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault
+type KeySource string
+
+const (
+ KeySourceMicrosoftKeyvault KeySource = "Microsoft.Keyvault"
+ KeySourceMicrosoftStorage KeySource = "Microsoft.Storage"
+)
+
+// PossibleKeySourceValues returns the possible values for the KeySource const type.
+func PossibleKeySourceValues() []KeySource {
+ return []KeySource{
+ KeySourceMicrosoftKeyvault,
+ KeySourceMicrosoftStorage,
+ }
+}
+
+// KeyType - Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped
+// encryption key will be used. 'Service' key type implies that a default service key is used.
+type KeyType string
+
+const (
+ KeyTypeAccount KeyType = "Account"
+ KeyTypeService KeyType = "Service"
+)
+
+// PossibleKeyTypeValues returns the possible values for the KeyType const type.
+func PossibleKeyTypeValues() []KeyType {
+ return []KeyType{
+ KeyTypeAccount,
+ KeyTypeService,
+ }
+}
+
+// Kind - Indicates the type of storage account.
+type Kind string
+
+const (
+ KindBlobStorage Kind = "BlobStorage"
+ KindBlockBlobStorage Kind = "BlockBlobStorage"
+ KindFileStorage Kind = "FileStorage"
+ KindStorage Kind = "Storage"
+ KindStorageV2 Kind = "StorageV2"
+)
+
+// PossibleKindValues returns the possible values for the Kind const type.
+func PossibleKindValues() []Kind {
+ return []Kind{
+ KindBlobStorage,
+ KindBlockBlobStorage,
+ KindFileStorage,
+ KindStorage,
+ KindStorageV2,
+ }
+}
+
+// LargeFileSharesState - Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.
+type LargeFileSharesState string
+
+const (
+ LargeFileSharesStateDisabled LargeFileSharesState = "Disabled"
+ LargeFileSharesStateEnabled LargeFileSharesState = "Enabled"
+)
+
+// PossibleLargeFileSharesStateValues returns the possible values for the LargeFileSharesState const type.
+func PossibleLargeFileSharesStateValues() []LargeFileSharesState {
+ return []LargeFileSharesState{
+ LargeFileSharesStateDisabled,
+ LargeFileSharesStateEnabled,
+ }
+}
+
+// LeaseContainerRequestAction - Specifies the lease action. Can be one of the available actions.
+type LeaseContainerRequestAction string
+
+const (
+ LeaseContainerRequestActionAcquire LeaseContainerRequestAction = "Acquire"
+ LeaseContainerRequestActionBreak LeaseContainerRequestAction = "Break"
+ LeaseContainerRequestActionChange LeaseContainerRequestAction = "Change"
+ LeaseContainerRequestActionRelease LeaseContainerRequestAction = "Release"
+ LeaseContainerRequestActionRenew LeaseContainerRequestAction = "Renew"
+)
+
+// PossibleLeaseContainerRequestActionValues returns the possible values for the LeaseContainerRequestAction const type.
+func PossibleLeaseContainerRequestActionValues() []LeaseContainerRequestAction {
+ return []LeaseContainerRequestAction{
+ LeaseContainerRequestActionAcquire,
+ LeaseContainerRequestActionBreak,
+ LeaseContainerRequestActionChange,
+ LeaseContainerRequestActionRelease,
+ LeaseContainerRequestActionRenew,
+ }
+}
+
+// LeaseDuration - Specifies whether the lease on a container is of infinite or fixed duration, only when the container is
+// leased.
+type LeaseDuration string
+
+const (
+ LeaseDurationFixed LeaseDuration = "Fixed"
+ LeaseDurationInfinite LeaseDuration = "Infinite"
+)
+
+// PossibleLeaseDurationValues returns the possible values for the LeaseDuration const type.
+func PossibleLeaseDurationValues() []LeaseDuration {
+ return []LeaseDuration{
+ LeaseDurationFixed,
+ LeaseDurationInfinite,
+ }
+}
+
+// LeaseShareAction - Specifies the lease action. Can be one of the available actions.
+type LeaseShareAction string
+
+const (
+ LeaseShareActionAcquire LeaseShareAction = "Acquire"
+ LeaseShareActionBreak LeaseShareAction = "Break"
+ LeaseShareActionChange LeaseShareAction = "Change"
+ LeaseShareActionRelease LeaseShareAction = "Release"
+ LeaseShareActionRenew LeaseShareAction = "Renew"
+)
+
+// PossibleLeaseShareActionValues returns the possible values for the LeaseShareAction const type.
+func PossibleLeaseShareActionValues() []LeaseShareAction {
+ return []LeaseShareAction{
+ LeaseShareActionAcquire,
+ LeaseShareActionBreak,
+ LeaseShareActionChange,
+ LeaseShareActionRelease,
+ LeaseShareActionRenew,
+ }
+}
+
+// LeaseState - Lease state of the container.
+type LeaseState string
+
+const (
+ LeaseStateAvailable LeaseState = "Available"
+ LeaseStateBreaking LeaseState = "Breaking"
+ LeaseStateBroken LeaseState = "Broken"
+ LeaseStateExpired LeaseState = "Expired"
+ LeaseStateLeased LeaseState = "Leased"
+)
+
+// PossibleLeaseStateValues returns the possible values for the LeaseState const type.
+func PossibleLeaseStateValues() []LeaseState {
+ return []LeaseState{
+ LeaseStateAvailable,
+ LeaseStateBreaking,
+ LeaseStateBroken,
+ LeaseStateExpired,
+ LeaseStateLeased,
+ }
+}
+
+// LeaseStatus - The lease status of the container.
+type LeaseStatus string
+
+const (
+ LeaseStatusLocked LeaseStatus = "Locked"
+ LeaseStatusUnlocked LeaseStatus = "Unlocked"
+)
+
+// PossibleLeaseStatusValues returns the possible values for the LeaseStatus const type.
+func PossibleLeaseStatusValues() []LeaseStatus {
+ return []LeaseStatus{
+ LeaseStatusLocked,
+ LeaseStatusUnlocked,
+ }
+}
+
+type ListContainersInclude string
+
+const (
+ ListContainersIncludeDeleted ListContainersInclude = "deleted"
+)
+
+// PossibleListContainersIncludeValues returns the possible values for the ListContainersInclude const type.
+func PossibleListContainersIncludeValues() []ListContainersInclude {
+ return []ListContainersInclude{
+ ListContainersIncludeDeleted,
+ }
+}
+
+type ListEncryptionScopesInclude string
+
+const (
+ ListEncryptionScopesIncludeAll ListEncryptionScopesInclude = "All"
+ ListEncryptionScopesIncludeDisabled ListEncryptionScopesInclude = "Disabled"
+ ListEncryptionScopesIncludeEnabled ListEncryptionScopesInclude = "Enabled"
+)
+
+// PossibleListEncryptionScopesIncludeValues returns the possible values for the ListEncryptionScopesInclude const type.
+func PossibleListEncryptionScopesIncludeValues() []ListEncryptionScopesInclude {
+ return []ListEncryptionScopesInclude{
+ ListEncryptionScopesIncludeAll,
+ ListEncryptionScopesIncludeDisabled,
+ ListEncryptionScopesIncludeEnabled,
+ }
+}
+
+type ManagementPolicyName string
+
+const (
+ ManagementPolicyNameDefault ManagementPolicyName = "default"
+)
+
+// PossibleManagementPolicyNameValues returns the possible values for the ManagementPolicyName const type.
+func PossibleManagementPolicyNameValues() []ManagementPolicyName {
+ return []ManagementPolicyName{
+ ManagementPolicyNameDefault,
+ }
+}
+
+type MigrationName string
+
+const (
+ MigrationNameDefault MigrationName = "default"
+)
+
+// PossibleMigrationNameValues returns the possible values for the MigrationName const type.
+func PossibleMigrationNameValues() []MigrationName {
+ return []MigrationName{
+ MigrationNameDefault,
+ }
+}
+
+// MigrationState - This property denotes the container level immutability to object level immutability migration state.
+type MigrationState string
+
+const (
+ MigrationStateCompleted MigrationState = "Completed"
+ MigrationStateInProgress MigrationState = "InProgress"
+)
+
+// PossibleMigrationStateValues returns the possible values for the MigrationState const type.
+func PossibleMigrationStateValues() []MigrationState {
+ return []MigrationState{
+ MigrationStateCompleted,
+ MigrationStateInProgress,
+ }
+}
+
+// MigrationStatus - Current status of migration
+type MigrationStatus string
+
+const (
+ MigrationStatusComplete MigrationStatus = "Complete"
+ MigrationStatusFailed MigrationStatus = "Failed"
+ MigrationStatusInProgress MigrationStatus = "InProgress"
+ MigrationStatusInvalid MigrationStatus = "Invalid"
+ MigrationStatusSubmittedForConversion MigrationStatus = "SubmittedForConversion"
+)
+
+// PossibleMigrationStatusValues returns the possible values for the MigrationStatus const type.
+func PossibleMigrationStatusValues() []MigrationStatus {
+ return []MigrationStatus{
+ MigrationStatusComplete,
+ MigrationStatusFailed,
+ MigrationStatusInProgress,
+ MigrationStatusInvalid,
+ MigrationStatusSubmittedForConversion,
+ }
+}
+
+// MinimumTLSVersion - Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS
+// 1.0 for this property.
+type MinimumTLSVersion string
+
+const (
+ MinimumTLSVersionTLS10 MinimumTLSVersion = "TLS1_0"
+ MinimumTLSVersionTLS11 MinimumTLSVersion = "TLS1_1"
+ MinimumTLSVersionTLS12 MinimumTLSVersion = "TLS1_2"
+)
+
+// PossibleMinimumTLSVersionValues returns the possible values for the MinimumTLSVersion const type.
+func PossibleMinimumTLSVersionValues() []MinimumTLSVersion {
+ return []MinimumTLSVersion{
+ MinimumTLSVersionTLS10,
+ MinimumTLSVersionTLS11,
+ MinimumTLSVersionTLS12,
+ }
+}
+
+// Name - Name of the policy. The valid value is AccessTimeTracking. This field is currently read only
+type Name string
+
+const (
+ NameAccessTimeTracking Name = "AccessTimeTracking"
+)
+
+// PossibleNameValues returns the possible values for the Name const type.
+func PossibleNameValues() []Name {
+ return []Name{
+ NameAccessTimeTracking,
+ }
+}
+
+// ObjectType - This is a required field. This field specifies the scope of the inventory created either at the blob or container
+// level.
+type ObjectType string
+
+const (
+ ObjectTypeBlob ObjectType = "Blob"
+ ObjectTypeContainer ObjectType = "Container"
+)
+
+// PossibleObjectTypeValues returns the possible values for the ObjectType const type.
+func PossibleObjectTypeValues() []ObjectType {
+ return []ObjectType{
+ ObjectTypeBlob,
+ ObjectTypeContainer,
+ }
+}
+
+// Permissions - The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List
+// (l), Add (a), Create (c), Update (u) and Process (p).
+type Permissions string
+
+const (
+ PermissionsA Permissions = "a"
+ PermissionsC Permissions = "c"
+ PermissionsD Permissions = "d"
+ PermissionsL Permissions = "l"
+ PermissionsP Permissions = "p"
+ PermissionsR Permissions = "r"
+ PermissionsU Permissions = "u"
+ PermissionsW Permissions = "w"
+)
+
+// PossiblePermissionsValues returns the possible values for the Permissions const type.
+func PossiblePermissionsValues() []Permissions {
+ return []Permissions{
+ PermissionsA,
+ PermissionsC,
+ PermissionsD,
+ PermissionsL,
+ PermissionsP,
+ PermissionsR,
+ PermissionsU,
+ PermissionsW,
+ }
+}
+
+// PostFailoverRedundancy - The redundancy type of the account after an account failover is performed.
+type PostFailoverRedundancy string
+
+const (
+ PostFailoverRedundancyStandardLRS PostFailoverRedundancy = "Standard_LRS"
+ PostFailoverRedundancyStandardZRS PostFailoverRedundancy = "Standard_ZRS"
+)
+
+// PossiblePostFailoverRedundancyValues returns the possible values for the PostFailoverRedundancy const type.
+func PossiblePostFailoverRedundancyValues() []PostFailoverRedundancy {
+ return []PostFailoverRedundancy{
+ PostFailoverRedundancyStandardLRS,
+ PostFailoverRedundancyStandardZRS,
+ }
+}
+
+// PostPlannedFailoverRedundancy - The redundancy type of the account after a planned account failover is performed.
+type PostPlannedFailoverRedundancy string
+
+const (
+ PostPlannedFailoverRedundancyStandardGRS PostPlannedFailoverRedundancy = "Standard_GRS"
+ PostPlannedFailoverRedundancyStandardGZRS PostPlannedFailoverRedundancy = "Standard_GZRS"
+ PostPlannedFailoverRedundancyStandardRAGRS PostPlannedFailoverRedundancy = "Standard_RAGRS"
+ PostPlannedFailoverRedundancyStandardRAGZRS PostPlannedFailoverRedundancy = "Standard_RAGZRS"
+)
+
+// PossiblePostPlannedFailoverRedundancyValues returns the possible values for the PostPlannedFailoverRedundancy const type.
+func PossiblePostPlannedFailoverRedundancyValues() []PostPlannedFailoverRedundancy {
+ return []PostPlannedFailoverRedundancy{
+ PostPlannedFailoverRedundancyStandardGRS,
+ PostPlannedFailoverRedundancyStandardGZRS,
+ PostPlannedFailoverRedundancyStandardRAGRS,
+ PostPlannedFailoverRedundancyStandardRAGZRS,
+ }
+}
+
+// PrivateEndpointConnectionProvisioningState - The current provisioning state.
+type PrivateEndpointConnectionProvisioningState string
+
+const (
+ PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating"
+ PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting"
+ PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed"
+ PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded"
+)
+
+// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type.
+func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {
+ return []PrivateEndpointConnectionProvisioningState{
+ PrivateEndpointConnectionProvisioningStateCreating,
+ PrivateEndpointConnectionProvisioningStateDeleting,
+ PrivateEndpointConnectionProvisioningStateFailed,
+ PrivateEndpointConnectionProvisioningStateSucceeded,
+ }
+}
+
+// PrivateEndpointServiceConnectionStatus - The private endpoint connection status.
+type PrivateEndpointServiceConnectionStatus string
+
+const (
+ PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved"
+ PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending"
+ PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected"
+)
+
+// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type.
+func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus {
+ return []PrivateEndpointServiceConnectionStatus{
+ PrivateEndpointServiceConnectionStatusApproved,
+ PrivateEndpointServiceConnectionStatusPending,
+ PrivateEndpointServiceConnectionStatusRejected,
+ }
+}
+
+// ProvisioningState - Gets the status of the storage account at the time the operation was called.
+type ProvisioningState string
+
+const (
+ ProvisioningStateCreating ProvisioningState = "Creating"
+ ProvisioningStateResolvingDNS ProvisioningState = "ResolvingDNS"
+ ProvisioningStateSucceeded ProvisioningState = "Succeeded"
+)
+
+// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
+func PossibleProvisioningStateValues() []ProvisioningState {
+ return []ProvisioningState{
+ ProvisioningStateCreating,
+ ProvisioningStateResolvingDNS,
+ ProvisioningStateSucceeded,
+ }
+}
+
+// PublicAccess - Specifies whether data in the container may be accessed publicly and the level of access.
+type PublicAccess string
+
+const (
+ PublicAccessBlob PublicAccess = "Blob"
+ PublicAccessContainer PublicAccess = "Container"
+ PublicAccessNone PublicAccess = "None"
+)
+
+// PossiblePublicAccessValues returns the possible values for the PublicAccess const type.
+func PossiblePublicAccessValues() []PublicAccess {
+ return []PublicAccess{
+ PublicAccessBlob,
+ PublicAccessContainer,
+ PublicAccessNone,
+ }
+}
+
+// PublicNetworkAccess - Allow or disallow public network access to Storage Account. Value is optional but if passed in, must
+// be 'Enabled' or 'Disabled'.
+type PublicNetworkAccess string
+
+const (
+ PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled"
+ PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled"
+)
+
+// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type.
+func PossiblePublicNetworkAccessValues() []PublicNetworkAccess {
+ return []PublicNetworkAccess{
+ PublicNetworkAccessDisabled,
+ PublicNetworkAccessEnabled,
+ }
+}
+
+// Reason - Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable
+// is false.
+type Reason string
+
+const (
+ ReasonAccountNameInvalid Reason = "AccountNameInvalid"
+ ReasonAlreadyExists Reason = "AlreadyExists"
+)
+
+// PossibleReasonValues returns the possible values for the Reason const type.
+func PossibleReasonValues() []Reason {
+ return []Reason{
+ ReasonAccountNameInvalid,
+ ReasonAlreadyExists,
+ }
+}
+
+// ReasonCode - The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id
+// is set when the SKU has requiredQuotas parameter as the subscription does not belong to that
+// quota. The "NotAvailableForSubscription" is related to capacity at DC.
+type ReasonCode string
+
+const (
+ ReasonCodeNotAvailableForSubscription ReasonCode = "NotAvailableForSubscription"
+ ReasonCodeQuotaID ReasonCode = "QuotaId"
+)
+
+// PossibleReasonCodeValues returns the possible values for the ReasonCode const type.
+func PossibleReasonCodeValues() []ReasonCode {
+ return []ReasonCode{
+ ReasonCodeNotAvailableForSubscription,
+ ReasonCodeQuotaID,
+ }
+}
+
+// RootSquashType - The property is for NFS share only. The default is NoRootSquash.
+type RootSquashType string
+
+const (
+ RootSquashTypeAllSquash RootSquashType = "AllSquash"
+ RootSquashTypeNoRootSquash RootSquashType = "NoRootSquash"
+ RootSquashTypeRootSquash RootSquashType = "RootSquash"
+)
+
+// PossibleRootSquashTypeValues returns the possible values for the RootSquashType const type.
+func PossibleRootSquashTypeValues() []RootSquashType {
+ return []RootSquashType{
+ RootSquashTypeAllSquash,
+ RootSquashTypeNoRootSquash,
+ RootSquashTypeRootSquash,
+ }
+}
+
+// RoutingChoice - Routing Choice defines the kind of network routing opted by the user.
+type RoutingChoice string
+
+const (
+ RoutingChoiceInternetRouting RoutingChoice = "InternetRouting"
+ RoutingChoiceMicrosoftRouting RoutingChoice = "MicrosoftRouting"
+)
+
+// PossibleRoutingChoiceValues returns the possible values for the RoutingChoice const type.
+func PossibleRoutingChoiceValues() []RoutingChoice {
+ return []RoutingChoice{
+ RoutingChoiceInternetRouting,
+ RoutingChoiceMicrosoftRouting,
+ }
+}
+
+// RuleType - The valid value is Lifecycle
+type RuleType string
+
+const (
+ RuleTypeLifecycle RuleType = "Lifecycle"
+)
+
+// PossibleRuleTypeValues returns the possible values for the RuleType const type.
+func PossibleRuleTypeValues() []RuleType {
+ return []RuleType{
+ RuleTypeLifecycle,
+ }
+}
+
+// SKUConversionStatus - This property indicates the current sku conversion status.
+type SKUConversionStatus string
+
+const (
+ SKUConversionStatusFailed SKUConversionStatus = "Failed"
+ SKUConversionStatusInProgress SKUConversionStatus = "InProgress"
+ SKUConversionStatusSucceeded SKUConversionStatus = "Succeeded"
+)
+
+// PossibleSKUConversionStatusValues returns the possible values for the SKUConversionStatus const type.
+func PossibleSKUConversionStatusValues() []SKUConversionStatus {
+ return []SKUConversionStatus{
+ SKUConversionStatusFailed,
+ SKUConversionStatusInProgress,
+ SKUConversionStatusSucceeded,
+ }
+}
+
+// SKUName - The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called
+// accountType.
+type SKUName string
+
+const (
+ SKUNamePremiumLRS SKUName = "Premium_LRS"
+ SKUNamePremiumZRS SKUName = "Premium_ZRS"
+ SKUNameStandardGRS SKUName = "Standard_GRS"
+ SKUNameStandardGZRS SKUName = "Standard_GZRS"
+ SKUNameStandardLRS SKUName = "Standard_LRS"
+ SKUNameStandardRAGRS SKUName = "Standard_RAGRS"
+ SKUNameStandardRAGZRS SKUName = "Standard_RAGZRS"
+ SKUNameStandardZRS SKUName = "Standard_ZRS"
+)
+
+// PossibleSKUNameValues returns the possible values for the SKUName const type.
+func PossibleSKUNameValues() []SKUName {
+ return []SKUName{
+ SKUNamePremiumLRS,
+ SKUNamePremiumZRS,
+ SKUNameStandardGRS,
+ SKUNameStandardGZRS,
+ SKUNameStandardLRS,
+ SKUNameStandardRAGRS,
+ SKUNameStandardRAGZRS,
+ SKUNameStandardZRS,
+ }
+}
+
+// SKUTier - The SKU tier. This is based on the SKU name.
+type SKUTier string
+
+const (
+ SKUTierPremium SKUTier = "Premium"
+ SKUTierStandard SKUTier = "Standard"
+)
+
+// PossibleSKUTierValues returns the possible values for the SKUTier const type.
+func PossibleSKUTierValues() []SKUTier {
+ return []SKUTier{
+ SKUTierPremium,
+ SKUTierStandard,
+ }
+}
+
+// Schedule - This is a required field. This field is used to schedule an inventory formation.
+type Schedule string
+
+const (
+ ScheduleDaily Schedule = "Daily"
+ ScheduleWeekly Schedule = "Weekly"
+)
+
+// PossibleScheduleValues returns the possible values for the Schedule const type.
+func PossibleScheduleValues() []Schedule {
+ return []Schedule{
+ ScheduleDaily,
+ ScheduleWeekly,
+ }
+}
+
+// Services - The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t),
+// File (f).
+type Services string
+
+const (
+ ServicesB Services = "b"
+ ServicesF Services = "f"
+ ServicesQ Services = "q"
+ ServicesT Services = "t"
+)
+
+// PossibleServicesValues returns the possible values for the Services const type.
+func PossibleServicesValues() []Services {
+ return []Services{
+ ServicesB,
+ ServicesF,
+ ServicesQ,
+ ServicesT,
+ }
+}
+
+// ShareAccessTier - Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot,
+// and Cool. FileStorage account can choose Premium.
+type ShareAccessTier string
+
+const (
+ ShareAccessTierCool ShareAccessTier = "Cool"
+ ShareAccessTierHot ShareAccessTier = "Hot"
+ ShareAccessTierPremium ShareAccessTier = "Premium"
+ ShareAccessTierTransactionOptimized ShareAccessTier = "TransactionOptimized"
+)
+
+// PossibleShareAccessTierValues returns the possible values for the ShareAccessTier const type.
+func PossibleShareAccessTierValues() []ShareAccessTier {
+ return []ShareAccessTier{
+ ShareAccessTierCool,
+ ShareAccessTierHot,
+ ShareAccessTierPremium,
+ ShareAccessTierTransactionOptimized,
+ }
+}
+
+// SignedResource - The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c),
+// File (f), Share (s).
+type SignedResource string
+
+const (
+ SignedResourceB SignedResource = "b"
+ SignedResourceC SignedResource = "c"
+ SignedResourceF SignedResource = "f"
+ SignedResourceS SignedResource = "s"
+)
+
+// PossibleSignedResourceValues returns the possible values for the SignedResource const type.
+func PossibleSignedResourceValues() []SignedResource {
+ return []SignedResource{
+ SignedResourceB,
+ SignedResourceC,
+ SignedResourceF,
+ SignedResourceS,
+ }
+}
+
+// SignedResourceTypes - The signed resource types that are accessible with the account SAS. Service (s): Access to service-level
+// APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs
+// for blobs, queue messages, table entities, and files.
+type SignedResourceTypes string
+
+const (
+ SignedResourceTypesC SignedResourceTypes = "c"
+ SignedResourceTypesO SignedResourceTypes = "o"
+ SignedResourceTypesS SignedResourceTypes = "s"
+)
+
+// PossibleSignedResourceTypesValues returns the possible values for the SignedResourceTypes const type.
+func PossibleSignedResourceTypesValues() []SignedResourceTypes {
+ return []SignedResourceTypes{
+ SignedResourceTypesC,
+ SignedResourceTypesO,
+ SignedResourceTypesS,
+ }
+}
+
+// State - Gets the state of virtual network rule.
+type State string
+
+const (
+ StateDeprovisioning State = "Deprovisioning"
+ StateFailed State = "Failed"
+ StateNetworkSourceDeleted State = "NetworkSourceDeleted"
+ StateProvisioning State = "Provisioning"
+ StateSucceeded State = "Succeeded"
+)
+
+// PossibleStateValues returns the possible values for the State const type.
+func PossibleStateValues() []State {
+ return []State{
+ StateDeprovisioning,
+ StateFailed,
+ StateNetworkSourceDeleted,
+ StateProvisioning,
+ StateSucceeded,
+ }
+}
+
+type StorageAccountExpand string
+
+const (
+ StorageAccountExpandBlobRestoreStatus StorageAccountExpand = "blobRestoreStatus"
+ StorageAccountExpandGeoReplicationStats StorageAccountExpand = "geoReplicationStats"
+)
+
+// PossibleStorageAccountExpandValues returns the possible values for the StorageAccountExpand const type.
+func PossibleStorageAccountExpandValues() []StorageAccountExpand {
+ return []StorageAccountExpand{
+ StorageAccountExpandBlobRestoreStatus,
+ StorageAccountExpandGeoReplicationStats,
+ }
+}
+
+// UsageUnit - Gets the unit of measurement.
+type UsageUnit string
+
+const (
+ UsageUnitBytes UsageUnit = "Bytes"
+ UsageUnitBytesPerSecond UsageUnit = "BytesPerSecond"
+ UsageUnitCount UsageUnit = "Count"
+ UsageUnitCountsPerSecond UsageUnit = "CountsPerSecond"
+ UsageUnitPercent UsageUnit = "Percent"
+ UsageUnitSeconds UsageUnit = "Seconds"
+)
+
+// PossibleUsageUnitValues returns the possible values for the UsageUnit const type.
+func PossibleUsageUnitValues() []UsageUnit {
+ return []UsageUnit{
+ UsageUnitBytes,
+ UsageUnitBytesPerSecond,
+ UsageUnitCount,
+ UsageUnitCountsPerSecond,
+ UsageUnitPercent,
+ UsageUnitSeconds,
+ }
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/deletedaccounts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/deletedaccounts_client.go
new file mode 100644
index 000000000..438fc77ee
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/deletedaccounts_client.go
@@ -0,0 +1,163 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// DeletedAccountsClient contains the methods for the DeletedAccounts group.
+// Don't use this type directly, use NewDeletedAccountsClient() instead.
+type DeletedAccountsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewDeletedAccountsClient creates a new instance of DeletedAccountsClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewDeletedAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeletedAccountsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &DeletedAccountsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Get properties of specified deleted account resource.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - deletedAccountName - Name of the deleted storage account.
+// - location - The location of the deleted storage account.
+// - options - DeletedAccountsClientGetOptions contains the optional parameters for the DeletedAccountsClient.Get method.
+func (client *DeletedAccountsClient) Get(ctx context.Context, deletedAccountName string, location string, options *DeletedAccountsClientGetOptions) (DeletedAccountsClientGetResponse, error) {
+ var err error
+ const operationName = "DeletedAccountsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, deletedAccountName, location, options)
+ if err != nil {
+ return DeletedAccountsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return DeletedAccountsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return DeletedAccountsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *DeletedAccountsClient) getCreateRequest(ctx context.Context, deletedAccountName string, location string, options *DeletedAccountsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}"
+ if deletedAccountName == "" {
+ return nil, errors.New("parameter deletedAccountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{deletedAccountName}", url.PathEscape(deletedAccountName))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *DeletedAccountsClient) getHandleResponse(resp *http.Response) (DeletedAccountsClientGetResponse, error) {
+ result := DeletedAccountsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeletedAccount); err != nil {
+ return DeletedAccountsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists deleted accounts under the subscription.
+//
+// Generated from API version 2023-01-01
+// - options - DeletedAccountsClientListOptions contains the optional parameters for the DeletedAccountsClient.NewListPager
+// method.
+func (client *DeletedAccountsClient) NewListPager(options *DeletedAccountsClientListOptions) *runtime.Pager[DeletedAccountsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[DeletedAccountsClientListResponse]{
+ More: func(page DeletedAccountsClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *DeletedAccountsClientListResponse) (DeletedAccountsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeletedAccountsClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, options)
+ }, nil)
+ if err != nil {
+ return DeletedAccountsClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *DeletedAccountsClient) listCreateRequest(ctx context.Context, options *DeletedAccountsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *DeletedAccountsClient) listHandleResponse(resp *http.Response) (DeletedAccountsClientListResponse, error) {
+ result := DeletedAccountsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.DeletedAccountListResult); err != nil {
+ return DeletedAccountsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/encryptionscopes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/encryptionscopes_client.go
new file mode 100644
index 000000000..1aaa4eaf0
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/encryptionscopes_client.go
@@ -0,0 +1,347 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// EncryptionScopesClient contains the methods for the EncryptionScopes group.
+// Don't use this type directly, use NewEncryptionScopesClient() instead.
+type EncryptionScopesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewEncryptionScopesClient creates a new instance of EncryptionScopesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewEncryptionScopesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EncryptionScopesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &EncryptionScopesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Get - Returns the properties for the specified encryption scope.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - encryptionScopeName - The name of the encryption scope within the specified storage account. Encryption scope names must
+// be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - options - EncryptionScopesClientGetOptions contains the optional parameters for the EncryptionScopesClient.Get method.
+func (client *EncryptionScopesClient) Get(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, options *EncryptionScopesClientGetOptions) (EncryptionScopesClientGetResponse, error) {
+ var err error
+ const operationName = "EncryptionScopesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, encryptionScopeName, options)
+ if err != nil {
+ return EncryptionScopesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return EncryptionScopesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return EncryptionScopesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *EncryptionScopesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, options *EncryptionScopesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if encryptionScopeName == "" {
+ return nil, errors.New("parameter encryptionScopeName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{encryptionScopeName}", url.PathEscape(encryptionScopeName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *EncryptionScopesClient) getHandleResponse(resp *http.Response) (EncryptionScopesClientGetResponse, error) {
+ result := EncryptionScopesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.EncryptionScope); err != nil {
+ return EncryptionScopesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists all the encryption scopes available under the specified storage account.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - EncryptionScopesClientListOptions contains the optional parameters for the EncryptionScopesClient.NewListPager
+// method.
+func (client *EncryptionScopesClient) NewListPager(resourceGroupName string, accountName string, options *EncryptionScopesClientListOptions) *runtime.Pager[EncryptionScopesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[EncryptionScopesClientListResponse]{
+ More: func(page EncryptionScopesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *EncryptionScopesClientListResponse) (EncryptionScopesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "EncryptionScopesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return EncryptionScopesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *EncryptionScopesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *EncryptionScopesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10))
+ }
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Include != nil {
+ reqQP.Set("$include", string(*options.Include))
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *EncryptionScopesClient) listHandleResponse(resp *http.Response) (EncryptionScopesClientListResponse, error) {
+ result := EncryptionScopesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.EncryptionScopeListResult); err != nil {
+ return EncryptionScopesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// Patch - Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope
+// does not already exist.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - encryptionScopeName - The name of the encryption scope within the specified storage account. Encryption scope names must
+// be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - encryptionScope - Encryption scope properties to be used for the update.
+// - options - EncryptionScopesClientPatchOptions contains the optional parameters for the EncryptionScopesClient.Patch method.
+func (client *EncryptionScopesClient) Patch(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, options *EncryptionScopesClientPatchOptions) (EncryptionScopesClientPatchResponse, error) {
+ var err error
+ const operationName = "EncryptionScopesClient.Patch"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.patchCreateRequest(ctx, resourceGroupName, accountName, encryptionScopeName, encryptionScope, options)
+ if err != nil {
+ return EncryptionScopesClientPatchResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return EncryptionScopesClientPatchResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return EncryptionScopesClientPatchResponse{}, err
+ }
+ resp, err := client.patchHandleResponse(httpResp)
+ return resp, err
+}
+
+// patchCreateRequest creates the Patch request.
+func (client *EncryptionScopesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, options *EncryptionScopesClientPatchOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if encryptionScopeName == "" {
+ return nil, errors.New("parameter encryptionScopeName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{encryptionScopeName}", url.PathEscape(encryptionScopeName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, encryptionScope); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// patchHandleResponse handles the Patch response.
+func (client *EncryptionScopesClient) patchHandleResponse(resp *http.Response) (EncryptionScopesClientPatchResponse, error) {
+ result := EncryptionScopesClientPatchResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.EncryptionScope); err != nil {
+ return EncryptionScopesClientPatchResponse{}, err
+ }
+ return result, nil
+}
+
+// Put - Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope
+// is already created and a subsequent request is issued with different properties, the
+// encryption scope properties will be updated per the specified request.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - encryptionScopeName - The name of the encryption scope within the specified storage account. Encryption scope names must
+// be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
+// dash (-) character must be immediately preceded and followed by a letter or number.
+// - encryptionScope - Encryption scope properties to be used for the create or update.
+// - options - EncryptionScopesClientPutOptions contains the optional parameters for the EncryptionScopesClient.Put method.
+func (client *EncryptionScopesClient) Put(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, options *EncryptionScopesClientPutOptions) (EncryptionScopesClientPutResponse, error) {
+ var err error
+ const operationName = "EncryptionScopesClient.Put"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.putCreateRequest(ctx, resourceGroupName, accountName, encryptionScopeName, encryptionScope, options)
+ if err != nil {
+ return EncryptionScopesClientPutResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return EncryptionScopesClientPutResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return EncryptionScopesClientPutResponse{}, err
+ }
+ resp, err := client.putHandleResponse(httpResp)
+ return resp, err
+}
+
+// putCreateRequest creates the Put request.
+func (client *EncryptionScopesClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, options *EncryptionScopesClientPutOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if encryptionScopeName == "" {
+ return nil, errors.New("parameter encryptionScopeName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{encryptionScopeName}", url.PathEscape(encryptionScopeName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, encryptionScope); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// putHandleResponse handles the Put response.
+func (client *EncryptionScopesClient) putHandleResponse(resp *http.Response) (EncryptionScopesClientPutResponse, error) {
+ result := EncryptionScopesClientPutResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.EncryptionScope); err != nil {
+ return EncryptionScopesClientPutResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileservices_client.go
new file mode 100644
index 000000000..238ba98c8
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileservices_client.go
@@ -0,0 +1,249 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// FileServicesClient contains the methods for the FileServices group.
+// Don't use this type directly, use NewFileServicesClient() instead.
+type FileServicesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewFileServicesClient creates a new instance of FileServicesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewFileServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FileServicesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &FileServicesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// GetServiceProperties - Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
+// Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - FileServicesClientGetServicePropertiesOptions contains the optional parameters for the FileServicesClient.GetServiceProperties
+// method.
+func (client *FileServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientGetServicePropertiesOptions) (FileServicesClientGetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "FileServicesClient.GetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return FileServicesClientGetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileServicesClientGetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileServicesClientGetServicePropertiesResponse{}, err
+ }
+ resp, err := client.getServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// getServicePropertiesCreateRequest creates the GetServiceProperties request.
+func (client *FileServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{FileServicesName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getServicePropertiesHandleResponse handles the GetServiceProperties response.
+func (client *FileServicesClient) getServicePropertiesHandleResponse(resp *http.Response) (FileServicesClientGetServicePropertiesResponse, error) {
+ result := FileServicesClientGetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceProperties); err != nil {
+ return FileServicesClientGetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
+
+// List - List all file services in storage accounts
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - FileServicesClientListOptions contains the optional parameters for the FileServicesClient.List method.
+func (client *FileServicesClient) List(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientListOptions) (FileServicesClientListResponse, error) {
+ var err error
+ const operationName = "FileServicesClient.List"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return FileServicesClientListResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileServicesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileServicesClientListResponse{}, err
+ }
+ resp, err := client.listHandleResponse(httpResp)
+ return resp, err
+}
+
+// listCreateRequest creates the List request.
+func (client *FileServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *FileServicesClient) listHandleResponse(resp *http.Response) (FileServicesClientListResponse, error) {
+ result := FileServicesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceItems); err != nil {
+ return FileServicesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// SetServiceProperties - Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource
+// Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules.
+// - options - FileServicesClientSetServicePropertiesOptions contains the optional parameters for the FileServicesClient.SetServiceProperties
+// method.
+func (client *FileServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters FileServiceProperties, options *FileServicesClientSetServicePropertiesOptions) (FileServicesClientSetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "FileServicesClient.SetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.setServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return FileServicesClientSetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileServicesClientSetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileServicesClientSetServicePropertiesResponse{}, err
+ }
+ resp, err := client.setServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// setServicePropertiesCreateRequest creates the SetServiceProperties request.
+func (client *FileServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters FileServiceProperties, options *FileServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{FileServicesName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// setServicePropertiesHandleResponse handles the SetServiceProperties response.
+func (client *FileServicesClient) setServicePropertiesHandleResponse(resp *http.Response) (FileServicesClientSetServicePropertiesResponse, error) {
+ result := FileServicesClientSetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceProperties); err != nil {
+ return FileServicesClientSetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileshares_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileshares_client.go
new file mode 100644
index 000000000..df9e8df21
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileshares_client.go
@@ -0,0 +1,572 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// FileSharesClient contains the methods for the FileShares group.
+// Don't use this type directly, use NewFileSharesClient() instead.
+type FileSharesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewFileSharesClient creates a new instance of FileSharesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewFileSharesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FileSharesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &FileSharesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Create - Creates a new share under the specified account as described by request body. The share resource includes metadata
+// and properties for that share. It does not include a list of the files contained by
+// the share.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - fileShare - Properties of the file share to create.
+// - options - FileSharesClientCreateOptions contains the optional parameters for the FileSharesClient.Create method.
+func (client *FileSharesClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, options *FileSharesClientCreateOptions) (FileSharesClientCreateResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Create"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, shareName, fileShare, options)
+ if err != nil {
+ return FileSharesClientCreateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientCreateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientCreateResponse{}, err
+ }
+ resp, err := client.createHandleResponse(httpResp)
+ return resp, err
+}
+
+// createCreateRequest creates the Create request.
+func (client *FileSharesClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, options *FileSharesClientCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, fileShare); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createHandleResponse handles the Create response.
+func (client *FileSharesClient) createHandleResponse(resp *http.Response) (FileSharesClientCreateResponse, error) {
+ result := FileSharesClientCreateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileShare); err != nil {
+ return FileSharesClientCreateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes specified share under its account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - options - FileSharesClientDeleteOptions contains the optional parameters for the FileSharesClient.Delete method.
+func (client *FileSharesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientDeleteOptions) (FileSharesClientDeleteResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, shareName, options)
+ if err != nil {
+ return FileSharesClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientDeleteResponse{}, err
+ }
+ return FileSharesClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *FileSharesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ if options != nil && options.Include != nil {
+ reqQP.Set("$include", *options.Include)
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ if options != nil && options.XMSSnapshot != nil {
+ req.Raw().Header["x-ms-snapshot"] = []string{*options.XMSSnapshot}
+ }
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets properties of a specified share.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - options - FileSharesClientGetOptions contains the optional parameters for the FileSharesClient.Get method.
+func (client *FileSharesClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientGetOptions) (FileSharesClientGetResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, shareName, options)
+ if err != nil {
+ return FileSharesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *FileSharesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ if options != nil && options.XMSSnapshot != nil {
+ req.Raw().Header["x-ms-snapshot"] = []string{*options.XMSSnapshot}
+ }
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *FileSharesClient) getHandleResponse(resp *http.Response) (FileSharesClientGetResponse, error) {
+ result := FileSharesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileShare); err != nil {
+ return FileSharesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// Lease - The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can
+// be 15 to 60 seconds, or can be infinite.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - options - FileSharesClientLeaseOptions contains the optional parameters for the FileSharesClient.Lease method.
+func (client *FileSharesClient) Lease(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientLeaseOptions) (FileSharesClientLeaseResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Lease"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.leaseCreateRequest(ctx, resourceGroupName, accountName, shareName, options)
+ if err != nil {
+ return FileSharesClientLeaseResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientLeaseResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientLeaseResponse{}, err
+ }
+ resp, err := client.leaseHandleResponse(httpResp)
+ return resp, err
+}
+
+// leaseCreateRequest creates the Lease request.
+func (client *FileSharesClient) leaseCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, options *FileSharesClientLeaseOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ if options != nil && options.XMSSnapshot != nil {
+ req.Raw().Header["x-ms-snapshot"] = []string{*options.XMSSnapshot}
+ }
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// leaseHandleResponse handles the Lease response.
+func (client *FileSharesClient) leaseHandleResponse(resp *http.Response) (FileSharesClientLeaseResponse, error) {
+ result := FileSharesClientLeaseResponse{}
+ if val := resp.Header.Get("ETag"); val != "" {
+ result.ETag = &val
+ }
+ if err := runtime.UnmarshalAsJSON(resp, &result.LeaseShareResponse); err != nil {
+ return FileSharesClientLeaseResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Lists all shares.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - FileSharesClientListOptions contains the optional parameters for the FileSharesClient.NewListPager method.
+func (client *FileSharesClient) NewListPager(resourceGroupName string, accountName string, options *FileSharesClientListOptions) *runtime.Pager[FileSharesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[FileSharesClientListResponse]{
+ More: func(page FileSharesClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *FileSharesClientListResponse) (FileSharesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FileSharesClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return FileSharesClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *FileSharesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *FileSharesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", *options.Maxpagesize)
+ }
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ if options != nil && options.Expand != nil {
+ reqQP.Set("$expand", *options.Expand)
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *FileSharesClient) listHandleResponse(resp *http.Response) (FileSharesClientListResponse, error) {
+ result := FileSharesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileShareItems); err != nil {
+ return FileSharesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// Restore - Restore a file share within a valid retention days if share soft delete is enabled
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - options - FileSharesClientRestoreOptions contains the optional parameters for the FileSharesClient.Restore method.
+func (client *FileSharesClient) Restore(ctx context.Context, resourceGroupName string, accountName string, shareName string, deletedShare DeletedShare, options *FileSharesClientRestoreOptions) (FileSharesClientRestoreResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Restore"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.restoreCreateRequest(ctx, resourceGroupName, accountName, shareName, deletedShare, options)
+ if err != nil {
+ return FileSharesClientRestoreResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientRestoreResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientRestoreResponse{}, err
+ }
+ return FileSharesClientRestoreResponse{}, nil
+}
+
+// restoreCreateRequest creates the Restore request.
+func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, deletedShare DeletedShare, options *FileSharesClientRestoreOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, deletedShare); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// Update - Updates share properties as specified in request body. Properties not mentioned in the request will not be changed.
+// Update fails if the specified share does not already exist.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - shareName - The name of the file share within the specified storage account. File share names must be between 3 and 63
+// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
+// character must be immediately preceded and followed by a letter or number.
+// - fileShare - Properties to update for the file share.
+// - options - FileSharesClientUpdateOptions contains the optional parameters for the FileSharesClient.Update method.
+func (client *FileSharesClient) Update(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, options *FileSharesClientUpdateOptions) (FileSharesClientUpdateResponse, error) {
+ var err error
+ const operationName = "FileSharesClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, shareName, fileShare, options)
+ if err != nil {
+ return FileSharesClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return FileSharesClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return FileSharesClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *FileSharesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, options *FileSharesClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if shareName == "" {
+ return nil, errors.New("parameter shareName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{shareName}", url.PathEscape(shareName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, fileShare); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *FileSharesClient) updateHandleResponse(resp *http.Response) (FileSharesClientUpdateResponse, error) {
+ result := FileSharesClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.FileShare); err != nil {
+ return FileSharesClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/localusers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/localusers_client.go
new file mode 100644
index 000000000..614a876e4
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/localusers_client.go
@@ -0,0 +1,461 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// LocalUsersClient contains the methods for the LocalUsers group.
+// Don't use this type directly, use NewLocalUsersClient() instead.
+type LocalUsersClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewLocalUsersClient creates a new instance of LocalUsersClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewLocalUsersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocalUsersClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &LocalUsersClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Create or update the properties of a local user associated with the storage account
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - username - The name of local user. The username must contain lowercase letters and numbers only. It must be unique only
+// within the storage account.
+// - properties - The local user associated with a storage account.
+// - options - LocalUsersClientCreateOrUpdateOptions contains the optional parameters for the LocalUsersClient.CreateOrUpdate
+// method.
+func (client *LocalUsersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, username string, properties LocalUser, options *LocalUsersClientCreateOrUpdateOptions) (LocalUsersClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "LocalUsersClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, username, properties, options)
+ if err != nil {
+ return LocalUsersClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return LocalUsersClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *LocalUsersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, properties LocalUser, options *LocalUsersClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if username == "" {
+ return nil, errors.New("parameter username cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{username}", url.PathEscape(username))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *LocalUsersClient) createOrUpdateHandleResponse(resp *http.Response) (LocalUsersClientCreateOrUpdateResponse, error) {
+ result := LocalUsersClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LocalUser); err != nil {
+ return LocalUsersClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the local user associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - username - The name of local user. The username must contain lowercase letters and numbers only. It must be unique only
+// within the storage account.
+// - options - LocalUsersClientDeleteOptions contains the optional parameters for the LocalUsersClient.Delete method.
+func (client *LocalUsersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientDeleteOptions) (LocalUsersClientDeleteResponse, error) {
+ var err error
+ const operationName = "LocalUsersClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, username, options)
+ if err != nil {
+ return LocalUsersClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return LocalUsersClientDeleteResponse{}, err
+ }
+ return LocalUsersClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if username == "" {
+ return nil, errors.New("parameter username cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{username}", url.PathEscape(username))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Get the local user of the storage account by username.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - username - The name of local user. The username must contain lowercase letters and numbers only. It must be unique only
+// within the storage account.
+// - options - LocalUsersClientGetOptions contains the optional parameters for the LocalUsersClient.Get method.
+func (client *LocalUsersClient) Get(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientGetOptions) (LocalUsersClientGetResponse, error) {
+ var err error
+ const operationName = "LocalUsersClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, username, options)
+ if err != nil {
+ return LocalUsersClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return LocalUsersClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *LocalUsersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if username == "" {
+ return nil, errors.New("parameter username cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{username}", url.PathEscape(username))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *LocalUsersClient) getHandleResponse(resp *http.Response) (LocalUsersClientGetResponse, error) {
+ result := LocalUsersClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LocalUser); err != nil {
+ return LocalUsersClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List the local users associated with the storage account.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - LocalUsersClientListOptions contains the optional parameters for the LocalUsersClient.NewListPager method.
+func (client *LocalUsersClient) NewListPager(resourceGroupName string, accountName string, options *LocalUsersClientListOptions) *runtime.Pager[LocalUsersClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[LocalUsersClientListResponse]{
+ More: func(page LocalUsersClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *LocalUsersClientListResponse) (LocalUsersClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LocalUsersClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return LocalUsersClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return LocalUsersClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *LocalUsersClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *LocalUsersClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *LocalUsersClient) listHandleResponse(resp *http.Response) (LocalUsersClientListResponse, error) {
+ result := LocalUsersClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LocalUsers); err != nil {
+ return LocalUsersClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// ListKeys - List SSH authorized keys and shared key of the local user.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - username - The name of local user. The username must contain lowercase letters and numbers only. It must be unique only
+// within the storage account.
+// - options - LocalUsersClientListKeysOptions contains the optional parameters for the LocalUsersClient.ListKeys method.
+func (client *LocalUsersClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientListKeysOptions) (LocalUsersClientListKeysResponse, error) {
+ var err error
+ const operationName = "LocalUsersClient.ListKeys"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listKeysCreateRequest(ctx, resourceGroupName, accountName, username, options)
+ if err != nil {
+ return LocalUsersClientListKeysResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientListKeysResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return LocalUsersClientListKeysResponse{}, err
+ }
+ resp, err := client.listKeysHandleResponse(httpResp)
+ return resp, err
+}
+
+// listKeysCreateRequest creates the ListKeys request.
+func (client *LocalUsersClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientListKeysOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/listKeys"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if username == "" {
+ return nil, errors.New("parameter username cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{username}", url.PathEscape(username))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listKeysHandleResponse handles the ListKeys response.
+func (client *LocalUsersClient) listKeysHandleResponse(resp *http.Response) (LocalUsersClientListKeysResponse, error) {
+ result := LocalUsersClientListKeysResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LocalUserKeys); err != nil {
+ return LocalUsersClientListKeysResponse{}, err
+ }
+ return result, nil
+}
+
+// RegeneratePassword - Regenerate the local user SSH password.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - username - The name of local user. The username must contain lowercase letters and numbers only. It must be unique only
+// within the storage account.
+// - options - LocalUsersClientRegeneratePasswordOptions contains the optional parameters for the LocalUsersClient.RegeneratePassword
+// method.
+func (client *LocalUsersClient) RegeneratePassword(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientRegeneratePasswordOptions) (LocalUsersClientRegeneratePasswordResponse, error) {
+ var err error
+ const operationName = "LocalUsersClient.RegeneratePassword"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.regeneratePasswordCreateRequest(ctx, resourceGroupName, accountName, username, options)
+ if err != nil {
+ return LocalUsersClientRegeneratePasswordResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return LocalUsersClientRegeneratePasswordResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return LocalUsersClientRegeneratePasswordResponse{}, err
+ }
+ resp, err := client.regeneratePasswordHandleResponse(httpResp)
+ return resp, err
+}
+
+// regeneratePasswordCreateRequest creates the RegeneratePassword request.
+func (client *LocalUsersClient) regeneratePasswordCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientRegeneratePasswordOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if username == "" {
+ return nil, errors.New("parameter username cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{username}", url.PathEscape(username))
+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// regeneratePasswordHandleResponse handles the RegeneratePassword response.
+func (client *LocalUsersClient) regeneratePasswordHandleResponse(resp *http.Response) (LocalUsersClientRegeneratePasswordResponse, error) {
+ result := LocalUsersClientRegeneratePasswordResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.LocalUserRegeneratePasswordResult); err != nil {
+ return LocalUsersClientRegeneratePasswordResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/managementpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/managementpolicies_client.go
new file mode 100644
index 000000000..4f3f96365
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/managementpolicies_client.go
@@ -0,0 +1,249 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// ManagementPoliciesClient contains the methods for the ManagementPolicies group.
+// Don't use this type directly, use NewManagementPoliciesClient() instead.
+type ManagementPoliciesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewManagementPoliciesClient creates a new instance of ManagementPoliciesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewManagementPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementPoliciesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &ManagementPoliciesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Sets the managementpolicy to the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - managementPolicyName - The name of the Storage Account Management Policy. It should always be 'default'
+// - properties - The ManagementPolicy set to a storage account.
+// - options - ManagementPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ManagementPoliciesClient.CreateOrUpdate
+// method.
+func (client *ManagementPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, properties ManagementPolicy, options *ManagementPoliciesClientCreateOrUpdateOptions) (ManagementPoliciesClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "ManagementPoliciesClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, managementPolicyName, properties, options)
+ if err != nil {
+ return ManagementPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ManagementPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ManagementPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *ManagementPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, properties ManagementPolicy, options *ManagementPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if managementPolicyName == "" {
+ return nil, errors.New("parameter managementPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{managementPolicyName}", url.PathEscape(string(managementPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *ManagementPoliciesClient) createOrUpdateHandleResponse(resp *http.Response) (ManagementPoliciesClientCreateOrUpdateResponse, error) {
+ result := ManagementPoliciesClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ManagementPolicy); err != nil {
+ return ManagementPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the managementpolicy associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - managementPolicyName - The name of the Storage Account Management Policy. It should always be 'default'
+// - options - ManagementPoliciesClientDeleteOptions contains the optional parameters for the ManagementPoliciesClient.Delete
+// method.
+func (client *ManagementPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, options *ManagementPoliciesClientDeleteOptions) (ManagementPoliciesClientDeleteResponse, error) {
+ var err error
+ const operationName = "ManagementPoliciesClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, managementPolicyName, options)
+ if err != nil {
+ return ManagementPoliciesClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ManagementPoliciesClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return ManagementPoliciesClientDeleteResponse{}, err
+ }
+ return ManagementPoliciesClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *ManagementPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, options *ManagementPoliciesClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if managementPolicyName == "" {
+ return nil, errors.New("parameter managementPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{managementPolicyName}", url.PathEscape(string(managementPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ return req, nil
+}
+
+// Get - Gets the managementpolicy associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - managementPolicyName - The name of the Storage Account Management Policy. It should always be 'default'
+// - options - ManagementPoliciesClientGetOptions contains the optional parameters for the ManagementPoliciesClient.Get method.
+func (client *ManagementPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, options *ManagementPoliciesClientGetOptions) (ManagementPoliciesClientGetResponse, error) {
+ var err error
+ const operationName = "ManagementPoliciesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, managementPolicyName, options)
+ if err != nil {
+ return ManagementPoliciesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ManagementPoliciesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ManagementPoliciesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *ManagementPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, options *ManagementPoliciesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if managementPolicyName == "" {
+ return nil, errors.New("parameter managementPolicyName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{managementPolicyName}", url.PathEscape(string(managementPolicyName)))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *ManagementPoliciesClient) getHandleResponse(resp *http.Response) (ManagementPoliciesClientGetResponse, error) {
+ result := ManagementPoliciesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ManagementPolicy); err != nil {
+ return ManagementPoliciesClientGetResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models.go
new file mode 100644
index 000000000..3a9b23aab
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models.go
@@ -0,0 +1,2832 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import "time"
+
+type AccessPolicy struct {
+ // Expiry time of the access policy
+ ExpiryTime *time.Time
+
+ // List of abbreviated permissions.
+ Permission *string
+
+ // Start time of the access policy
+ StartTime *time.Time
+}
+
+// Account - The storage account.
+type Account struct {
+ // REQUIRED; The geo-location where the resource lives
+ Location *string
+
+ // The extendedLocation of the resource.
+ ExtendedLocation *ExtendedLocation
+
+ // The identity of the resource.
+ Identity *Identity
+
+ // Properties of the storage account.
+ Properties *AccountProperties
+
+ // Resource tags.
+ Tags map[string]*string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; Gets the Kind.
+ Kind *Kind
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Gets the SKU.
+ SKU *SKU
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// AccountCheckNameAvailabilityParameters - The parameters used to check the availability of the storage account name.
+type AccountCheckNameAvailabilityParameters struct {
+ // REQUIRED; The storage account name.
+ Name *string
+
+ // CONSTANT; The type of resource, Microsoft.Storage/storageAccounts
+ // Field has constant value "Microsoft.Storage/storageAccounts", any specified value is ignored.
+ Type *string
+}
+
+// AccountCreateParameters - The parameters used when creating a storage account.
+type AccountCreateParameters struct {
+ // REQUIRED; Required. Indicates the type of storage account.
+ Kind *Kind
+
+ // REQUIRED; Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo
+ // Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource
+ // cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed.
+ Location *string
+
+ // REQUIRED; Required. Gets or sets the SKU name.
+ SKU *SKU
+
+ // Optional. Set the extended location of the resource. If not set, the storage account will be created in Azure main region.
+ // Otherwise it will be created in the specified extended location
+ ExtendedLocation *ExtendedLocation
+
+ // The identity of the resource.
+ Identity *Identity
+
+ // The parameters used to create the storage account.
+ Properties *AccountPropertiesCreateParameters
+
+ // Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this
+ // resource (across resource groups). A maximum of 15 tags can be provided for a
+ // resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than
+ // 256 characters.
+ Tags map[string]*string
+}
+
+// AccountImmutabilityPolicyProperties - This defines account-level immutability policy properties.
+type AccountImmutabilityPolicyProperties struct {
+ // This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can
+ // be written to an append blob while maintaining immutability protection and
+ // compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.
+ AllowProtectedAppendWrites *bool
+
+ // The immutability period for the blobs in the container since the policy creation, in days.
+ ImmutabilityPeriodSinceCreationInDays *int32
+
+ // The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows
+ // increase and decrease of immutability retention time and also allows toggling
+ // allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy
+ // can only be created in a Disabled or Unlocked state and can be toggled between
+ // the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.
+ State *AccountImmutabilityPolicyState
+}
+
+// AccountInternetEndpoints - The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via
+// a internet routing endpoint.
+type AccountInternetEndpoints struct {
+ // READ-ONLY; Gets the blob endpoint.
+ Blob *string
+
+ // READ-ONLY; Gets the dfs endpoint.
+ Dfs *string
+
+ // READ-ONLY; Gets the file endpoint.
+ File *string
+
+ // READ-ONLY; Gets the web endpoint.
+ Web *string
+}
+
+// AccountKey - An access key for the storage account.
+type AccountKey struct {
+ // READ-ONLY; Creation time of the key, in round trip date format.
+ CreationTime *time.Time
+
+ // READ-ONLY; Name of the key.
+ KeyName *string
+
+ // READ-ONLY; Permissions for the key -- read-only or full permissions.
+ Permissions *KeyPermission
+
+ // READ-ONLY; Base 64-encoded value of the key.
+ Value *string
+}
+
+// AccountListKeysResult - The response from the ListKeys operation.
+type AccountListKeysResult struct {
+ // READ-ONLY; Gets the list of storage account keys and their properties for the specified storage account.
+ Keys []*AccountKey
+}
+
+// AccountListResult - The response from the List Storage Accounts operation.
+type AccountListResult struct {
+ // READ-ONLY; Request URL that can be used to query next page of storage accounts. Returned when total number of requested
+ // storage accounts exceed maximum page size.
+ NextLink *string
+
+ // READ-ONLY; Gets the list of storage accounts and their properties.
+ Value []*Account
+}
+
+// AccountMicrosoftEndpoints - The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object
+// via a microsoft routing endpoint.
+type AccountMicrosoftEndpoints struct {
+ // READ-ONLY; Gets the blob endpoint.
+ Blob *string
+
+ // READ-ONLY; Gets the dfs endpoint.
+ Dfs *string
+
+ // READ-ONLY; Gets the file endpoint.
+ File *string
+
+ // READ-ONLY; Gets the queue endpoint.
+ Queue *string
+
+ // READ-ONLY; Gets the table endpoint.
+ Table *string
+
+ // READ-ONLY; Gets the web endpoint.
+ Web *string
+}
+
+// AccountMigration - The parameters or status associated with an ongoing or enqueued storage account migration in order to
+// update its current SKU or region.
+type AccountMigration struct {
+ // REQUIRED; The properties of a storage account’s ongoing or enqueued migration.
+ StorageAccountMigrationDetails *AccountMigrationProperties
+
+ // current value is 'default' for customer initiated migration
+ Name *string
+
+ // SrpAccountMigrationType in ARM contract which is 'accountMigrations'
+ Type *string
+
+ // READ-ONLY; Migration Resource Id
+ ID *string
+}
+
+// AccountMigrationProperties - The properties of a storage account’s ongoing or enqueued migration.
+type AccountMigrationProperties struct {
+ // REQUIRED; Target sku name for the account
+ TargetSKUName *SKUName
+
+ // READ-ONLY; Reason for migration failure
+ MigrationFailedDetailedReason *string
+
+ // READ-ONLY; Error code for migration failure
+ MigrationFailedReason *string
+
+ // READ-ONLY; Current status of migration
+ MigrationStatus *MigrationStatus
+}
+
+// AccountProperties - Properties of the storage account.
+type AccountProperties struct {
+ // Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false
+ // for this property.
+ AllowBlobPublicAccess *bool
+
+ // Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object
+ // replication policies will involve storage accounts in different AAD
+ // tenants. The default interpretation is false for new accounts to follow best security practices by default.
+ AllowCrossTenantReplication *bool
+
+ // Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If
+ // false, then all requests, including shared access signatures, must be authorized
+ // with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.
+ AllowSharedKeyAccess *bool
+
+ // Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.
+ AllowedCopyScope *AllowedCopyScope
+
+ // Provides the identity based authentication settings for Azure Files.
+ AzureFilesIdentityBasedAuthentication *AzureFilesIdentityBasedAuthentication
+
+ // Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription,
+ // which creates accounts in an Azure DNS Zone and the endpoint URL
+ // will have an alphanumeric DNS Zone identifier.
+ DNSEndpointType *DNSEndpointType
+
+ // A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false
+ // for this property.
+ DefaultToOAuthAuthentication *bool
+
+ // Allows https traffic only to storage service if sets to true.
+ EnableHTTPSTrafficOnly *bool
+
+ // NFS 3.0 protocol support enabled if set to true.
+ EnableNfsV3 *bool
+
+ // The property is immutable and can only be set to true at the account creation time. When set to true, it enables object
+ // level immutability for all the containers in the account by default.
+ ImmutableStorageWithVersioning *ImmutableStorageAccount
+
+ // Account HierarchicalNamespace enabled if sets to true.
+ IsHnsEnabled *bool
+
+ // Enables local users feature, if set to true
+ IsLocalUserEnabled *bool
+
+ // Enables Secure File Transfer Protocol, if set to true
+ IsSftpEnabled *bool
+
+ // Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.
+ LargeFileSharesState *LargeFileSharesState
+
+ // Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.
+ MinimumTLSVersion *MinimumTLSVersion
+
+ // Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.
+ PublicNetworkAccess *PublicNetworkAccess
+
+ // Maintains information about the network routing choice opted by the user for data transfer
+ RoutingPreference *RoutingPreference
+
+ // This property is readOnly and is set by server during asynchronous storage account sku conversion operations.
+ StorageAccountSKUConversionStatus *AccountSKUConversionStatus
+
+ // READ-ONLY; Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access
+ // tier is the default value for premium block blobs storage account type and it cannot
+ // be changed for the premium block blobs storage account type.
+ AccessTier *AccessTier
+
+ // READ-ONLY; If customer initiated account migration is in progress, the value will be true else it will be null.
+ AccountMigrationInProgress *bool
+
+ // READ-ONLY; Blob restore status
+ BlobRestoreStatus *BlobRestoreStatus
+
+ // READ-ONLY; Gets the creation date and time of the storage account in UTC.
+ CreationTime *time.Time
+
+ // READ-ONLY; Gets the custom domain the user assigned to this storage account.
+ CustomDomain *CustomDomain
+
+ // READ-ONLY; Encryption settings to be used for server-side encryption for the storage account.
+ Encryption *Encryption
+
+ // READ-ONLY; If the failover is in progress, the value will be true, otherwise, it will be null.
+ FailoverInProgress *bool
+
+ // READ-ONLY; Geo Replication Stats
+ GeoReplicationStats *GeoReplicationStats
+
+ // READ-ONLY; This property will be set to true or false on an event of ongoing migration. Default value is null.
+ IsSKUConversionBlocked *bool
+
+ // READ-ONLY; Storage account keys creation time.
+ KeyCreationTime *KeyCreationTime
+
+ // READ-ONLY; KeyPolicy assigned to the storage account.
+ KeyPolicy *KeyPolicy
+
+ // READ-ONLY; Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent
+ // timestamp is retained. This element is not returned if there has never been a failover
+ // instance. Only available if the accountType is StandardGRS or StandardRAGRS.
+ LastGeoFailoverTime *time.Time
+
+ // READ-ONLY; Network rule set
+ NetworkRuleSet *NetworkRuleSet
+
+ // READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that StandardZRS
+ // and PremiumLRS accounts only return the blob endpoint.
+ PrimaryEndpoints *Endpoints
+
+ // READ-ONLY; Gets the location of the primary data center for the storage account.
+ PrimaryLocation *string
+
+ // READ-ONLY; List of private endpoint connection associated with the specified storage account
+ PrivateEndpointConnections []*PrivateEndpointConnection
+
+ // READ-ONLY; Gets the status of the storage account at the time the operation was called.
+ ProvisioningState *ProvisioningState
+
+ // READ-ONLY; SasPolicy assigned to the storage account.
+ SasPolicy *SasPolicy
+
+ // READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary
+ // location of the storage account. Only available if the SKU name is Standard_RAGRS.
+ SecondaryEndpoints *Endpoints
+
+ // READ-ONLY; Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType
+ // is StandardGRS or StandardRAGRS.
+ SecondaryLocation *string
+
+ // READ-ONLY; Gets the status indicating whether the primary location of the storage account is available or unavailable.
+ StatusOfPrimary *AccountStatus
+
+ // READ-ONLY; Gets the status indicating whether the secondary location of the storage account is available or unavailable.
+ // Only available if the SKU name is StandardGRS or StandardRAGRS.
+ StatusOfSecondary *AccountStatus
+}
+
+// AccountPropertiesCreateParameters - The parameters used to create the storage account.
+type AccountPropertiesCreateParameters struct {
+ // Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier
+ // is the default value for premium block blobs storage account type and it cannot
+ // be changed for the premium block blobs storage account type.
+ AccessTier *AccessTier
+
+ // Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false
+ // for this property.
+ AllowBlobPublicAccess *bool
+
+ // Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object
+ // replication policies will involve storage accounts in different AAD
+ // tenants. The default interpretation is false for new accounts to follow best security practices by default.
+ AllowCrossTenantReplication *bool
+
+ // Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If
+ // false, then all requests, including shared access signatures, must be authorized
+ // with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.
+ AllowSharedKeyAccess *bool
+
+ // Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.
+ AllowedCopyScope *AllowedCopyScope
+
+ // Provides the identity based authentication settings for Azure Files.
+ AzureFilesIdentityBasedAuthentication *AzureFilesIdentityBasedAuthentication
+
+ // User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage
+ // account at this time. To clear the existing custom domain, use an empty string
+ // for the custom domain name property.
+ CustomDomain *CustomDomain
+
+ // Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription,
+ // which creates accounts in an Azure DNS Zone and the endpoint URL
+ // will have an alphanumeric DNS Zone identifier.
+ DNSEndpointType *DNSEndpointType
+
+ // A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false
+ // for this property.
+ DefaultToOAuthAuthentication *bool
+
+ // Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01.
+ EnableHTTPSTrafficOnly *bool
+
+ // NFS 3.0 protocol support enabled if set to true.
+ EnableNfsV3 *bool
+
+ // Encryption settings to be used for server-side encryption for the storage account.
+ Encryption *Encryption
+
+ // The property is immutable and can only be set to true at the account creation time. When set to true, it enables object
+ // level immutability for all the new containers in the account by default.
+ ImmutableStorageWithVersioning *ImmutableStorageAccount
+
+ // Account HierarchicalNamespace enabled if sets to true.
+ IsHnsEnabled *bool
+
+ // Enables local users feature, if set to true
+ IsLocalUserEnabled *bool
+
+ // Enables Secure File Transfer Protocol, if set to true
+ IsSftpEnabled *bool
+
+ // KeyPolicy assigned to the storage account.
+ KeyPolicy *KeyPolicy
+
+ // Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.
+ LargeFileSharesState *LargeFileSharesState
+
+ // Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.
+ MinimumTLSVersion *MinimumTLSVersion
+
+ // Network rule set
+ NetworkRuleSet *NetworkRuleSet
+
+ // Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.
+ PublicNetworkAccess *PublicNetworkAccess
+
+ // Maintains information about the network routing choice opted by the user for data transfer
+ RoutingPreference *RoutingPreference
+
+ // SasPolicy assigned to the storage account.
+ SasPolicy *SasPolicy
+}
+
+// AccountPropertiesUpdateParameters - The parameters used when updating a storage account.
+type AccountPropertiesUpdateParameters struct {
+ // Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier
+ // is the default value for premium block blobs storage account type and it cannot
+ // be changed for the premium block blobs storage account type.
+ AccessTier *AccessTier
+
+ // Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is false
+ // for this property.
+ AllowBlobPublicAccess *bool
+
+ // Allow or disallow cross AAD tenant object replication. Set this property to true for new or existing accounts only if object
+ // replication policies will involve storage accounts in different AAD
+ // tenants. The default interpretation is false for new accounts to follow best security practices by default.
+ AllowCrossTenantReplication *bool
+
+ // Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If
+ // false, then all requests, including shared access signatures, must be authorized
+ // with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.
+ AllowSharedKeyAccess *bool
+
+ // Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.
+ AllowedCopyScope *AllowedCopyScope
+
+ // Provides the identity based authentication settings for Azure Files.
+ AzureFilesIdentityBasedAuthentication *AzureFilesIdentityBasedAuthentication
+
+ // Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported
+ // per storage account at this time. To clear the existing custom domain, use an
+ // empty string for the custom domain name property.
+ CustomDomain *CustomDomain
+
+ // Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription,
+ // which creates accounts in an Azure DNS Zone and the endpoint URL
+ // will have an alphanumeric DNS Zone identifier.
+ DNSEndpointType *DNSEndpointType
+
+ // A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false
+ // for this property.
+ DefaultToOAuthAuthentication *bool
+
+ // Allows https traffic only to storage service if sets to true.
+ EnableHTTPSTrafficOnly *bool
+
+ // Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled.
+ Encryption *Encryption
+
+ // The property is immutable and can only be set to true at the account creation time. When set to true, it enables object
+ // level immutability for all the containers in the account by default.
+ ImmutableStorageWithVersioning *ImmutableStorageAccount
+
+ // Enables local users feature, if set to true
+ IsLocalUserEnabled *bool
+
+ // Enables Secure File Transfer Protocol, if set to true
+ IsSftpEnabled *bool
+
+ // KeyPolicy assigned to the storage account.
+ KeyPolicy *KeyPolicy
+
+ // Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.
+ LargeFileSharesState *LargeFileSharesState
+
+ // Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.
+ MinimumTLSVersion *MinimumTLSVersion
+
+ // Network rule set
+ NetworkRuleSet *NetworkRuleSet
+
+ // Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.
+ PublicNetworkAccess *PublicNetworkAccess
+
+ // Maintains information about the network routing choice opted by the user for data transfer
+ RoutingPreference *RoutingPreference
+
+ // SasPolicy assigned to the storage account.
+ SasPolicy *SasPolicy
+}
+
+// AccountRegenerateKeyParameters - The parameters used to regenerate the storage account key.
+type AccountRegenerateKeyParameters struct {
+ // REQUIRED; The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2.
+ KeyName *string
+}
+
+// AccountSKUConversionStatus - This defines the sku conversion status object for asynchronous sku conversions.
+type AccountSKUConversionStatus struct {
+ // This property represents the target sku name to which the account sku is being converted asynchronously.
+ TargetSKUName *SKUName
+
+ // READ-ONLY; This property represents the sku conversion end time.
+ EndTime *string
+
+ // READ-ONLY; This property indicates the current sku conversion status.
+ SKUConversionStatus *SKUConversionStatus
+
+ // READ-ONLY; This property represents the sku conversion start time.
+ StartTime *string
+}
+
+// AccountSasParameters - The parameters to list SAS credentials of a storage account.
+type AccountSasParameters struct {
+ // REQUIRED; The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l),
+ // Add (a), Create (c), Update (u) and Process (p).
+ Permissions *Permissions
+
+ // REQUIRED; The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs;
+ // Container (c): Access to container-level APIs; Object (o): Access to object-level APIs
+ // for blobs, queue messages, table entities, and files.
+ ResourceTypes *SignedResourceTypes
+
+ // REQUIRED; The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t),
+ // File (f).
+ Services *Services
+
+ // REQUIRED; The time at which the shared access signature becomes invalid.
+ SharedAccessExpiryTime *time.Time
+
+ // An IP address or a range of IP addresses from which to accept requests.
+ IPAddressOrRange *string
+
+ // The key to sign the account SAS token with.
+ KeyToSign *string
+
+ // The protocol permitted for a request made with the account SAS.
+ Protocols *HTTPProtocol
+
+ // The time at which the SAS becomes valid.
+ SharedAccessStartTime *time.Time
+}
+
+// AccountUpdateParameters - The parameters that can be provided when updating the storage account properties.
+type AccountUpdateParameters struct {
+ // The identity of the resource.
+ Identity *Identity
+
+ // Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server.
+ Kind *Kind
+
+ // The parameters used when updating a storage account.
+ Properties *AccountPropertiesUpdateParameters
+
+ // Gets or sets the SKU name. Note that the SKU name cannot be updated to StandardZRS, PremiumLRS or Premium_ZRS, nor can
+ // accounts of those SKU names be updated to any other value.
+ SKU *SKU
+
+ // Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this
+ // resource (across resource groups). A maximum of 15 tags can be provided for a
+ // resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.
+ Tags map[string]*string
+}
+
+// ActiveDirectoryProperties - Settings properties for Active Directory (AD).
+type ActiveDirectoryProperties struct {
+ // REQUIRED; Specifies the domain GUID.
+ DomainGUID *string
+
+ // REQUIRED; Specifies the primary domain that the AD DNS server is authoritative for.
+ DomainName *string
+
+ // Specifies the Active Directory account type for Azure Storage.
+ AccountType *ActiveDirectoryPropertiesAccountType
+
+ // Specifies the security identifier (SID) for Azure Storage.
+ AzureStorageSid *string
+
+ // Specifies the security identifier (SID).
+ DomainSid *string
+
+ // Specifies the Active Directory forest to get.
+ ForestName *string
+
+ // Specifies the NetBIOS domain name.
+ NetBiosDomainName *string
+
+ // Specifies the Active Directory SAMAccountName for Azure Storage.
+ SamAccountName *string
+}
+
+// AzureEntityResource - The resource model definition for an Azure Resource Manager resource with an etag.
+type AzureEntityResource struct {
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// AzureFilesIdentityBasedAuthentication - Settings for Azure Files identity based authentication.
+type AzureFilesIdentityBasedAuthentication struct {
+ // REQUIRED; Indicates the directory service used. Note that this enum may be extended in the future.
+ DirectoryServiceOptions *DirectoryServiceOptions
+
+ // Required if directoryServiceOptions are AD, optional if they are AADKERB.
+ ActiveDirectoryProperties *ActiveDirectoryProperties
+
+ // Default share permission for users using Kerberos authentication if RBAC role is not assigned.
+ DefaultSharePermission *DefaultSharePermission
+}
+
+// BlobContainer - Properties of the blob container, including Id, resource name, resource type, Etag.
+type BlobContainer struct {
+ // Properties of the blob container.
+ ContainerProperties *ContainerProperties
+
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// BlobInventoryCreationTime - This property defines the creation time based filtering condition. Blob Inventory schema parameter
+// 'Creation-Time' is mandatory with this filter.
+type BlobInventoryCreationTime struct {
+ // When set the policy filters the objects that are created in the last N days. Where N is an integer value between 1 to 36500.
+ LastNDays *int32
+}
+
+// BlobInventoryPolicy - The storage account blob inventory policy.
+type BlobInventoryPolicy struct {
+ // Returns the storage account blob inventory policy rules.
+ Properties *BlobInventoryPolicyProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// BlobInventoryPolicyDefinition - An object that defines the blob inventory rule.
+type BlobInventoryPolicyDefinition struct {
+ // REQUIRED; This is a required field, it specifies the format for the inventory files.
+ Format *Format
+
+ // REQUIRED; This is a required field. This field specifies the scope of the inventory created either at the blob or container
+ // level.
+ ObjectType *ObjectType
+
+ // REQUIRED; This is a required field. This field is used to schedule an inventory formation.
+ Schedule *Schedule
+
+ // REQUIRED; This is a required field. This field specifies the fields and properties of the object to be included in the
+ // inventory. The Schema field value 'Name' is always required. The valid values for this
+ // field for the 'Blob' definition.objectType include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType,
+ // AccessTier, AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time,
+ // hdiisfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime, Tags, Etag,
+ // ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl,
+ // ContentDisposition, LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays,
+ // ImmutabilityPolicyUntilDate, ImmutabilityPolicyMode, LegalHold,
+ // CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, CustomerProvidedKeySha256, RehydratePriority,
+ // ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope,
+ // IncrementalCopy, TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts.
+ // The valid values for 'Container' definition.objectType include 'Name,
+ // Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag,
+ // DefaultEncryptionScope, DenyEncryptionScopeOverride,
+ // ImmutableStorageWithVersioningEnabled, Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time,
+ // hdiisfolder, Owner, Group, Permissions, Acl, DeletionId' are valid only
+ // for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid for Non-Hns accounts.
+ SchemaFields []*string
+
+ // An object that defines the filter set.
+ Filters *BlobInventoryPolicyFilter
+}
+
+// BlobInventoryPolicyFilter - An object that defines the blob inventory rule filter conditions. For 'Blob' definition.objectType
+// all filter properties are applicable, 'blobTypes' is required and others are optional. For
+// 'Container' definition.objectType only prefixMatch is applicable and is optional.
+type BlobInventoryPolicyFilter struct {
+ // An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support
+ // pageBlobs. This field is required when definition.objectType property is set to
+ // 'Blob'.
+ BlobTypes []*string
+
+ // This property is used to filter objects based on the object creation time
+ CreationTime *BlobInventoryCreationTime
+
+ // An array of strings with maximum 10 blob prefixes to be excluded from the inventory.
+ ExcludePrefix []*string
+
+ // Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and IsCurrentVersion'
+ // are required if this property is set to true, else they must be
+ // excluded.
+ IncludeBlobVersions *bool
+
+ // For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'.
+ // For 'Blob' definition.objectType and HNS enabled storage
+ // accounts the definition.schemaFields must include 'DeletionId, Deleted, DeletedTime and RemainingRetentionDays' and for
+ // Hns disabled accounts the definition.schemaFields must include 'Deleted and
+ // RemainingRetentionDays', else it must be excluded.
+ IncludeDeleted *bool
+
+ // Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required
+ // if this property is set to true, else it must be excluded.
+ IncludeSnapshots *bool
+
+ // An array of strings with maximum 10 blob prefixes to be included in the inventory.
+ PrefixMatch []*string
+}
+
+// BlobInventoryPolicyProperties - The storage account blob inventory policy properties.
+type BlobInventoryPolicyProperties struct {
+ // REQUIRED; The storage account blob inventory policy object. It is composed of policy rules.
+ Policy *BlobInventoryPolicySchema
+
+ // READ-ONLY; Returns the last modified date and time of the blob inventory policy.
+ LastModifiedTime *time.Time
+}
+
+// BlobInventoryPolicyRule - An object that wraps the blob inventory rule. Each rule is uniquely defined by name.
+type BlobInventoryPolicyRule struct {
+ // REQUIRED; An object that defines the blob inventory policy rule.
+ Definition *BlobInventoryPolicyDefinition
+
+ // REQUIRED; Container name where blob inventory files are stored. Must be pre-created.
+ Destination *string
+
+ // REQUIRED; Rule is enabled when set to true.
+ Enabled *bool
+
+ // REQUIRED; A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be
+ // unique within a policy.
+ Name *string
+}
+
+// BlobInventoryPolicySchema - The storage account blob inventory policy rules.
+type BlobInventoryPolicySchema struct {
+ // REQUIRED; Policy is enabled if set to true.
+ Enabled *bool
+
+ // REQUIRED; The storage account blob inventory policy rules. The rule is applied when it is enabled.
+ Rules []*BlobInventoryPolicyRule
+
+ // REQUIRED; The valid value is Inventory
+ Type *InventoryRuleType
+
+ // READ-ONLY; Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified
+ // at the rule level 'policy.rule.destination'
+ Destination *string
+}
+
+// BlobRestoreParameters - Blob restore parameters
+type BlobRestoreParameters struct {
+ // REQUIRED; Blob ranges to restore.
+ BlobRanges []*BlobRestoreRange
+
+ // REQUIRED; Restore blob to the specified time.
+ TimeToRestore *time.Time
+}
+
+// BlobRestoreRange - Blob range
+type BlobRestoreRange struct {
+ // REQUIRED; Blob end range. This is exclusive. Empty means account end.
+ EndRange *string
+
+ // REQUIRED; Blob start range. This is inclusive. Empty means account start.
+ StartRange *string
+}
+
+// BlobRestoreStatus - Blob restore status.
+type BlobRestoreStatus struct {
+ // READ-ONLY; Failure reason when blob restore is failed.
+ FailureReason *string
+
+ // READ-ONLY; Blob restore request parameters.
+ Parameters *BlobRestoreParameters
+
+ // READ-ONLY; Id for tracking blob restore request.
+ RestoreID *string
+
+ // READ-ONLY; The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing.
+ // - Complete: Indicates that blob restore has been completed successfully. - Failed:
+ // Indicates that blob restore is failed.
+ Status *BlobRestoreProgressStatus
+}
+
+type BlobServiceItems struct {
+ // READ-ONLY; List of blob services returned.
+ Value []*BlobServiceProperties
+}
+
+// BlobServiceProperties - The properties of a storage account’s Blob service.
+type BlobServiceProperties struct {
+ // The properties of a storage account’s Blob service.
+ BlobServiceProperties *BlobServicePropertiesProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Sku name and tier.
+ SKU *SKU
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// BlobServicePropertiesProperties - The properties of a storage account’s Blob service.
+type BlobServicePropertiesProperties struct {
+ // Deprecated in favor of isVersioningEnabled property.
+ AutomaticSnapshotPolicyEnabled *bool
+
+ // The blob service properties for change feed events.
+ ChangeFeed *ChangeFeed
+
+ // The blob service properties for container soft delete.
+ ContainerDeleteRetentionPolicy *DeleteRetentionPolicy
+
+ // Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule
+ // elements are included in the request body, all CORS rules will be deleted, and
+ // CORS will be disabled for the Blob service.
+ Cors *CorsRules
+
+ // DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version
+ // is not specified. Possible values include version 2008-10-27 and all more
+ // recent versions.
+ DefaultServiceVersion *string
+
+ // The blob service properties for blob soft delete.
+ DeleteRetentionPolicy *DeleteRetentionPolicy
+
+ // Versioning is enabled if set to true.
+ IsVersioningEnabled *bool
+
+ // The blob service property to configure last access time based tracking policy.
+ LastAccessTimeTrackingPolicy *LastAccessTimeTrackingPolicy
+
+ // The blob service properties for blob restore policy.
+ RestorePolicy *RestorePolicyProperties
+}
+
+// ChangeFeed - The blob service properties for change feed events.
+type ChangeFeed struct {
+ // Indicates whether change feed event logging is enabled for the Blob service.
+ Enabled *bool
+
+ // Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years).
+ // A null value indicates an infinite retention of the change feed.
+ RetentionInDays *int32
+}
+
+// CheckNameAvailabilityResult - The CheckNameAvailability operation response.
+type CheckNameAvailabilityResult struct {
+ // READ-ONLY; Gets an error message explaining the Reason value in more detail.
+ Message *string
+
+ // READ-ONLY; Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available.
+ // If false, the name has already been taken or is invalid and cannot be used.
+ NameAvailable *bool
+
+ // READ-ONLY; Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable
+ // is false.
+ Reason *Reason
+}
+
+// ContainerProperties - The properties of a container.
+type ContainerProperties struct {
+ // Default the container to use specified encryption scope for all writes.
+ DefaultEncryptionScope *string
+
+ // Block override of encryption scope from the container default.
+ DenyEncryptionScopeOverride *bool
+
+ // Enable NFSv3 all squash on blob container.
+ EnableNfsV3AllSquash *bool
+
+ // Enable NFSv3 root squash on blob container.
+ EnableNfsV3RootSquash *bool
+
+ // The object level immutability property of the container. The property is immutable and can only be set to true at the container
+ // creation time. Existing containers must undergo a migration process.
+ ImmutableStorageWithVersioning *ImmutableStorageWithVersioning
+
+ // A name-value pair to associate with the container as metadata.
+ Metadata map[string]*string
+
+ // Specifies whether data in the container may be accessed publicly and the level of access.
+ PublicAccess *PublicAccess
+
+ // READ-ONLY; Indicates whether the blob container was deleted.
+ Deleted *bool
+
+ // READ-ONLY; Blob container deletion time.
+ DeletedTime *time.Time
+
+ // READ-ONLY; The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this
+ // container. The hasImmutabilityPolicy public property is set to false by SRP if
+ // ImmutabilityPolicy has not been created for this container.
+ HasImmutabilityPolicy *bool
+
+ // READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold
+ // public property is set to false by SRP if all existing legal hold tags are cleared out.
+ // There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.
+ HasLegalHold *bool
+
+ // READ-ONLY; The ImmutabilityPolicy property of the container.
+ ImmutabilityPolicy *ImmutabilityPolicyProperties
+
+ // READ-ONLY; Returns the date and time the container was last modified.
+ LastModifiedTime *time.Time
+
+ // READ-ONLY; Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased.
+ LeaseDuration *LeaseDuration
+
+ // READ-ONLY; Lease state of the container.
+ LeaseState *LeaseState
+
+ // READ-ONLY; The lease status of the container.
+ LeaseStatus *LeaseStatus
+
+ // READ-ONLY; The LegalHold property of the container.
+ LegalHold *LegalHoldProperties
+
+ // READ-ONLY; Remaining retention days for soft deleted blob container.
+ RemainingRetentionDays *int32
+
+ // READ-ONLY; The version of the deleted blob container.
+ Version *string
+}
+
+// CorsRule - Specifies a CORS rule for the Blob service.
+type CorsRule struct {
+ // REQUIRED; Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request.
+ AllowedHeaders []*string
+
+ // REQUIRED; Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin.
+ AllowedMethods []*CorsRuleAllowedMethodsItem
+
+ // REQUIRED; Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow
+ // all domains
+ AllowedOrigins []*string
+
+ // REQUIRED; Required if CorsRule element is present. A list of response headers to expose to CORS clients.
+ ExposedHeaders []*string
+
+ // REQUIRED; Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight
+ // response.
+ MaxAgeInSeconds *int32
+}
+
+// CorsRules - Sets the CORS rules. You can include up to five CorsRule elements in the request.
+type CorsRules struct {
+ // The List of CORS rules. You can include up to five CorsRule elements in the request.
+ CorsRules []*CorsRule
+}
+
+// CustomDomain - The custom domain assigned to this storage account. This can be set via Update.
+type CustomDomain struct {
+ // REQUIRED; Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.
+ Name *string
+
+ // Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.
+ UseSubDomainName *bool
+}
+
+// DateAfterCreation - Object to define snapshot and version action conditions.
+type DateAfterCreation struct {
+ // REQUIRED; Value indicating the age in days after creation
+ DaysAfterCreationGreaterThan *float32
+
+ // Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions
+ // and requires daysAfterCreationGreaterThan to be set for snapshots and blob
+ // version based actions. The blob will be archived if both the conditions are satisfied.
+ DaysAfterLastTierChangeGreaterThan *float32
+}
+
+// DateAfterModification - Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan,
+// daysAfterLastAccessTimeGreaterThan and daysAfterCreationGreaterThan are mutually exclusive. The
+// daysAfterLastTierChangeGreaterThan property is only applicable for tierToArchive actions which requires daysAfterModificationGreaterThan
+// to be set, also it cannot be used in conjunction with
+// daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan.
+type DateAfterModification struct {
+ // Value indicating the age in days after blob creation.
+ DaysAfterCreationGreaterThan *float32
+
+ // Value indicating the age in days after last blob access. This property can only be used in conjunction with last access
+ // time tracking policy
+ DaysAfterLastAccessTimeGreaterThan *float32
+
+ // Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions
+ // and requires daysAfterModificationGreaterThan to be set for baseBlobs
+ // based actions. The blob will be archived if both the conditions are satisfied.
+ DaysAfterLastTierChangeGreaterThan *float32
+
+ // Value indicating the age in days after last modification
+ DaysAfterModificationGreaterThan *float32
+}
+
+// DeleteRetentionPolicy - The service properties for soft delete.
+type DeleteRetentionPolicy struct {
+ // This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be
+ // used blob restore policy. This property only applies to blob service and does
+ // not apply to containers or file share.
+ AllowPermanentDelete *bool
+
+ // Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum
+ // value can be 365.
+ Days *int32
+
+ // Indicates whether DeleteRetentionPolicy is enabled.
+ Enabled *bool
+}
+
+// DeletedAccount - Deleted storage account
+type DeletedAccount struct {
+ // Properties of the deleted account.
+ Properties *DeletedAccountProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// DeletedAccountListResult - The response from the List Deleted Accounts operation.
+type DeletedAccountListResult struct {
+ // READ-ONLY; Request URL that can be used to query next page of deleted accounts. Returned when total number of requested
+ // deleted accounts exceed maximum page size.
+ NextLink *string
+
+ // READ-ONLY; Gets the list of deleted accounts and their properties.
+ Value []*DeletedAccount
+}
+
+// DeletedAccountProperties - Attributes of a deleted storage account.
+type DeletedAccountProperties struct {
+ // READ-ONLY; Creation time of the deleted account.
+ CreationTime *string
+
+ // READ-ONLY; Deletion time of the deleted account.
+ DeletionTime *string
+
+ // READ-ONLY; Location of the deleted account.
+ Location *string
+
+ // READ-ONLY; Can be used to attempt recovering this deleted account via PutStorageAccount API.
+ RestoreReference *string
+
+ // READ-ONLY; Full resource id of the original storage account.
+ StorageAccountResourceID *string
+}
+
+// DeletedShare - The deleted share to be restored.
+type DeletedShare struct {
+ // REQUIRED; Required. Identify the name of the deleted share that will be restored.
+ DeletedShareName *string
+
+ // REQUIRED; Required. Identify the version of the deleted share that will be restored.
+ DeletedShareVersion *string
+}
+
+// Dimension of blobs, possibly be blob type or access tier.
+type Dimension struct {
+ // Display name of dimension.
+ DisplayName *string
+
+ // Display name of dimension.
+ Name *string
+}
+
+// Encryption - The encryption settings on the storage account.
+type Encryption struct {
+ // The identity to be used with service-side encryption at rest.
+ EncryptionIdentity *EncryptionIdentity
+
+ // The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault
+ KeySource *KeySource
+
+ // Properties provided by key vault.
+ KeyVaultProperties *KeyVaultProperties
+
+ // A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for
+ // data at rest.
+ RequireInfrastructureEncryption *bool
+
+ // List of services which support encryption.
+ Services *EncryptionServices
+}
+
+// EncryptionIdentity - Encryption identity for the storage account.
+type EncryptionIdentity struct {
+ // ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys
+ // server-side encryption on the storage account.
+ EncryptionFederatedIdentityClientID *string
+
+ // Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account.
+ EncryptionUserAssignedIdentity *string
+}
+
+// EncryptionScope - The Encryption Scope resource.
+type EncryptionScope struct {
+ // Properties of the encryption scope.
+ EncryptionScopeProperties *EncryptionScopeProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// EncryptionScopeKeyVaultProperties - The key vault properties for the encryption scope. This is a required field if encryption
+// scope 'source' attribute is set to 'Microsoft.KeyVault'.
+type EncryptionScopeKeyVaultProperties struct {
+ // The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the
+ // identifier to enable customer-managed key support on this encryption scope.
+ KeyURI *string
+
+ // READ-ONLY; The object identifier of the current versioned Key Vault Key in use.
+ CurrentVersionedKeyIdentifier *string
+
+ // READ-ONLY; Timestamp of last rotation of the Key Vault Key.
+ LastKeyRotationTimestamp *time.Time
+}
+
+// EncryptionScopeListResult - List of encryption scopes requested, and if paging is required, a URL to the next page of encryption
+// scopes.
+type EncryptionScopeListResult struct {
+ // READ-ONLY; Request URL that can be used to query next page of encryption scopes. Returned when total number of requested
+ // encryption scopes exceeds the maximum page size.
+ NextLink *string
+
+ // READ-ONLY; List of encryption scopes requested.
+ Value []*EncryptionScope
+}
+
+// EncryptionScopeProperties - Properties of the encryption scope.
+type EncryptionScopeProperties struct {
+ // The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is set
+ // to 'Microsoft.KeyVault'.
+ KeyVaultProperties *EncryptionScopeKeyVaultProperties
+
+ // A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for
+ // data at rest.
+ RequireInfrastructureEncryption *bool
+
+ // The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault.
+ Source *EncryptionScopeSource
+
+ // The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled.
+ State *EncryptionScopeState
+
+ // READ-ONLY; Gets the creation date and time of the encryption scope in UTC.
+ CreationTime *time.Time
+
+ // READ-ONLY; Gets the last modification date and time of the encryption scope in UTC.
+ LastModifiedTime *time.Time
+}
+
+// EncryptionService - A service that allows server-side encryption to be used.
+type EncryptionService struct {
+ // A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default
+ // today and cannot be disabled.
+ Enabled *bool
+
+ // Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption
+ // key will be used. 'Service' key type implies that a default service key is used.
+ KeyType *KeyType
+
+ // READ-ONLY; Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at
+ // rest by default today and cannot be disabled.
+ LastEnabledTime *time.Time
+}
+
+// EncryptionServices - A list of services that support encryption.
+type EncryptionServices struct {
+ // The encryption function of the blob storage service.
+ Blob *EncryptionService
+
+ // The encryption function of the file storage service.
+ File *EncryptionService
+
+ // The encryption function of the queue storage service.
+ Queue *EncryptionService
+
+ // The encryption function of the table storage service.
+ Table *EncryptionService
+}
+
+// Endpoints - The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object.
+type Endpoints struct {
+ // Gets the internet routing storage endpoints
+ InternetEndpoints *AccountInternetEndpoints
+
+ // Gets the microsoft routing storage endpoints.
+ MicrosoftEndpoints *AccountMicrosoftEndpoints
+
+ // READ-ONLY; Gets the blob endpoint.
+ Blob *string
+
+ // READ-ONLY; Gets the dfs endpoint.
+ Dfs *string
+
+ // READ-ONLY; Gets the file endpoint.
+ File *string
+
+ // READ-ONLY; Gets the queue endpoint.
+ Queue *string
+
+ // READ-ONLY; Gets the table endpoint.
+ Table *string
+
+ // READ-ONLY; Gets the web endpoint.
+ Web *string
+}
+
+// ErrorAdditionalInfo - The resource management error additional info.
+type ErrorAdditionalInfo struct {
+ // READ-ONLY; The additional info.
+ Info any
+
+ // READ-ONLY; The additional info type.
+ Type *string
+}
+
+// ErrorDetail - The error detail.
+type ErrorDetail struct {
+ // READ-ONLY; The error additional info.
+ AdditionalInfo []*ErrorAdditionalInfo
+
+ // READ-ONLY; The error code.
+ Code *string
+
+ // READ-ONLY; The error details.
+ Details []*ErrorDetail
+
+ // READ-ONLY; The error message.
+ Message *string
+
+ // READ-ONLY; The error target.
+ Target *string
+}
+
+// ErrorResponse - An error response from the storage resource provider.
+type ErrorResponse struct {
+ // Azure Storage Resource Provider error response body.
+ Error *ErrorResponseBody
+}
+
+// ErrorResponseAutoGenerated - 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 ErrorResponseAutoGenerated struct {
+ // The error object.
+ Error *ErrorDetail
+}
+
+// ErrorResponseBody - Error response body contract.
+type ErrorResponseBody struct {
+ // An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
+ Code *string
+
+ // A message describing the error, intended to be suitable for display in a user interface.
+ Message *string
+}
+
+// ExtendedLocation - The complex type of the extended location.
+type ExtendedLocation struct {
+ // The name of the extended location.
+ Name *string
+
+ // The type of the extended location.
+ Type *ExtendedLocationTypes
+}
+
+type FileServiceItems struct {
+ // READ-ONLY; List of file services returned.
+ Value []*FileServiceProperties
+}
+
+// FileServiceProperties - The properties of File services in storage account.
+type FileServiceProperties struct {
+ // The properties of File services in storage account.
+ FileServiceProperties *FileServicePropertiesProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Sku name and tier.
+ SKU *SKU
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FileServicePropertiesProperties - The properties of File services in storage account.
+type FileServicePropertiesProperties struct {
+ // Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule
+ // elements are included in the request body, all CORS rules will be deleted, and
+ // CORS will be disabled for the File service.
+ Cors *CorsRules
+
+ // Protocol settings for file service
+ ProtocolSettings *ProtocolSettings
+
+ // The file service properties for share soft delete.
+ ShareDeleteRetentionPolicy *DeleteRetentionPolicy
+}
+
+// FileShare - Properties of the file share, including Id, resource name, resource type, Etag.
+type FileShare struct {
+ // Properties of the file share.
+ FileShareProperties *FileShareProperties
+
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FileShareItem - The file share properties be listed out.
+type FileShareItem struct {
+ // The file share properties be listed out.
+ Properties *FileShareProperties
+
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// FileShareItems - Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next
+// page of shares.
+type FileShareItems struct {
+ // READ-ONLY; Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed
+ // maximum page size.
+ NextLink *string
+
+ // READ-ONLY; List of file shares returned.
+ Value []*FileShareItem
+}
+
+// FileShareProperties - The properties of the file share.
+type FileShareProperties struct {
+ // Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage
+ // account can choose Premium.
+ AccessTier *ShareAccessTier
+
+ // The authentication protocol that is used for the file share. Can only be specified when creating a share.
+ EnabledProtocols *EnabledProtocols
+
+ // A name-value pair to associate with the share as metadata.
+ Metadata map[string]*string
+
+ // The property is for NFS share only. The default is NoRootSquash.
+ RootSquash *RootSquashType
+
+ // The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File
+ // Shares, the maximum size is 102400.
+ ShareQuota *int32
+
+ // List of stored access policies specified on the share.
+ SignedIdentifiers []*SignedIdentifier
+
+ // READ-ONLY; Indicates the last modification time for share access tier.
+ AccessTierChangeTime *time.Time
+
+ // READ-ONLY; Indicates if there is a pending transition for access tier.
+ AccessTierStatus *string
+
+ // READ-ONLY; Indicates whether the share was deleted.
+ Deleted *bool
+
+ // READ-ONLY; The deleted time if the share was deleted.
+ DeletedTime *time.Time
+
+ // READ-ONLY; Returns the date and time the share was last modified.
+ LastModifiedTime *time.Time
+
+ // READ-ONLY; Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased.
+ LeaseDuration *LeaseDuration
+
+ // READ-ONLY; Lease state of the share.
+ LeaseState *LeaseState
+
+ // READ-ONLY; The lease status of the share.
+ LeaseStatus *LeaseStatus
+
+ // READ-ONLY; Remaining retention days for share that was soft deleted.
+ RemainingRetentionDays *int32
+
+ // READ-ONLY; The approximate size of the data stored on the share. Note that this value may not include all recently created
+ // or recently resized files.
+ ShareUsageBytes *int64
+
+ // READ-ONLY; Creation time of share snapshot returned in the response of list shares with expand param "snapshots".
+ SnapshotTime *time.Time
+
+ // READ-ONLY; The version of the share.
+ Version *string
+}
+
+// GeoReplicationStats - Statistics related to replication for storage account's Blob, Table, Queue and File services. It
+// is only available when geo-redundant replication is enabled for the storage account.
+type GeoReplicationStats struct {
+ // READ-ONLY; A boolean flag which indicates whether or not account failover is supported for the account.
+ CanFailover *bool
+
+ // READ-ONLY; A boolean flag which indicates whether or not planned account failover is supported for the account.
+ CanPlannedFailover *bool
+
+ // READ-ONLY; All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary
+ // writes following this point in time may or may not be available for reads. Element may
+ // be default value if value of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap.
+ LastSyncTime *time.Time
+
+ // READ-ONLY; The redundancy type of the account after an account failover is performed.
+ PostFailoverRedundancy *PostFailoverRedundancy
+
+ // READ-ONLY; The redundancy type of the account after a planned account failover is performed.
+ PostPlannedFailoverRedundancy *PostPlannedFailoverRedundancy
+
+ // READ-ONLY; The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is
+ // active and operational. - Bootstrap: Indicates initial synchronization from the primary
+ // location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable:
+ // Indicates that the secondary location is temporarily unavailable.
+ Status *GeoReplicationStatus
+}
+
+// IPRule - IP rule with specific IP or IP range in CIDR format.
+type IPRule struct {
+ // REQUIRED; Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed.
+ IPAddressOrRange *string
+
+ // The action of IP ACL rule.
+ Action *string
+}
+
+// Identity for the resource.
+type Identity struct {
+ // REQUIRED; The identity type.
+ Type *IdentityType
+
+ // Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage
+ // account. The key is the ARM resource identifier of the identity. Only 1
+ // User Assigned identity is permitted here.
+ UserAssignedIdentities map[string]*UserAssignedIdentity
+
+ // READ-ONLY; The principal ID of resource identity.
+ PrincipalID *string
+
+ // READ-ONLY; The tenant ID of resource.
+ TenantID *string
+}
+
+// ImmutabilityPolicy - The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+type ImmutabilityPolicy struct {
+ // REQUIRED; The properties of an ImmutabilityPolicy of a blob container.
+ Properties *ImmutabilityPolicyProperty
+
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// ImmutabilityPolicyProperties - The properties of an ImmutabilityPolicy of a blob container.
+type ImmutabilityPolicyProperties struct {
+ // The properties of an ImmutabilityPolicy of a blob container.
+ Properties *ImmutabilityPolicyProperty
+
+ // READ-ONLY; ImmutabilityPolicy Etag.
+ Etag *string
+
+ // READ-ONLY; The ImmutabilityPolicy update history of the blob container.
+ UpdateHistory []*UpdateHistoryProperty
+}
+
+// ImmutabilityPolicyProperty - The properties of an ImmutabilityPolicy of a blob container.
+type ImmutabilityPolicyProperty struct {
+ // This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to
+ // an append blob while maintaining immutability protection and compliance. Only
+ // new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy
+ // API.
+ AllowProtectedAppendWrites *bool
+
+ // This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to
+ // both 'Append and Bock Blobs' while maintaining immutability protection and
+ // compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be
+ // changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and
+ // 'allowProtectedAppendWritesAll' properties are mutually exclusive.
+ AllowProtectedAppendWritesAll *bool
+
+ // The immutability period for the blobs in the container since the policy creation, in days.
+ ImmutabilityPeriodSinceCreationInDays *int32
+
+ // READ-ONLY; The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.
+ State *ImmutabilityPolicyState
+}
+
+// ImmutableStorageAccount - This property enables and defines account-level immutability. Enabling the feature auto-enables
+// Blob Versioning.
+type ImmutableStorageAccount struct {
+ // A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability
+ // enabled by default.
+ Enabled *bool
+
+ // Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess an
+ // explicit immutability policy at the object level. The object-level immutability
+ // policy has higher precedence than the container-level immutability policy, which has a higher precedence than the account-level
+ // immutability policy.
+ ImmutabilityPolicy *AccountImmutabilityPolicyProperties
+}
+
+// ImmutableStorageWithVersioning - Object level immutability properties of the container.
+type ImmutableStorageWithVersioning struct {
+ // This is an immutable property, when set to true it enables object level immutability at the container level.
+ Enabled *bool
+
+ // READ-ONLY; This property denotes the container level immutability to object level immutability migration state.
+ MigrationState *MigrationState
+
+ // READ-ONLY; Returns the date and time the object level immutability was enabled.
+ TimeStamp *time.Time
+}
+
+// KeyCreationTime - Storage account keys creation time.
+type KeyCreationTime struct {
+ Key1 *time.Time
+ Key2 *time.Time
+}
+
+// KeyPolicy assigned to the storage account.
+type KeyPolicy struct {
+ // REQUIRED; The key expiration period in days.
+ KeyExpirationPeriodInDays *int32
+}
+
+// KeyVaultProperties - Properties of key vault.
+type KeyVaultProperties struct {
+ // The name of KeyVault key.
+ KeyName *string
+
+ // The Uri of KeyVault.
+ KeyVaultURI *string
+
+ // The version of KeyVault key.
+ KeyVersion *string
+
+ // READ-ONLY; This is a read only property that represents the expiration time of the current version of the customer managed
+ // key used for encryption.
+ CurrentVersionedKeyExpirationTimestamp *time.Time
+
+ // READ-ONLY; The object identifier of the current versioned Key Vault Key in use.
+ CurrentVersionedKeyIdentifier *string
+
+ // READ-ONLY; Timestamp of last rotation of the Key Vault Key.
+ LastKeyRotationTimestamp *time.Time
+}
+
+// LastAccessTimeTrackingPolicy - The blob service properties for Last access time based tracking policy.
+type LastAccessTimeTrackingPolicy struct {
+ // REQUIRED; When set to true last access time based tracking is enabled.
+ Enable *bool
+
+ // An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read only
+ BlobType []*string
+
+ // Name of the policy. The valid value is AccessTimeTracking. This field is currently read only
+ Name *Name
+
+ // The field specifies blob object tracking granularity in days, typically how often the blob object should be tracked.This
+ // field is currently read only with value as 1
+ TrackingGranularityInDays *int32
+}
+
+// LeaseContainerRequest - Lease Container request schema.
+type LeaseContainerRequest struct {
+ // REQUIRED; Specifies the lease action. Can be one of the available actions.
+ Action *LeaseContainerRequestAction
+
+ // Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and
+ // 60.
+ BreakPeriod *int32
+
+ // Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.
+ LeaseDuration *int32
+
+ // Identifies the lease. Can be specified in any valid GUID string format.
+ LeaseID *string
+
+ // Optional for acquire, required for change. Proposed lease ID, in a GUID string format.
+ ProposedLeaseID *string
+}
+
+// LeaseContainerResponse - Lease Container response schema.
+type LeaseContainerResponse struct {
+ // Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release
+ // the lease.
+ LeaseID *string
+
+ // Approximate time remaining in the lease period, in seconds.
+ LeaseTimeSeconds *string
+}
+
+// LeaseShareRequest - Lease Share request schema.
+type LeaseShareRequest struct {
+ // REQUIRED; Specifies the lease action. Can be one of the available actions.
+ Action *LeaseShareAction
+
+ // Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and
+ // 60.
+ BreakPeriod *int32
+
+ // Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.
+ LeaseDuration *int32
+
+ // Identifies the lease. Can be specified in any valid GUID string format.
+ LeaseID *string
+
+ // Optional for acquire, required for change. Proposed lease ID, in a GUID string format.
+ ProposedLeaseID *string
+}
+
+// LeaseShareResponse - Lease Share response schema.
+type LeaseShareResponse struct {
+ // Returned unique lease ID that must be included with any request to delete the share, or to renew, change, or release the
+ // lease.
+ LeaseID *string
+
+ // Approximate time remaining in the lease period, in seconds.
+ LeaseTimeSeconds *string
+}
+
+// LegalHold - The LegalHold property of a blob container.
+type LegalHold struct {
+ // REQUIRED; Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP.
+ Tags []*string
+
+ // When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance.
+ // Only new blocks can be added and any existing blocks cannot be modified
+ // or deleted.
+ AllowProtectedAppendWritesAll *bool
+
+ // READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold
+ // public property is set to false by SRP if all existing legal hold tags are cleared out.
+ // There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.
+ HasLegalHold *bool
+}
+
+// LegalHoldProperties - The LegalHold property of a blob container.
+type LegalHoldProperties struct {
+ // Protected append blob writes history.
+ ProtectedAppendWritesHistory *ProtectedAppendWritesHistory
+
+ // The list of LegalHold tags of a blob container.
+ Tags []*TagProperty
+
+ // READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold
+ // public property is set to false by SRP if all existing legal hold tags are cleared out.
+ // There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.
+ HasLegalHold *bool
+}
+
+// ListAccountSasResponse - The List SAS credentials operation response.
+type ListAccountSasResponse struct {
+ // READ-ONLY; List SAS credentials of storage account.
+ AccountSasToken *string
+}
+
+// ListBlobInventoryPolicy - List of blob inventory policies returned.
+type ListBlobInventoryPolicy struct {
+ // READ-ONLY; List of blob inventory policies.
+ Value []*BlobInventoryPolicy
+}
+
+// ListContainerItem - The blob container properties be listed out.
+type ListContainerItem struct {
+ // The blob container properties be listed out.
+ Properties *ContainerProperties
+
+ // READ-ONLY; Resource Etag.
+ Etag *string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// ListContainerItems - Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to
+// next page of containers.
+type ListContainerItems struct {
+ // READ-ONLY; Request URL that can be used to query next page of containers. Returned when total number of requested containers
+ // exceed maximum page size.
+ NextLink *string
+
+ // READ-ONLY; List of blobs containers returned.
+ Value []*ListContainerItem
+}
+
+type ListQueue struct {
+ // List Queue resource properties.
+ QueueProperties *ListQueueProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+type ListQueueProperties struct {
+ // A name-value pair that represents queue metadata.
+ Metadata map[string]*string
+}
+
+// ListQueueResource - Response schema. Contains list of queues returned
+type ListQueueResource struct {
+ // READ-ONLY; Request URL that can be used to list next page of queues
+ NextLink *string
+
+ // READ-ONLY; List of queues returned.
+ Value []*ListQueue
+}
+
+type ListQueueServices struct {
+ // READ-ONLY; List of queue services returned.
+ Value []*QueueServiceProperties
+}
+
+// ListServiceSasResponse - The List service SAS credentials operation response.
+type ListServiceSasResponse struct {
+ // READ-ONLY; List service SAS credentials of specific resource.
+ ServiceSasToken *string
+}
+
+// ListTableResource - Response schema. Contains list of tables returned
+type ListTableResource struct {
+ // READ-ONLY; Request URL that can be used to query next page of tables
+ NextLink *string
+
+ // READ-ONLY; List of tables returned.
+ Value []*Table
+}
+
+type ListTableServices struct {
+ // READ-ONLY; List of table services returned.
+ Value []*TableServiceProperties
+}
+
+// LocalUser - The local user associated with the storage accounts.
+type LocalUser struct {
+ // Storage account local user properties.
+ Properties *LocalUserProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; Metadata pertaining to creation and last modification of the resource.
+ SystemData *SystemData
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// LocalUserKeys - The Storage Account Local User keys.
+type LocalUserKeys struct {
+ // Optional, local user ssh authorized keys for SFTP.
+ SSHAuthorizedKeys []*SSHPublicKey
+
+ // READ-ONLY; Auto generated by the server for SMB authentication.
+ SharedKey *string
+}
+
+// LocalUserProperties - The Storage Account Local User properties.
+type LocalUserProperties struct {
+ // Indicates whether ssh key exists. Set it to false to remove existing SSH key.
+ HasSSHKey *bool
+
+ // Indicates whether ssh password exists. Set it to false to remove existing SSH password.
+ HasSSHPassword *bool
+
+ // Indicates whether shared key exists. Set it to false to remove existing shared key.
+ HasSharedKey *bool
+
+ // Optional, local user home directory.
+ HomeDirectory *string
+
+ // The permission scopes of the local user.
+ PermissionScopes []*PermissionScope
+
+ // Optional, local user ssh authorized keys for SFTP.
+ SSHAuthorizedKeys []*SSHPublicKey
+
+ // READ-ONLY; A unique Security Identifier that is generated by the server.
+ Sid *string
+}
+
+// LocalUserRegeneratePasswordResult - The secrets of Storage Account Local User.
+type LocalUserRegeneratePasswordResult struct {
+ // READ-ONLY; Auto generated password by the server for SSH authentication if hasSshPassword is set to true on the creation
+ // of local user.
+ SSHPassword *string
+}
+
+// LocalUsers - List storage account local users.
+type LocalUsers struct {
+ // The local users associated with the storage account.
+ Value []*LocalUser
+}
+
+// ManagementPolicy - The Get Storage Account ManagementPolicies operation response.
+type ManagementPolicy struct {
+ // Returns the Storage Account Data Policies Rules.
+ Properties *ManagementPolicyProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// ManagementPolicyAction - Actions are applied to the filtered blobs when the execution condition is met.
+type ManagementPolicyAction struct {
+ // The management policy action for base blob
+ BaseBlob *ManagementPolicyBaseBlob
+
+ // The management policy action for snapshot
+ Snapshot *ManagementPolicySnapShot
+
+ // The management policy action for version
+ Version *ManagementPolicyVersion
+}
+
+// ManagementPolicyBaseBlob - Management policy action for base blob.
+type ManagementPolicyBaseBlob struct {
+ // The function to delete the blob
+ Delete *DateAfterModification
+
+ // This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan.
+ EnableAutoTierToHotFromCool *bool
+
+ // The function to tier blobs to archive storage.
+ TierToArchive *DateAfterModification
+
+ // The function to tier blobs to cold storage.
+ TierToCold *DateAfterModification
+
+ // The function to tier blobs to cool storage.
+ TierToCool *DateAfterModification
+
+ // The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts
+ TierToHot *DateAfterModification
+}
+
+// ManagementPolicyDefinition - An object that defines the Lifecycle rule. Each definition is made up with a filters set and
+// an actions set.
+type ManagementPolicyDefinition struct {
+ // REQUIRED; An object that defines the action set.
+ Actions *ManagementPolicyAction
+
+ // An object that defines the filter set.
+ Filters *ManagementPolicyFilter
+}
+
+// ManagementPolicyFilter - Filters limit rule actions to a subset of blobs within the storage account. If multiple filters
+// are defined, a logical AND is performed on all filters.
+type ManagementPolicyFilter struct {
+ // REQUIRED; An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete
+ // actions are supported for appendBlob.
+ BlobTypes []*string
+
+ // An array of blob index tag based filters, there can be at most 10 tag filters
+ BlobIndexMatch []*TagFilter
+
+ // An array of strings for prefixes to be match.
+ PrefixMatch []*string
+}
+
+// ManagementPolicyProperties - The Storage Account ManagementPolicy properties.
+type ManagementPolicyProperties struct {
+ // REQUIRED; The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
+ Policy *ManagementPolicySchema
+
+ // READ-ONLY; Returns the date and time the ManagementPolicies was last modified.
+ LastModifiedTime *time.Time
+}
+
+// ManagementPolicyRule - An object that wraps the Lifecycle rule. Each rule is uniquely defined by name.
+type ManagementPolicyRule struct {
+ // REQUIRED; An object that defines the Lifecycle rule.
+ Definition *ManagementPolicyDefinition
+
+ // REQUIRED; A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be
+ // unique within a policy.
+ Name *string
+
+ // REQUIRED; The valid value is Lifecycle
+ Type *RuleType
+
+ // Rule is enabled if set to true.
+ Enabled *bool
+}
+
+// ManagementPolicySchema - The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
+type ManagementPolicySchema struct {
+ // REQUIRED; The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
+ Rules []*ManagementPolicyRule
+}
+
+// ManagementPolicySnapShot - Management policy action for snapshot.
+type ManagementPolicySnapShot struct {
+ // The function to delete the blob snapshot
+ Delete *DateAfterCreation
+
+ // The function to tier blob snapshot to archive storage.
+ TierToArchive *DateAfterCreation
+
+ // The function to tier blobs to cold storage.
+ TierToCold *DateAfterCreation
+
+ // The function to tier blob snapshot to cool storage.
+ TierToCool *DateAfterCreation
+
+ // The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts
+ TierToHot *DateAfterCreation
+}
+
+// ManagementPolicyVersion - Management policy action for blob version.
+type ManagementPolicyVersion struct {
+ // The function to delete the blob version
+ Delete *DateAfterCreation
+
+ // The function to tier blob version to archive storage.
+ TierToArchive *DateAfterCreation
+
+ // The function to tier blobs to cold storage.
+ TierToCold *DateAfterCreation
+
+ // The function to tier blob version to cool storage.
+ TierToCool *DateAfterCreation
+
+ // The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts
+ TierToHot *DateAfterCreation
+}
+
+// MetricSpecification - Metric specification of operation.
+type MetricSpecification struct {
+ // Aggregation type could be Average.
+ AggregationType *string
+
+ // The category this metric specification belong to, could be Capacity.
+ Category *string
+
+ // Dimensions of blobs, including blob type and access tier.
+ Dimensions []*Dimension
+
+ // Display description of metric specification.
+ DisplayDescription *string
+
+ // Display name of metric specification.
+ DisplayName *string
+
+ // The property to decide fill gap with zero or not.
+ FillGapWithZero *bool
+
+ // Name of metric specification.
+ Name *string
+
+ // Account Resource Id.
+ ResourceIDDimensionNameOverride *string
+
+ // Unit could be Bytes or Count.
+ Unit *string
+}
+
+// Multichannel setting. Applies to Premium FileStorage only.
+type Multichannel struct {
+ // Indicates whether multichannel is enabled
+ Enabled *bool
+}
+
+// NetworkRuleSet - Network rule set
+type NetworkRuleSet struct {
+ // REQUIRED; Specifies the default action of allow or deny when no other rules match.
+ DefaultAction *DefaultAction
+
+ // Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices
+ // (For example, "Logging, Metrics"), or None to bypass none
+ // of those traffics.
+ Bypass *Bypass
+
+ // Sets the IP ACL rules
+ IPRules []*IPRule
+
+ // Sets the resource access rules
+ ResourceAccessRules []*ResourceAccessRule
+
+ // Sets the virtual network rules
+ VirtualNetworkRules []*VirtualNetworkRule
+}
+
+// ObjectReplicationPolicies - List storage account object replication policies.
+type ObjectReplicationPolicies struct {
+ // The replication policy between two storage accounts.
+ Value []*ObjectReplicationPolicy
+}
+
+// ObjectReplicationPolicy - The replication policy between two storage accounts. Multiple rules can be defined in one policy.
+type ObjectReplicationPolicy struct {
+ // Returns the Storage Account Object Replication Policy.
+ Properties *ObjectReplicationPolicyProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// ObjectReplicationPolicyFilter - Filters limit replication to a subset of blobs within the storage account. A logical OR
+// is performed on values in the filter. If multiple filters are defined, a logical AND is performed on all
+// filters.
+type ObjectReplicationPolicyFilter struct {
+ // Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'.
+ // Example: 2020-02-19T16:05:00Z
+ MinCreationTime *string
+
+ // Optional. Filters the results to replicate only blobs whose names begin with the specified prefix.
+ PrefixMatch []*string
+}
+
+// ObjectReplicationPolicyProperties - The Storage Account ObjectReplicationPolicy properties.
+type ObjectReplicationPolicyProperties struct {
+ // REQUIRED; Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false.
+ DestinationAccount *string
+
+ // REQUIRED; Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false.
+ SourceAccount *string
+
+ // The storage account object replication rules.
+ Rules []*ObjectReplicationPolicyRule
+
+ // READ-ONLY; Indicates when the policy is enabled on the source account.
+ EnabledTime *time.Time
+
+ // READ-ONLY; A unique id for object replication policy.
+ PolicyID *string
+}
+
+// ObjectReplicationPolicyRule - The replication policy rule between two containers.
+type ObjectReplicationPolicyRule struct {
+ // REQUIRED; Required. Destination container name.
+ DestinationContainer *string
+
+ // REQUIRED; Required. Source container name.
+ SourceContainer *string
+
+ // Optional. An object that defines the filter set.
+ Filters *ObjectReplicationPolicyFilter
+
+ // Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account.
+ RuleID *string
+}
+
+// Operation - Storage REST API operation definition.
+type Operation struct {
+ // Display metadata associated with the operation.
+ Display *OperationDisplay
+
+ // Operation name: {provider}/{resource}/{operation}
+ Name *string
+
+ // Properties of operation, include metric specifications.
+ OperationProperties *OperationProperties
+
+ // The origin of operations.
+ Origin *string
+}
+
+// OperationDisplay - Display metadata associated with the operation.
+type OperationDisplay struct {
+ // Description of the operation.
+ Description *string
+
+ // Type of operation: get, read, delete, etc.
+ Operation *string
+
+ // Service provider: Microsoft Storage.
+ Provider *string
+
+ // Resource on which the operation is performed etc.
+ Resource *string
+}
+
+// OperationListResult - Result of the request to list Storage operations. It contains a list of operations and a URL link
+// to get the next set of results.
+type OperationListResult struct {
+ // List of Storage operations supported by the Storage resource provider.
+ Value []*Operation
+}
+
+// OperationProperties - Properties of operation, include metric specifications.
+type OperationProperties struct {
+ // One property of operation, include metric specifications.
+ ServiceSpecification *ServiceSpecification
+}
+
+type PermissionScope struct {
+ // REQUIRED; The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and Create
+ // (c).
+ Permissions *string
+
+ // REQUIRED; The name of resource, normally the container name or the file share name, used by the local user.
+ ResourceName *string
+
+ // REQUIRED; The service used by the local user, e.g. blob, file.
+ Service *string
+}
+
+// PrivateEndpoint - The Private Endpoint resource.
+type PrivateEndpoint struct {
+ // READ-ONLY; The ARM identifier for Private Endpoint
+ ID *string
+}
+
+// PrivateEndpointConnection - The Private Endpoint Connection resource.
+type PrivateEndpointConnection struct {
+ // Resource properties.
+ Properties *PrivateEndpointConnectionProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// PrivateEndpointConnectionListResult - List of private endpoint connection associated with the specified storage account
+type PrivateEndpointConnectionListResult struct {
+ // Array of private endpoint connections
+ Value []*PrivateEndpointConnection
+}
+
+// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties.
+type PrivateEndpointConnectionProperties struct {
+ // REQUIRED; A collection of information about the state of the connection between service consumer and provider.
+ PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState
+
+ // The resource of private end point.
+ PrivateEndpoint *PrivateEndpoint
+
+ // READ-ONLY; The provisioning state of the private endpoint connection resource.
+ ProvisioningState *PrivateEndpointConnectionProvisioningState
+}
+
+// PrivateLinkResource - A private link resource
+type PrivateLinkResource struct {
+ // Resource properties.
+ Properties *PrivateLinkResourceProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// PrivateLinkResourceListResult - A list of private link resources
+type PrivateLinkResourceListResult struct {
+ // Array of private link resources
+ Value []*PrivateLinkResource
+}
+
+// PrivateLinkResourceProperties - Properties of a private link resource.
+type PrivateLinkResourceProperties struct {
+ // The private link resource Private link DNS zone name.
+ RequiredZoneNames []*string
+
+ // READ-ONLY; The private link resource group id.
+ GroupID *string
+
+ // READ-ONLY; The private link resource required member names.
+ RequiredMembers []*string
+}
+
+// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer
+// and provider.
+type PrivateLinkServiceConnectionState struct {
+ // A message indicating if changes on the service provider require any updates on the consumer.
+ ActionRequired *string
+
+ // The reason for approval/rejection of the connection.
+ Description *string
+
+ // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.
+ Status *PrivateEndpointServiceConnectionStatus
+}
+
+// ProtectedAppendWritesHistory - Protected append writes history setting for the blob container with Legal holds.
+type ProtectedAppendWritesHistory struct {
+ // When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance.
+ // Only new blocks can be added and any existing blocks cannot be modified
+ // or deleted.
+ AllowProtectedAppendWritesAll *bool
+
+ // READ-ONLY; Returns the date and time the tag was added.
+ Timestamp *time.Time
+}
+
+// ProtocolSettings - Protocol settings for file service
+type ProtocolSettings struct {
+ // Setting for SMB protocol
+ Smb *SmbSetting
+}
+
+// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a
+// location
+type ProxyResource struct {
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+type Queue struct {
+ // Queue resource properties.
+ QueueProperties *QueueProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+type QueueProperties struct {
+ // A name-value pair that represents queue metadata.
+ Metadata map[string]*string
+
+ // READ-ONLY; Integer indicating an approximate number of messages in the queue. This number is not lower than the actual
+ // number of messages in the queue, but could be higher.
+ ApproximateMessageCount *int32
+}
+
+// QueueServiceProperties - The properties of a storage account’s Queue service.
+type QueueServiceProperties struct {
+ // The properties of a storage account’s Queue service.
+ QueueServiceProperties *QueueServicePropertiesProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// QueueServicePropertiesProperties - The properties of a storage account’s Queue service.
+type QueueServicePropertiesProperties struct {
+ // Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule
+ // elements are included in the request body, all CORS rules will be deleted, and
+ // CORS will be disabled for the Queue service.
+ Cors *CorsRules
+}
+
+// Resource - Common fields that are returned in the response for all Azure Resource Manager resources
+type Resource struct {
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// ResourceAccessRule - Resource Access Rule.
+type ResourceAccessRule struct {
+ // Resource Id
+ ResourceID *string
+
+ // Tenant Id
+ TenantID *string
+}
+
+// RestorePolicyProperties - The blob service properties for blob restore policy
+type RestorePolicyProperties struct {
+ // REQUIRED; Blob restore is enabled if set to true.
+ Enabled *bool
+
+ // how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days.
+ Days *int32
+
+ // READ-ONLY; Deprecated in favor of minRestoreTime property.
+ LastEnabledTime *time.Time
+
+ // READ-ONLY; Returns the minimum date and time that the restore can be started.
+ MinRestoreTime *time.Time
+}
+
+// Restriction - The restriction because of which SKU cannot be used.
+type Restriction struct {
+ // The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when
+ // the SKU has requiredQuotas parameter as the subscription does not belong to that
+ // quota. The "NotAvailableForSubscription" is related to capacity at DC.
+ ReasonCode *ReasonCode
+
+ // READ-ONLY; The type of restrictions. As of now only possible value for this is location.
+ Type *string
+
+ // READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where
+ // the SKU is restricted.
+ Values []*string
+}
+
+// RoutingPreference - Routing preference defines the type of network, either microsoft or internet routing to be used to
+// deliver the user data, the default option is microsoft routing
+type RoutingPreference struct {
+ // A boolean flag which indicates whether internet routing storage endpoints are to be published
+ PublishInternetEndpoints *bool
+
+ // A boolean flag which indicates whether microsoft routing storage endpoints are to be published
+ PublishMicrosoftEndpoints *bool
+
+ // Routing Choice defines the kind of network routing opted by the user.
+ RoutingChoice *RoutingChoice
+}
+
+// SKU - The SKU of the storage account.
+type SKU struct {
+ // REQUIRED; The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called
+ // accountType.
+ Name *SKUName
+
+ // READ-ONLY; The SKU tier. This is based on the SKU name.
+ Tier *SKUTier
+}
+
+// SKUCapability - The capability information in the specified SKU, including file encryption, network ACLs, change notification,
+// etc.
+type SKUCapability struct {
+ // READ-ONLY; The name of capability, The capability information in the specified SKU, including file encryption, network
+ // ACLs, change notification, etc.
+ Name *string
+
+ // READ-ONLY; A string value to indicate states of given capability. Possibly 'true' or 'false'.
+ Value *string
+}
+
+// SKUInformation - Storage SKU and its properties
+type SKUInformation struct {
+ // REQUIRED; The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called
+ // accountType.
+ Name *SKUName
+
+ // The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.
+ Restrictions []*Restriction
+
+ // READ-ONLY; The capability information in the specified SKU, including file encryption, network ACLs, change notification,
+ // etc.
+ Capabilities []*SKUCapability
+
+ // READ-ONLY; Indicates the type of storage account.
+ Kind *Kind
+
+ // READ-ONLY; The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g.
+ // West US, East US, Southeast Asia, etc.).
+ Locations []*string
+
+ // READ-ONLY; The type of the resource, usually it is 'storageAccounts'.
+ ResourceType *string
+
+ // READ-ONLY; The SKU tier. This is based on the SKU name.
+ Tier *SKUTier
+}
+
+// SKUListResult - The response from the List Storage SKUs operation.
+type SKUListResult struct {
+ // READ-ONLY; Get the list result of storage SKUs and their properties.
+ Value []*SKUInformation
+}
+
+type SSHPublicKey struct {
+ // Optional. It is used to store the function/usage of the key
+ Description *string
+
+ // Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB
+ Key *string
+}
+
+// SasPolicy assigned to the storage account.
+type SasPolicy struct {
+ // REQUIRED; The SAS expiration action. Can only be Log.
+ ExpirationAction *ExpirationAction
+
+ // REQUIRED; The SAS expiration period, DD.HH:MM:SS.
+ SasExpirationPeriod *string
+}
+
+// ServiceSasParameters - The parameters to list service SAS credentials of a specific resource.
+type ServiceSasParameters struct {
+ // REQUIRED; The canonical path to the signed resource.
+ CanonicalizedResource *string
+
+ // The response header override for cache control.
+ CacheControl *string
+
+ // The response header override for content disposition.
+ ContentDisposition *string
+
+ // The response header override for content encoding.
+ ContentEncoding *string
+
+ // The response header override for content language.
+ ContentLanguage *string
+
+ // The response header override for content type.
+ ContentType *string
+
+ // An IP address or a range of IP addresses from which to accept requests.
+ IPAddressOrRange *string
+
+ // A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or
+ // table.
+ Identifier *string
+
+ // The key to sign the account SAS token with.
+ KeyToSign *string
+
+ // The end of partition key.
+ PartitionKeyEnd *string
+
+ // The start of partition key.
+ PartitionKeyStart *string
+
+ // The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a),
+ // Create (c), Update (u) and Process (p).
+ Permissions *Permissions
+
+ // The protocol permitted for a request made with the account SAS.
+ Protocols *HTTPProtocol
+
+ // The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share
+ // (s).
+ Resource *SignedResource
+
+ // The end of row key.
+ RowKeyEnd *string
+
+ // The start of row key.
+ RowKeyStart *string
+
+ // The time at which the shared access signature becomes invalid.
+ SharedAccessExpiryTime *time.Time
+
+ // The time at which the SAS becomes valid.
+ SharedAccessStartTime *time.Time
+}
+
+// ServiceSpecification - One property of operation, include metric specifications.
+type ServiceSpecification struct {
+ // Metric specifications of operation.
+ MetricSpecifications []*MetricSpecification
+}
+
+type SignedIdentifier struct {
+ // Access policy
+ AccessPolicy *AccessPolicy
+
+ // An unique identifier of the stored access policy.
+ ID *string
+}
+
+// SmbSetting - Setting for SMB protocol
+type SmbSetting struct {
+ // SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter
+ // ';'.
+ AuthenticationMethods *string
+
+ // SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as
+ // a string with delimiter ';'.
+ ChannelEncryption *string
+
+ // Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with delimiter
+ // ';'
+ KerberosTicketEncryption *string
+
+ // Multichannel setting. Applies to Premium FileStorage only.
+ Multichannel *Multichannel
+
+ // SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with
+ // delimiter ';'.
+ Versions *string
+}
+
+// SystemData - Metadata pertaining to creation and last modification of the resource.
+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
+}
+
+// Table - Properties of the table, including Id, resource name, resource type.
+type Table struct {
+ // Table resource properties.
+ TableProperties *TableProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// TableAccessPolicy - Table Access Policy Properties Object.
+type TableAccessPolicy struct {
+ // REQUIRED; Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d'
+ Permission *string
+
+ // Expiry time of the access policy
+ ExpiryTime *time.Time
+
+ // Start time of the access policy
+ StartTime *time.Time
+}
+
+type TableProperties struct {
+ // List of stored access policies specified on the table.
+ SignedIdentifiers []*TableSignedIdentifier
+
+ // READ-ONLY; Table name under the specified account
+ TableName *string
+}
+
+// TableServiceProperties - The properties of a storage account’s Table service.
+type TableServiceProperties struct {
+ // The properties of a storage account’s Table service.
+ TableServiceProperties *TableServicePropertiesProperties
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// TableServicePropertiesProperties - The properties of a storage account’s Table service.
+type TableServicePropertiesProperties struct {
+ // Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule
+ // elements are included in the request body, all CORS rules will be deleted, and
+ // CORS will be disabled for the Table service.
+ Cors *CorsRules
+}
+
+// TableSignedIdentifier - Object to set Table Access Policy.
+type TableSignedIdentifier struct {
+ // REQUIRED; unique-64-character-value of the stored access policy.
+ ID *string
+
+ // Access policy
+ AccessPolicy *TableAccessPolicy
+}
+
+// TagFilter - Blob index tag based filtering for blob objects
+type TagFilter struct {
+ // REQUIRED; This is the filter tag name, it can have 1 - 128 characters
+ Name *string
+
+ // REQUIRED; This is the comparison operator which is used for object comparison and filtering. Only == (equality operator)
+ // is currently supported
+ Op *string
+
+ // REQUIRED; This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters
+ Value *string
+}
+
+// TagProperty - A tag of the LegalHold of a blob container.
+type TagProperty struct {
+ // READ-ONLY; Returns the Object ID of the user who added the tag.
+ ObjectIdentifier *string
+
+ // READ-ONLY; The tag value.
+ Tag *string
+
+ // READ-ONLY; Returns the Tenant ID that issued the token for the user who added the tag.
+ TenantID *string
+
+ // READ-ONLY; Returns the date and time the tag was added.
+ Timestamp *time.Time
+
+ // READ-ONLY; Returns the User Principal Name of the user who added the tag.
+ Upn *string
+}
+
+// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags'
+// and a 'location'
+type TrackedResource struct {
+ // REQUIRED; The geo-location where the resource lives
+ Location *string
+
+ // Resource tags.
+ Tags map[string]*string
+
+ // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string
+
+ // READ-ONLY; The name of the resource
+ Name *string
+
+ // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string
+}
+
+// UpdateHistoryProperty - An update history of the ImmutabilityPolicy of a blob container.
+type UpdateHistoryProperty struct {
+ // This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to
+ // an append blob while maintaining immutability protection and compliance. Only
+ // new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy
+ // API.
+ AllowProtectedAppendWrites *bool
+
+ // This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to
+ // both 'Append and Bock Blobs' while maintaining immutability protection and
+ // compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be
+ // changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and
+ // 'allowProtectedAppendWritesAll' properties are mutually exclusive.
+ AllowProtectedAppendWritesAll *bool
+
+ // READ-ONLY; The immutability period for the blobs in the container since the policy creation, in days.
+ ImmutabilityPeriodSinceCreationInDays *int32
+
+ // READ-ONLY; Returns the Object ID of the user who updated the ImmutabilityPolicy.
+ ObjectIdentifier *string
+
+ // READ-ONLY; Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy.
+ TenantID *string
+
+ // READ-ONLY; Returns the date and time the ImmutabilityPolicy was updated.
+ Timestamp *time.Time
+
+ // READ-ONLY; The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend.
+ Update *ImmutabilityPolicyUpdateType
+
+ // READ-ONLY; Returns the User Principal Name of the user who updated the ImmutabilityPolicy.
+ Upn *string
+}
+
+// Usage - Describes Storage Resource Usage.
+type Usage struct {
+ // READ-ONLY; Gets the current count of the allocated resources in the subscription.
+ CurrentValue *int32
+
+ // READ-ONLY; Gets the maximum count of the resources that can be allocated in the subscription.
+ Limit *int32
+
+ // READ-ONLY; Gets the name of the type of usage.
+ Name *UsageName
+
+ // READ-ONLY; Gets the unit of measurement.
+ Unit *UsageUnit
+}
+
+// UsageListResult - The response from the List Usages operation.
+type UsageListResult struct {
+ // Gets or sets the list of Storage Resource Usages.
+ Value []*Usage
+}
+
+// UsageName - The usage names that can be used; currently limited to StorageAccount.
+type UsageName struct {
+ // READ-ONLY; Gets a localized string describing the resource name.
+ LocalizedValue *string
+
+ // READ-ONLY; Gets a string describing the resource name.
+ Value *string
+}
+
+// UserAssignedIdentity for the resource.
+type UserAssignedIdentity struct {
+ // READ-ONLY; The client ID of the identity.
+ ClientID *string
+
+ // READ-ONLY; The principal ID of the identity.
+ PrincipalID *string
+}
+
+// VirtualNetworkRule - Virtual Network rule.
+type VirtualNetworkRule struct {
+ // REQUIRED; Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
+ VirtualNetworkResourceID *string
+
+ // The action of virtual network rule.
+ Action *string
+
+ // Gets the state of virtual network rule.
+ State *State
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models_serde.go
new file mode 100644
index 000000000..0c96a0902
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models_serde.go
@@ -0,0 +1,6851 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+)
+
+// MarshalJSON implements the json.Marshaller interface for type AccessPolicy.
+func (a AccessPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "expiryTime", a.ExpiryTime)
+ populate(objectMap, "permission", a.Permission)
+ populateDateTimeRFC3339(objectMap, "startTime", a.StartTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccessPolicy.
+func (a *AccessPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "expiryTime":
+ err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &a.ExpiryTime)
+ delete(rawMsg, key)
+ case "permission":
+ err = unpopulate(val, "Permission", &a.Permission)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulateDateTimeRFC3339(val, "StartTime", &a.StartTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Account.
+func (a Account) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", a.ExtendedLocation)
+ populate(objectMap, "id", a.ID)
+ populate(objectMap, "identity", a.Identity)
+ populate(objectMap, "kind", a.Kind)
+ populate(objectMap, "location", a.Location)
+ populate(objectMap, "name", a.Name)
+ populate(objectMap, "properties", a.Properties)
+ populate(objectMap, "sku", a.SKU)
+ populate(objectMap, "tags", a.Tags)
+ populate(objectMap, "type", a.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Account.
+func (a *Account) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &a.ExtendedLocation)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &a.ID)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &a.Identity)
+ delete(rawMsg, key)
+ case "kind":
+ err = unpopulate(val, "Kind", &a.Kind)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &a.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &a.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &a.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &a.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &a.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountCheckNameAvailabilityParameters.
+func (a AccountCheckNameAvailabilityParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", a.Name)
+ objectMap["type"] = "Microsoft.Storage/storageAccounts"
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountCheckNameAvailabilityParameters.
+func (a *AccountCheckNameAvailabilityParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &a.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountCreateParameters.
+func (a AccountCreateParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "extendedLocation", a.ExtendedLocation)
+ populate(objectMap, "identity", a.Identity)
+ populate(objectMap, "kind", a.Kind)
+ populate(objectMap, "location", a.Location)
+ populate(objectMap, "properties", a.Properties)
+ populate(objectMap, "sku", a.SKU)
+ populate(objectMap, "tags", a.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountCreateParameters.
+func (a *AccountCreateParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "extendedLocation":
+ err = unpopulate(val, "ExtendedLocation", &a.ExtendedLocation)
+ delete(rawMsg, key)
+ case "identity":
+ err = unpopulate(val, "Identity", &a.Identity)
+ delete(rawMsg, key)
+ case "kind":
+ err = unpopulate(val, "Kind", &a.Kind)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &a.Location)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &a.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &a.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &a.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountImmutabilityPolicyProperties.
+func (a AccountImmutabilityPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowProtectedAppendWrites", a.AllowProtectedAppendWrites)
+ populate(objectMap, "immutabilityPeriodSinceCreationInDays", a.ImmutabilityPeriodSinceCreationInDays)
+ populate(objectMap, "state", a.State)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountImmutabilityPolicyProperties.
+func (a *AccountImmutabilityPolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowProtectedAppendWrites":
+ err = unpopulate(val, "AllowProtectedAppendWrites", &a.AllowProtectedAppendWrites)
+ delete(rawMsg, key)
+ case "immutabilityPeriodSinceCreationInDays":
+ err = unpopulate(val, "ImmutabilityPeriodSinceCreationInDays", &a.ImmutabilityPeriodSinceCreationInDays)
+ delete(rawMsg, key)
+ case "state":
+ err = unpopulate(val, "State", &a.State)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountInternetEndpoints.
+func (a AccountInternetEndpoints) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blob", a.Blob)
+ populate(objectMap, "dfs", a.Dfs)
+ populate(objectMap, "file", a.File)
+ populate(objectMap, "web", a.Web)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountInternetEndpoints.
+func (a *AccountInternetEndpoints) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blob":
+ err = unpopulate(val, "Blob", &a.Blob)
+ delete(rawMsg, key)
+ case "dfs":
+ err = unpopulate(val, "Dfs", &a.Dfs)
+ delete(rawMsg, key)
+ case "file":
+ err = unpopulate(val, "File", &a.File)
+ delete(rawMsg, key)
+ case "web":
+ err = unpopulate(val, "Web", &a.Web)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountKey.
+func (a AccountKey) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "creationTime", a.CreationTime)
+ populate(objectMap, "keyName", a.KeyName)
+ populate(objectMap, "permissions", a.Permissions)
+ populate(objectMap, "value", a.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountKey.
+func (a *AccountKey) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "creationTime":
+ err = unpopulateDateTimeRFC3339(val, "CreationTime", &a.CreationTime)
+ delete(rawMsg, key)
+ case "keyName":
+ err = unpopulate(val, "KeyName", &a.KeyName)
+ delete(rawMsg, key)
+ case "permissions":
+ err = unpopulate(val, "Permissions", &a.Permissions)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &a.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountListKeysResult.
+func (a AccountListKeysResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "keys", a.Keys)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountListKeysResult.
+func (a *AccountListKeysResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "keys":
+ err = unpopulate(val, "Keys", &a.Keys)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountListResult.
+func (a AccountListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", a.NextLink)
+ populate(objectMap, "value", a.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountListResult.
+func (a *AccountListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &a.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &a.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountMicrosoftEndpoints.
+func (a AccountMicrosoftEndpoints) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blob", a.Blob)
+ populate(objectMap, "dfs", a.Dfs)
+ populate(objectMap, "file", a.File)
+ populate(objectMap, "queue", a.Queue)
+ populate(objectMap, "table", a.Table)
+ populate(objectMap, "web", a.Web)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountMicrosoftEndpoints.
+func (a *AccountMicrosoftEndpoints) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blob":
+ err = unpopulate(val, "Blob", &a.Blob)
+ delete(rawMsg, key)
+ case "dfs":
+ err = unpopulate(val, "Dfs", &a.Dfs)
+ delete(rawMsg, key)
+ case "file":
+ err = unpopulate(val, "File", &a.File)
+ delete(rawMsg, key)
+ case "queue":
+ err = unpopulate(val, "Queue", &a.Queue)
+ delete(rawMsg, key)
+ case "table":
+ err = unpopulate(val, "Table", &a.Table)
+ delete(rawMsg, key)
+ case "web":
+ err = unpopulate(val, "Web", &a.Web)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountMigration.
+func (a AccountMigration) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", a.ID)
+ populate(objectMap, "name", a.Name)
+ populate(objectMap, "properties", a.StorageAccountMigrationDetails)
+ populate(objectMap, "type", a.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountMigration.
+func (a *AccountMigration) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &a.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &a.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "StorageAccountMigrationDetails", &a.StorageAccountMigrationDetails)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountMigrationProperties.
+func (a AccountMigrationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "migrationFailedDetailedReason", a.MigrationFailedDetailedReason)
+ populate(objectMap, "migrationFailedReason", a.MigrationFailedReason)
+ populate(objectMap, "migrationStatus", a.MigrationStatus)
+ populate(objectMap, "targetSkuName", a.TargetSKUName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountMigrationProperties.
+func (a *AccountMigrationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "migrationFailedDetailedReason":
+ err = unpopulate(val, "MigrationFailedDetailedReason", &a.MigrationFailedDetailedReason)
+ delete(rawMsg, key)
+ case "migrationFailedReason":
+ err = unpopulate(val, "MigrationFailedReason", &a.MigrationFailedReason)
+ delete(rawMsg, key)
+ case "migrationStatus":
+ err = unpopulate(val, "MigrationStatus", &a.MigrationStatus)
+ delete(rawMsg, key)
+ case "targetSkuName":
+ err = unpopulate(val, "TargetSKUName", &a.TargetSKUName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountProperties.
+func (a AccountProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessTier", a.AccessTier)
+ populate(objectMap, "accountMigrationInProgress", a.AccountMigrationInProgress)
+ populate(objectMap, "allowBlobPublicAccess", a.AllowBlobPublicAccess)
+ populate(objectMap, "allowCrossTenantReplication", a.AllowCrossTenantReplication)
+ populate(objectMap, "allowSharedKeyAccess", a.AllowSharedKeyAccess)
+ populate(objectMap, "allowedCopyScope", a.AllowedCopyScope)
+ populate(objectMap, "azureFilesIdentityBasedAuthentication", a.AzureFilesIdentityBasedAuthentication)
+ populate(objectMap, "blobRestoreStatus", a.BlobRestoreStatus)
+ populateDateTimeRFC3339(objectMap, "creationTime", a.CreationTime)
+ populate(objectMap, "customDomain", a.CustomDomain)
+ populate(objectMap, "dnsEndpointType", a.DNSEndpointType)
+ populate(objectMap, "defaultToOAuthAuthentication", a.DefaultToOAuthAuthentication)
+ populate(objectMap, "supportsHttpsTrafficOnly", a.EnableHTTPSTrafficOnly)
+ populate(objectMap, "isNfsV3Enabled", a.EnableNfsV3)
+ populate(objectMap, "encryption", a.Encryption)
+ populate(objectMap, "failoverInProgress", a.FailoverInProgress)
+ populate(objectMap, "geoReplicationStats", a.GeoReplicationStats)
+ populate(objectMap, "immutableStorageWithVersioning", a.ImmutableStorageWithVersioning)
+ populate(objectMap, "isHnsEnabled", a.IsHnsEnabled)
+ populate(objectMap, "isLocalUserEnabled", a.IsLocalUserEnabled)
+ populate(objectMap, "isSkuConversionBlocked", a.IsSKUConversionBlocked)
+ populate(objectMap, "isSftpEnabled", a.IsSftpEnabled)
+ populate(objectMap, "keyCreationTime", a.KeyCreationTime)
+ populate(objectMap, "keyPolicy", a.KeyPolicy)
+ populate(objectMap, "largeFileSharesState", a.LargeFileSharesState)
+ populateDateTimeRFC3339(objectMap, "lastGeoFailoverTime", a.LastGeoFailoverTime)
+ populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion)
+ populate(objectMap, "networkAcls", a.NetworkRuleSet)
+ populate(objectMap, "primaryEndpoints", a.PrimaryEndpoints)
+ populate(objectMap, "primaryLocation", a.PrimaryLocation)
+ populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections)
+ populate(objectMap, "provisioningState", a.ProvisioningState)
+ populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess)
+ populate(objectMap, "routingPreference", a.RoutingPreference)
+ populate(objectMap, "sasPolicy", a.SasPolicy)
+ populate(objectMap, "secondaryEndpoints", a.SecondaryEndpoints)
+ populate(objectMap, "secondaryLocation", a.SecondaryLocation)
+ populate(objectMap, "statusOfPrimary", a.StatusOfPrimary)
+ populate(objectMap, "statusOfSecondary", a.StatusOfSecondary)
+ populate(objectMap, "storageAccountSkuConversionStatus", a.StorageAccountSKUConversionStatus)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountProperties.
+func (a *AccountProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessTier":
+ err = unpopulate(val, "AccessTier", &a.AccessTier)
+ delete(rawMsg, key)
+ case "accountMigrationInProgress":
+ err = unpopulate(val, "AccountMigrationInProgress", &a.AccountMigrationInProgress)
+ delete(rawMsg, key)
+ case "allowBlobPublicAccess":
+ err = unpopulate(val, "AllowBlobPublicAccess", &a.AllowBlobPublicAccess)
+ delete(rawMsg, key)
+ case "allowCrossTenantReplication":
+ err = unpopulate(val, "AllowCrossTenantReplication", &a.AllowCrossTenantReplication)
+ delete(rawMsg, key)
+ case "allowSharedKeyAccess":
+ err = unpopulate(val, "AllowSharedKeyAccess", &a.AllowSharedKeyAccess)
+ delete(rawMsg, key)
+ case "allowedCopyScope":
+ err = unpopulate(val, "AllowedCopyScope", &a.AllowedCopyScope)
+ delete(rawMsg, key)
+ case "azureFilesIdentityBasedAuthentication":
+ err = unpopulate(val, "AzureFilesIdentityBasedAuthentication", &a.AzureFilesIdentityBasedAuthentication)
+ delete(rawMsg, key)
+ case "blobRestoreStatus":
+ err = unpopulate(val, "BlobRestoreStatus", &a.BlobRestoreStatus)
+ delete(rawMsg, key)
+ case "creationTime":
+ err = unpopulateDateTimeRFC3339(val, "CreationTime", &a.CreationTime)
+ delete(rawMsg, key)
+ case "customDomain":
+ err = unpopulate(val, "CustomDomain", &a.CustomDomain)
+ delete(rawMsg, key)
+ case "dnsEndpointType":
+ err = unpopulate(val, "DNSEndpointType", &a.DNSEndpointType)
+ delete(rawMsg, key)
+ case "defaultToOAuthAuthentication":
+ err = unpopulate(val, "DefaultToOAuthAuthentication", &a.DefaultToOAuthAuthentication)
+ delete(rawMsg, key)
+ case "supportsHttpsTrafficOnly":
+ err = unpopulate(val, "EnableHTTPSTrafficOnly", &a.EnableHTTPSTrafficOnly)
+ delete(rawMsg, key)
+ case "isNfsV3Enabled":
+ err = unpopulate(val, "EnableNfsV3", &a.EnableNfsV3)
+ delete(rawMsg, key)
+ case "encryption":
+ err = unpopulate(val, "Encryption", &a.Encryption)
+ delete(rawMsg, key)
+ case "failoverInProgress":
+ err = unpopulate(val, "FailoverInProgress", &a.FailoverInProgress)
+ delete(rawMsg, key)
+ case "geoReplicationStats":
+ err = unpopulate(val, "GeoReplicationStats", &a.GeoReplicationStats)
+ delete(rawMsg, key)
+ case "immutableStorageWithVersioning":
+ err = unpopulate(val, "ImmutableStorageWithVersioning", &a.ImmutableStorageWithVersioning)
+ delete(rawMsg, key)
+ case "isHnsEnabled":
+ err = unpopulate(val, "IsHnsEnabled", &a.IsHnsEnabled)
+ delete(rawMsg, key)
+ case "isLocalUserEnabled":
+ err = unpopulate(val, "IsLocalUserEnabled", &a.IsLocalUserEnabled)
+ delete(rawMsg, key)
+ case "isSkuConversionBlocked":
+ err = unpopulate(val, "IsSKUConversionBlocked", &a.IsSKUConversionBlocked)
+ delete(rawMsg, key)
+ case "isSftpEnabled":
+ err = unpopulate(val, "IsSftpEnabled", &a.IsSftpEnabled)
+ delete(rawMsg, key)
+ case "keyCreationTime":
+ err = unpopulate(val, "KeyCreationTime", &a.KeyCreationTime)
+ delete(rawMsg, key)
+ case "keyPolicy":
+ err = unpopulate(val, "KeyPolicy", &a.KeyPolicy)
+ delete(rawMsg, key)
+ case "largeFileSharesState":
+ err = unpopulate(val, "LargeFileSharesState", &a.LargeFileSharesState)
+ delete(rawMsg, key)
+ case "lastGeoFailoverTime":
+ err = unpopulateDateTimeRFC3339(val, "LastGeoFailoverTime", &a.LastGeoFailoverTime)
+ delete(rawMsg, key)
+ case "minimumTlsVersion":
+ err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion)
+ delete(rawMsg, key)
+ case "networkAcls":
+ err = unpopulate(val, "NetworkRuleSet", &a.NetworkRuleSet)
+ delete(rawMsg, key)
+ case "primaryEndpoints":
+ err = unpopulate(val, "PrimaryEndpoints", &a.PrimaryEndpoints)
+ delete(rawMsg, key)
+ case "primaryLocation":
+ err = unpopulate(val, "PrimaryLocation", &a.PrimaryLocation)
+ delete(rawMsg, key)
+ case "privateEndpointConnections":
+ err = unpopulate(val, "PrivateEndpointConnections", &a.PrivateEndpointConnections)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &a.ProvisioningState)
+ delete(rawMsg, key)
+ case "publicNetworkAccess":
+ err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess)
+ delete(rawMsg, key)
+ case "routingPreference":
+ err = unpopulate(val, "RoutingPreference", &a.RoutingPreference)
+ delete(rawMsg, key)
+ case "sasPolicy":
+ err = unpopulate(val, "SasPolicy", &a.SasPolicy)
+ delete(rawMsg, key)
+ case "secondaryEndpoints":
+ err = unpopulate(val, "SecondaryEndpoints", &a.SecondaryEndpoints)
+ delete(rawMsg, key)
+ case "secondaryLocation":
+ err = unpopulate(val, "SecondaryLocation", &a.SecondaryLocation)
+ delete(rawMsg, key)
+ case "statusOfPrimary":
+ err = unpopulate(val, "StatusOfPrimary", &a.StatusOfPrimary)
+ delete(rawMsg, key)
+ case "statusOfSecondary":
+ err = unpopulate(val, "StatusOfSecondary", &a.StatusOfSecondary)
+ delete(rawMsg, key)
+ case "storageAccountSkuConversionStatus":
+ err = unpopulate(val, "StorageAccountSKUConversionStatus", &a.StorageAccountSKUConversionStatus)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountPropertiesCreateParameters.
+func (a AccountPropertiesCreateParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessTier", a.AccessTier)
+ populate(objectMap, "allowBlobPublicAccess", a.AllowBlobPublicAccess)
+ populate(objectMap, "allowCrossTenantReplication", a.AllowCrossTenantReplication)
+ populate(objectMap, "allowSharedKeyAccess", a.AllowSharedKeyAccess)
+ populate(objectMap, "allowedCopyScope", a.AllowedCopyScope)
+ populate(objectMap, "azureFilesIdentityBasedAuthentication", a.AzureFilesIdentityBasedAuthentication)
+ populate(objectMap, "customDomain", a.CustomDomain)
+ populate(objectMap, "dnsEndpointType", a.DNSEndpointType)
+ populate(objectMap, "defaultToOAuthAuthentication", a.DefaultToOAuthAuthentication)
+ populate(objectMap, "supportsHttpsTrafficOnly", a.EnableHTTPSTrafficOnly)
+ populate(objectMap, "isNfsV3Enabled", a.EnableNfsV3)
+ populate(objectMap, "encryption", a.Encryption)
+ populate(objectMap, "immutableStorageWithVersioning", a.ImmutableStorageWithVersioning)
+ populate(objectMap, "isHnsEnabled", a.IsHnsEnabled)
+ populate(objectMap, "isLocalUserEnabled", a.IsLocalUserEnabled)
+ populate(objectMap, "isSftpEnabled", a.IsSftpEnabled)
+ populate(objectMap, "keyPolicy", a.KeyPolicy)
+ populate(objectMap, "largeFileSharesState", a.LargeFileSharesState)
+ populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion)
+ populate(objectMap, "networkAcls", a.NetworkRuleSet)
+ populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess)
+ populate(objectMap, "routingPreference", a.RoutingPreference)
+ populate(objectMap, "sasPolicy", a.SasPolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountPropertiesCreateParameters.
+func (a *AccountPropertiesCreateParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessTier":
+ err = unpopulate(val, "AccessTier", &a.AccessTier)
+ delete(rawMsg, key)
+ case "allowBlobPublicAccess":
+ err = unpopulate(val, "AllowBlobPublicAccess", &a.AllowBlobPublicAccess)
+ delete(rawMsg, key)
+ case "allowCrossTenantReplication":
+ err = unpopulate(val, "AllowCrossTenantReplication", &a.AllowCrossTenantReplication)
+ delete(rawMsg, key)
+ case "allowSharedKeyAccess":
+ err = unpopulate(val, "AllowSharedKeyAccess", &a.AllowSharedKeyAccess)
+ delete(rawMsg, key)
+ case "allowedCopyScope":
+ err = unpopulate(val, "AllowedCopyScope", &a.AllowedCopyScope)
+ delete(rawMsg, key)
+ case "azureFilesIdentityBasedAuthentication":
+ err = unpopulate(val, "AzureFilesIdentityBasedAuthentication", &a.AzureFilesIdentityBasedAuthentication)
+ delete(rawMsg, key)
+ case "customDomain":
+ err = unpopulate(val, "CustomDomain", &a.CustomDomain)
+ delete(rawMsg, key)
+ case "dnsEndpointType":
+ err = unpopulate(val, "DNSEndpointType", &a.DNSEndpointType)
+ delete(rawMsg, key)
+ case "defaultToOAuthAuthentication":
+ err = unpopulate(val, "DefaultToOAuthAuthentication", &a.DefaultToOAuthAuthentication)
+ delete(rawMsg, key)
+ case "supportsHttpsTrafficOnly":
+ err = unpopulate(val, "EnableHTTPSTrafficOnly", &a.EnableHTTPSTrafficOnly)
+ delete(rawMsg, key)
+ case "isNfsV3Enabled":
+ err = unpopulate(val, "EnableNfsV3", &a.EnableNfsV3)
+ delete(rawMsg, key)
+ case "encryption":
+ err = unpopulate(val, "Encryption", &a.Encryption)
+ delete(rawMsg, key)
+ case "immutableStorageWithVersioning":
+ err = unpopulate(val, "ImmutableStorageWithVersioning", &a.ImmutableStorageWithVersioning)
+ delete(rawMsg, key)
+ case "isHnsEnabled":
+ err = unpopulate(val, "IsHnsEnabled", &a.IsHnsEnabled)
+ delete(rawMsg, key)
+ case "isLocalUserEnabled":
+ err = unpopulate(val, "IsLocalUserEnabled", &a.IsLocalUserEnabled)
+ delete(rawMsg, key)
+ case "isSftpEnabled":
+ err = unpopulate(val, "IsSftpEnabled", &a.IsSftpEnabled)
+ delete(rawMsg, key)
+ case "keyPolicy":
+ err = unpopulate(val, "KeyPolicy", &a.KeyPolicy)
+ delete(rawMsg, key)
+ case "largeFileSharesState":
+ err = unpopulate(val, "LargeFileSharesState", &a.LargeFileSharesState)
+ delete(rawMsg, key)
+ case "minimumTlsVersion":
+ err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion)
+ delete(rawMsg, key)
+ case "networkAcls":
+ err = unpopulate(val, "NetworkRuleSet", &a.NetworkRuleSet)
+ delete(rawMsg, key)
+ case "publicNetworkAccess":
+ err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess)
+ delete(rawMsg, key)
+ case "routingPreference":
+ err = unpopulate(val, "RoutingPreference", &a.RoutingPreference)
+ delete(rawMsg, key)
+ case "sasPolicy":
+ err = unpopulate(val, "SasPolicy", &a.SasPolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountPropertiesUpdateParameters.
+func (a AccountPropertiesUpdateParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessTier", a.AccessTier)
+ populate(objectMap, "allowBlobPublicAccess", a.AllowBlobPublicAccess)
+ populate(objectMap, "allowCrossTenantReplication", a.AllowCrossTenantReplication)
+ populate(objectMap, "allowSharedKeyAccess", a.AllowSharedKeyAccess)
+ populate(objectMap, "allowedCopyScope", a.AllowedCopyScope)
+ populate(objectMap, "azureFilesIdentityBasedAuthentication", a.AzureFilesIdentityBasedAuthentication)
+ populate(objectMap, "customDomain", a.CustomDomain)
+ populate(objectMap, "dnsEndpointType", a.DNSEndpointType)
+ populate(objectMap, "defaultToOAuthAuthentication", a.DefaultToOAuthAuthentication)
+ populate(objectMap, "supportsHttpsTrafficOnly", a.EnableHTTPSTrafficOnly)
+ populate(objectMap, "encryption", a.Encryption)
+ populate(objectMap, "immutableStorageWithVersioning", a.ImmutableStorageWithVersioning)
+ populate(objectMap, "isLocalUserEnabled", a.IsLocalUserEnabled)
+ populate(objectMap, "isSftpEnabled", a.IsSftpEnabled)
+ populate(objectMap, "keyPolicy", a.KeyPolicy)
+ populate(objectMap, "largeFileSharesState", a.LargeFileSharesState)
+ populate(objectMap, "minimumTlsVersion", a.MinimumTLSVersion)
+ populate(objectMap, "networkAcls", a.NetworkRuleSet)
+ populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess)
+ populate(objectMap, "routingPreference", a.RoutingPreference)
+ populate(objectMap, "sasPolicy", a.SasPolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountPropertiesUpdateParameters.
+func (a *AccountPropertiesUpdateParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessTier":
+ err = unpopulate(val, "AccessTier", &a.AccessTier)
+ delete(rawMsg, key)
+ case "allowBlobPublicAccess":
+ err = unpopulate(val, "AllowBlobPublicAccess", &a.AllowBlobPublicAccess)
+ delete(rawMsg, key)
+ case "allowCrossTenantReplication":
+ err = unpopulate(val, "AllowCrossTenantReplication", &a.AllowCrossTenantReplication)
+ delete(rawMsg, key)
+ case "allowSharedKeyAccess":
+ err = unpopulate(val, "AllowSharedKeyAccess", &a.AllowSharedKeyAccess)
+ delete(rawMsg, key)
+ case "allowedCopyScope":
+ err = unpopulate(val, "AllowedCopyScope", &a.AllowedCopyScope)
+ delete(rawMsg, key)
+ case "azureFilesIdentityBasedAuthentication":
+ err = unpopulate(val, "AzureFilesIdentityBasedAuthentication", &a.AzureFilesIdentityBasedAuthentication)
+ delete(rawMsg, key)
+ case "customDomain":
+ err = unpopulate(val, "CustomDomain", &a.CustomDomain)
+ delete(rawMsg, key)
+ case "dnsEndpointType":
+ err = unpopulate(val, "DNSEndpointType", &a.DNSEndpointType)
+ delete(rawMsg, key)
+ case "defaultToOAuthAuthentication":
+ err = unpopulate(val, "DefaultToOAuthAuthentication", &a.DefaultToOAuthAuthentication)
+ delete(rawMsg, key)
+ case "supportsHttpsTrafficOnly":
+ err = unpopulate(val, "EnableHTTPSTrafficOnly", &a.EnableHTTPSTrafficOnly)
+ delete(rawMsg, key)
+ case "encryption":
+ err = unpopulate(val, "Encryption", &a.Encryption)
+ delete(rawMsg, key)
+ case "immutableStorageWithVersioning":
+ err = unpopulate(val, "ImmutableStorageWithVersioning", &a.ImmutableStorageWithVersioning)
+ delete(rawMsg, key)
+ case "isLocalUserEnabled":
+ err = unpopulate(val, "IsLocalUserEnabled", &a.IsLocalUserEnabled)
+ delete(rawMsg, key)
+ case "isSftpEnabled":
+ err = unpopulate(val, "IsSftpEnabled", &a.IsSftpEnabled)
+ delete(rawMsg, key)
+ case "keyPolicy":
+ err = unpopulate(val, "KeyPolicy", &a.KeyPolicy)
+ delete(rawMsg, key)
+ case "largeFileSharesState":
+ err = unpopulate(val, "LargeFileSharesState", &a.LargeFileSharesState)
+ delete(rawMsg, key)
+ case "minimumTlsVersion":
+ err = unpopulate(val, "MinimumTLSVersion", &a.MinimumTLSVersion)
+ delete(rawMsg, key)
+ case "networkAcls":
+ err = unpopulate(val, "NetworkRuleSet", &a.NetworkRuleSet)
+ delete(rawMsg, key)
+ case "publicNetworkAccess":
+ err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess)
+ delete(rawMsg, key)
+ case "routingPreference":
+ err = unpopulate(val, "RoutingPreference", &a.RoutingPreference)
+ delete(rawMsg, key)
+ case "sasPolicy":
+ err = unpopulate(val, "SasPolicy", &a.SasPolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountRegenerateKeyParameters.
+func (a AccountRegenerateKeyParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "keyName", a.KeyName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountRegenerateKeyParameters.
+func (a *AccountRegenerateKeyParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "keyName":
+ err = unpopulate(val, "KeyName", &a.KeyName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountSKUConversionStatus.
+func (a AccountSKUConversionStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "endTime", a.EndTime)
+ populate(objectMap, "skuConversionStatus", a.SKUConversionStatus)
+ populate(objectMap, "startTime", a.StartTime)
+ populate(objectMap, "targetSkuName", a.TargetSKUName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountSKUConversionStatus.
+func (a *AccountSKUConversionStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endTime":
+ err = unpopulate(val, "EndTime", &a.EndTime)
+ delete(rawMsg, key)
+ case "skuConversionStatus":
+ err = unpopulate(val, "SKUConversionStatus", &a.SKUConversionStatus)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulate(val, "StartTime", &a.StartTime)
+ delete(rawMsg, key)
+ case "targetSkuName":
+ err = unpopulate(val, "TargetSKUName", &a.TargetSKUName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountSasParameters.
+func (a AccountSasParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "signedIp", a.IPAddressOrRange)
+ populate(objectMap, "keyToSign", a.KeyToSign)
+ populate(objectMap, "signedPermission", a.Permissions)
+ populate(objectMap, "signedProtocol", a.Protocols)
+ populate(objectMap, "signedResourceTypes", a.ResourceTypes)
+ populate(objectMap, "signedServices", a.Services)
+ populateDateTimeRFC3339(objectMap, "signedExpiry", a.SharedAccessExpiryTime)
+ populateDateTimeRFC3339(objectMap, "signedStart", a.SharedAccessStartTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountSasParameters.
+func (a *AccountSasParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "signedIp":
+ err = unpopulate(val, "IPAddressOrRange", &a.IPAddressOrRange)
+ delete(rawMsg, key)
+ case "keyToSign":
+ err = unpopulate(val, "KeyToSign", &a.KeyToSign)
+ delete(rawMsg, key)
+ case "signedPermission":
+ err = unpopulate(val, "Permissions", &a.Permissions)
+ delete(rawMsg, key)
+ case "signedProtocol":
+ err = unpopulate(val, "Protocols", &a.Protocols)
+ delete(rawMsg, key)
+ case "signedResourceTypes":
+ err = unpopulate(val, "ResourceTypes", &a.ResourceTypes)
+ delete(rawMsg, key)
+ case "signedServices":
+ err = unpopulate(val, "Services", &a.Services)
+ delete(rawMsg, key)
+ case "signedExpiry":
+ err = unpopulateDateTimeRFC3339(val, "SharedAccessExpiryTime", &a.SharedAccessExpiryTime)
+ delete(rawMsg, key)
+ case "signedStart":
+ err = unpopulateDateTimeRFC3339(val, "SharedAccessStartTime", &a.SharedAccessStartTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AccountUpdateParameters.
+func (a AccountUpdateParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identity", a.Identity)
+ populate(objectMap, "kind", a.Kind)
+ populate(objectMap, "properties", a.Properties)
+ populate(objectMap, "sku", a.SKU)
+ populate(objectMap, "tags", a.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AccountUpdateParameters.
+func (a *AccountUpdateParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identity":
+ err = unpopulate(val, "Identity", &a.Identity)
+ delete(rawMsg, key)
+ case "kind":
+ err = unpopulate(val, "Kind", &a.Kind)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &a.Properties)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &a.SKU)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &a.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ActiveDirectoryProperties.
+func (a ActiveDirectoryProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accountType", a.AccountType)
+ populate(objectMap, "azureStorageSid", a.AzureStorageSid)
+ populate(objectMap, "domainGuid", a.DomainGUID)
+ populate(objectMap, "domainName", a.DomainName)
+ populate(objectMap, "domainSid", a.DomainSid)
+ populate(objectMap, "forestName", a.ForestName)
+ populate(objectMap, "netBiosDomainName", a.NetBiosDomainName)
+ populate(objectMap, "samAccountName", a.SamAccountName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveDirectoryProperties.
+func (a *ActiveDirectoryProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accountType":
+ err = unpopulate(val, "AccountType", &a.AccountType)
+ delete(rawMsg, key)
+ case "azureStorageSid":
+ err = unpopulate(val, "AzureStorageSid", &a.AzureStorageSid)
+ delete(rawMsg, key)
+ case "domainGuid":
+ err = unpopulate(val, "DomainGUID", &a.DomainGUID)
+ delete(rawMsg, key)
+ case "domainName":
+ err = unpopulate(val, "DomainName", &a.DomainName)
+ delete(rawMsg, key)
+ case "domainSid":
+ err = unpopulate(val, "DomainSid", &a.DomainSid)
+ delete(rawMsg, key)
+ case "forestName":
+ err = unpopulate(val, "ForestName", &a.ForestName)
+ delete(rawMsg, key)
+ case "netBiosDomainName":
+ err = unpopulate(val, "NetBiosDomainName", &a.NetBiosDomainName)
+ delete(rawMsg, key)
+ case "samAccountName":
+ err = unpopulate(val, "SamAccountName", &a.SamAccountName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AzureEntityResource.
+func (a AzureEntityResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", a.Etag)
+ populate(objectMap, "id", a.ID)
+ populate(objectMap, "name", a.Name)
+ populate(objectMap, "type", a.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AzureEntityResource.
+func (a *AzureEntityResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &a.Etag)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &a.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &a.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &a.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type AzureFilesIdentityBasedAuthentication.
+func (a AzureFilesIdentityBasedAuthentication) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "activeDirectoryProperties", a.ActiveDirectoryProperties)
+ populate(objectMap, "defaultSharePermission", a.DefaultSharePermission)
+ populate(objectMap, "directoryServiceOptions", a.DirectoryServiceOptions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFilesIdentityBasedAuthentication.
+func (a *AzureFilesIdentityBasedAuthentication) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "activeDirectoryProperties":
+ err = unpopulate(val, "ActiveDirectoryProperties", &a.ActiveDirectoryProperties)
+ delete(rawMsg, key)
+ case "defaultSharePermission":
+ err = unpopulate(val, "DefaultSharePermission", &a.DefaultSharePermission)
+ delete(rawMsg, key)
+ case "directoryServiceOptions":
+ err = unpopulate(val, "DirectoryServiceOptions", &a.DirectoryServiceOptions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", a, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobContainer.
+func (b BlobContainer) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", b.ContainerProperties)
+ populate(objectMap, "etag", b.Etag)
+ populate(objectMap, "id", b.ID)
+ populate(objectMap, "name", b.Name)
+ populate(objectMap, "type", b.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobContainer.
+func (b *BlobContainer) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "ContainerProperties", &b.ContainerProperties)
+ delete(rawMsg, key)
+ case "etag":
+ err = unpopulate(val, "Etag", &b.Etag)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &b.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &b.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &b.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryCreationTime.
+func (b BlobInventoryCreationTime) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "lastNDays", b.LastNDays)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryCreationTime.
+func (b *BlobInventoryCreationTime) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "lastNDays":
+ err = unpopulate(val, "LastNDays", &b.LastNDays)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicy.
+func (b BlobInventoryPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", b.ID)
+ populate(objectMap, "name", b.Name)
+ populate(objectMap, "properties", b.Properties)
+ populate(objectMap, "systemData", b.SystemData)
+ populate(objectMap, "type", b.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicy.
+func (b *BlobInventoryPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &b.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &b.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &b.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &b.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &b.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyDefinition.
+func (b BlobInventoryPolicyDefinition) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "filters", b.Filters)
+ populate(objectMap, "format", b.Format)
+ populate(objectMap, "objectType", b.ObjectType)
+ populate(objectMap, "schedule", b.Schedule)
+ populate(objectMap, "schemaFields", b.SchemaFields)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyDefinition.
+func (b *BlobInventoryPolicyDefinition) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "filters":
+ err = unpopulate(val, "Filters", &b.Filters)
+ delete(rawMsg, key)
+ case "format":
+ err = unpopulate(val, "Format", &b.Format)
+ delete(rawMsg, key)
+ case "objectType":
+ err = unpopulate(val, "ObjectType", &b.ObjectType)
+ delete(rawMsg, key)
+ case "schedule":
+ err = unpopulate(val, "Schedule", &b.Schedule)
+ delete(rawMsg, key)
+ case "schemaFields":
+ err = unpopulate(val, "SchemaFields", &b.SchemaFields)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyFilter.
+func (b BlobInventoryPolicyFilter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobTypes", b.BlobTypes)
+ populate(objectMap, "creationTime", b.CreationTime)
+ populate(objectMap, "excludePrefix", b.ExcludePrefix)
+ populate(objectMap, "includeBlobVersions", b.IncludeBlobVersions)
+ populate(objectMap, "includeDeleted", b.IncludeDeleted)
+ populate(objectMap, "includeSnapshots", b.IncludeSnapshots)
+ populate(objectMap, "prefixMatch", b.PrefixMatch)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyFilter.
+func (b *BlobInventoryPolicyFilter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobTypes":
+ err = unpopulate(val, "BlobTypes", &b.BlobTypes)
+ delete(rawMsg, key)
+ case "creationTime":
+ err = unpopulate(val, "CreationTime", &b.CreationTime)
+ delete(rawMsg, key)
+ case "excludePrefix":
+ err = unpopulate(val, "ExcludePrefix", &b.ExcludePrefix)
+ delete(rawMsg, key)
+ case "includeBlobVersions":
+ err = unpopulate(val, "IncludeBlobVersions", &b.IncludeBlobVersions)
+ delete(rawMsg, key)
+ case "includeDeleted":
+ err = unpopulate(val, "IncludeDeleted", &b.IncludeDeleted)
+ delete(rawMsg, key)
+ case "includeSnapshots":
+ err = unpopulate(val, "IncludeSnapshots", &b.IncludeSnapshots)
+ delete(rawMsg, key)
+ case "prefixMatch":
+ err = unpopulate(val, "PrefixMatch", &b.PrefixMatch)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyProperties.
+func (b BlobInventoryPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", b.LastModifiedTime)
+ populate(objectMap, "policy", b.Policy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyProperties.
+func (b *BlobInventoryPolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &b.LastModifiedTime)
+ delete(rawMsg, key)
+ case "policy":
+ err = unpopulate(val, "Policy", &b.Policy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicyRule.
+func (b BlobInventoryPolicyRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "definition", b.Definition)
+ populate(objectMap, "destination", b.Destination)
+ populate(objectMap, "enabled", b.Enabled)
+ populate(objectMap, "name", b.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicyRule.
+func (b *BlobInventoryPolicyRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "definition":
+ err = unpopulate(val, "Definition", &b.Definition)
+ delete(rawMsg, key)
+ case "destination":
+ err = unpopulate(val, "Destination", &b.Destination)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &b.Enabled)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &b.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobInventoryPolicySchema.
+func (b BlobInventoryPolicySchema) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "destination", b.Destination)
+ populate(objectMap, "enabled", b.Enabled)
+ populate(objectMap, "rules", b.Rules)
+ populate(objectMap, "type", b.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobInventoryPolicySchema.
+func (b *BlobInventoryPolicySchema) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "destination":
+ err = unpopulate(val, "Destination", &b.Destination)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &b.Enabled)
+ delete(rawMsg, key)
+ case "rules":
+ err = unpopulate(val, "Rules", &b.Rules)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &b.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobRestoreParameters.
+func (b BlobRestoreParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobRanges", b.BlobRanges)
+ populateDateTimeRFC3339(objectMap, "timeToRestore", b.TimeToRestore)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobRestoreParameters.
+func (b *BlobRestoreParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobRanges":
+ err = unpopulate(val, "BlobRanges", &b.BlobRanges)
+ delete(rawMsg, key)
+ case "timeToRestore":
+ err = unpopulateDateTimeRFC3339(val, "TimeToRestore", &b.TimeToRestore)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobRestoreRange.
+func (b BlobRestoreRange) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "endRange", b.EndRange)
+ populate(objectMap, "startRange", b.StartRange)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobRestoreRange.
+func (b *BlobRestoreRange) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "endRange":
+ err = unpopulate(val, "EndRange", &b.EndRange)
+ delete(rawMsg, key)
+ case "startRange":
+ err = unpopulate(val, "StartRange", &b.StartRange)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobRestoreStatus.
+func (b BlobRestoreStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "failureReason", b.FailureReason)
+ populate(objectMap, "parameters", b.Parameters)
+ populate(objectMap, "restoreId", b.RestoreID)
+ populate(objectMap, "status", b.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobRestoreStatus.
+func (b *BlobRestoreStatus) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "failureReason":
+ err = unpopulate(val, "FailureReason", &b.FailureReason)
+ delete(rawMsg, key)
+ case "parameters":
+ err = unpopulate(val, "Parameters", &b.Parameters)
+ delete(rawMsg, key)
+ case "restoreId":
+ err = unpopulate(val, "RestoreID", &b.RestoreID)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &b.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobServiceItems.
+func (b BlobServiceItems) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", b.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobServiceItems.
+func (b *BlobServiceItems) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &b.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobServiceProperties.
+func (b BlobServiceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", b.BlobServiceProperties)
+ populate(objectMap, "id", b.ID)
+ populate(objectMap, "name", b.Name)
+ populate(objectMap, "sku", b.SKU)
+ populate(objectMap, "type", b.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobServiceProperties.
+func (b *BlobServiceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "BlobServiceProperties", &b.BlobServiceProperties)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &b.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &b.Name)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &b.SKU)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &b.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type BlobServicePropertiesProperties.
+func (b BlobServicePropertiesProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "automaticSnapshotPolicyEnabled", b.AutomaticSnapshotPolicyEnabled)
+ populate(objectMap, "changeFeed", b.ChangeFeed)
+ populate(objectMap, "containerDeleteRetentionPolicy", b.ContainerDeleteRetentionPolicy)
+ populate(objectMap, "cors", b.Cors)
+ populate(objectMap, "defaultServiceVersion", b.DefaultServiceVersion)
+ populate(objectMap, "deleteRetentionPolicy", b.DeleteRetentionPolicy)
+ populate(objectMap, "isVersioningEnabled", b.IsVersioningEnabled)
+ populate(objectMap, "lastAccessTimeTrackingPolicy", b.LastAccessTimeTrackingPolicy)
+ populate(objectMap, "restorePolicy", b.RestorePolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type BlobServicePropertiesProperties.
+func (b *BlobServicePropertiesProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "automaticSnapshotPolicyEnabled":
+ err = unpopulate(val, "AutomaticSnapshotPolicyEnabled", &b.AutomaticSnapshotPolicyEnabled)
+ delete(rawMsg, key)
+ case "changeFeed":
+ err = unpopulate(val, "ChangeFeed", &b.ChangeFeed)
+ delete(rawMsg, key)
+ case "containerDeleteRetentionPolicy":
+ err = unpopulate(val, "ContainerDeleteRetentionPolicy", &b.ContainerDeleteRetentionPolicy)
+ delete(rawMsg, key)
+ case "cors":
+ err = unpopulate(val, "Cors", &b.Cors)
+ delete(rawMsg, key)
+ case "defaultServiceVersion":
+ err = unpopulate(val, "DefaultServiceVersion", &b.DefaultServiceVersion)
+ delete(rawMsg, key)
+ case "deleteRetentionPolicy":
+ err = unpopulate(val, "DeleteRetentionPolicy", &b.DeleteRetentionPolicy)
+ delete(rawMsg, key)
+ case "isVersioningEnabled":
+ err = unpopulate(val, "IsVersioningEnabled", &b.IsVersioningEnabled)
+ delete(rawMsg, key)
+ case "lastAccessTimeTrackingPolicy":
+ err = unpopulate(val, "LastAccessTimeTrackingPolicy", &b.LastAccessTimeTrackingPolicy)
+ delete(rawMsg, key)
+ case "restorePolicy":
+ err = unpopulate(val, "RestorePolicy", &b.RestorePolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", b, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ChangeFeed.
+func (c ChangeFeed) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", c.Enabled)
+ populate(objectMap, "retentionInDays", c.RetentionInDays)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ChangeFeed.
+func (c *ChangeFeed) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &c.Enabled)
+ delete(rawMsg, key)
+ case "retentionInDays":
+ err = unpopulate(val, "RetentionInDays", &c.RetentionInDays)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResult.
+func (c CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "message", c.Message)
+ populate(objectMap, "nameAvailable", c.NameAvailable)
+ populate(objectMap, "reason", c.Reason)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResult.
+func (c *CheckNameAvailabilityResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "message":
+ err = unpopulate(val, "Message", &c.Message)
+ delete(rawMsg, key)
+ case "nameAvailable":
+ err = unpopulate(val, "NameAvailable", &c.NameAvailable)
+ delete(rawMsg, key)
+ case "reason":
+ err = unpopulate(val, "Reason", &c.Reason)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ContainerProperties.
+func (c ContainerProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "defaultEncryptionScope", c.DefaultEncryptionScope)
+ populate(objectMap, "deleted", c.Deleted)
+ populateDateTimeRFC3339(objectMap, "deletedTime", c.DeletedTime)
+ populate(objectMap, "denyEncryptionScopeOverride", c.DenyEncryptionScopeOverride)
+ populate(objectMap, "enableNfsV3AllSquash", c.EnableNfsV3AllSquash)
+ populate(objectMap, "enableNfsV3RootSquash", c.EnableNfsV3RootSquash)
+ populate(objectMap, "hasImmutabilityPolicy", c.HasImmutabilityPolicy)
+ populate(objectMap, "hasLegalHold", c.HasLegalHold)
+ populate(objectMap, "immutabilityPolicy", c.ImmutabilityPolicy)
+ populate(objectMap, "immutableStorageWithVersioning", c.ImmutableStorageWithVersioning)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", c.LastModifiedTime)
+ populate(objectMap, "leaseDuration", c.LeaseDuration)
+ populate(objectMap, "leaseState", c.LeaseState)
+ populate(objectMap, "leaseStatus", c.LeaseStatus)
+ populate(objectMap, "legalHold", c.LegalHold)
+ populate(objectMap, "metadata", c.Metadata)
+ populate(objectMap, "publicAccess", c.PublicAccess)
+ populate(objectMap, "remainingRetentionDays", c.RemainingRetentionDays)
+ populate(objectMap, "version", c.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProperties.
+func (c *ContainerProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "defaultEncryptionScope":
+ err = unpopulate(val, "DefaultEncryptionScope", &c.DefaultEncryptionScope)
+ delete(rawMsg, key)
+ case "deleted":
+ err = unpopulate(val, "Deleted", &c.Deleted)
+ delete(rawMsg, key)
+ case "deletedTime":
+ err = unpopulateDateTimeRFC3339(val, "DeletedTime", &c.DeletedTime)
+ delete(rawMsg, key)
+ case "denyEncryptionScopeOverride":
+ err = unpopulate(val, "DenyEncryptionScopeOverride", &c.DenyEncryptionScopeOverride)
+ delete(rawMsg, key)
+ case "enableNfsV3AllSquash":
+ err = unpopulate(val, "EnableNfsV3AllSquash", &c.EnableNfsV3AllSquash)
+ delete(rawMsg, key)
+ case "enableNfsV3RootSquash":
+ err = unpopulate(val, "EnableNfsV3RootSquash", &c.EnableNfsV3RootSquash)
+ delete(rawMsg, key)
+ case "hasImmutabilityPolicy":
+ err = unpopulate(val, "HasImmutabilityPolicy", &c.HasImmutabilityPolicy)
+ delete(rawMsg, key)
+ case "hasLegalHold":
+ err = unpopulate(val, "HasLegalHold", &c.HasLegalHold)
+ delete(rawMsg, key)
+ case "immutabilityPolicy":
+ err = unpopulate(val, "ImmutabilityPolicy", &c.ImmutabilityPolicy)
+ delete(rawMsg, key)
+ case "immutableStorageWithVersioning":
+ err = unpopulate(val, "ImmutableStorageWithVersioning", &c.ImmutableStorageWithVersioning)
+ delete(rawMsg, key)
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &c.LastModifiedTime)
+ delete(rawMsg, key)
+ case "leaseDuration":
+ err = unpopulate(val, "LeaseDuration", &c.LeaseDuration)
+ delete(rawMsg, key)
+ case "leaseState":
+ err = unpopulate(val, "LeaseState", &c.LeaseState)
+ delete(rawMsg, key)
+ case "leaseStatus":
+ err = unpopulate(val, "LeaseStatus", &c.LeaseStatus)
+ delete(rawMsg, key)
+ case "legalHold":
+ err = unpopulate(val, "LegalHold", &c.LegalHold)
+ delete(rawMsg, key)
+ case "metadata":
+ err = unpopulate(val, "Metadata", &c.Metadata)
+ delete(rawMsg, key)
+ case "publicAccess":
+ err = unpopulate(val, "PublicAccess", &c.PublicAccess)
+ delete(rawMsg, key)
+ case "remainingRetentionDays":
+ err = unpopulate(val, "RemainingRetentionDays", &c.RemainingRetentionDays)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &c.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CorsRule.
+func (c CorsRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowedHeaders", c.AllowedHeaders)
+ populate(objectMap, "allowedMethods", c.AllowedMethods)
+ populate(objectMap, "allowedOrigins", c.AllowedOrigins)
+ populate(objectMap, "exposedHeaders", c.ExposedHeaders)
+ populate(objectMap, "maxAgeInSeconds", c.MaxAgeInSeconds)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CorsRule.
+func (c *CorsRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowedHeaders":
+ err = unpopulate(val, "AllowedHeaders", &c.AllowedHeaders)
+ delete(rawMsg, key)
+ case "allowedMethods":
+ err = unpopulate(val, "AllowedMethods", &c.AllowedMethods)
+ delete(rawMsg, key)
+ case "allowedOrigins":
+ err = unpopulate(val, "AllowedOrigins", &c.AllowedOrigins)
+ delete(rawMsg, key)
+ case "exposedHeaders":
+ err = unpopulate(val, "ExposedHeaders", &c.ExposedHeaders)
+ delete(rawMsg, key)
+ case "maxAgeInSeconds":
+ err = unpopulate(val, "MaxAgeInSeconds", &c.MaxAgeInSeconds)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CorsRules.
+func (c CorsRules) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "corsRules", c.CorsRules)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CorsRules.
+func (c *CorsRules) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "corsRules":
+ err = unpopulate(val, "CorsRules", &c.CorsRules)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type CustomDomain.
+func (c CustomDomain) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", c.Name)
+ populate(objectMap, "useSubDomainName", c.UseSubDomainName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomain.
+func (c *CustomDomain) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &c.Name)
+ delete(rawMsg, key)
+ case "useSubDomainName":
+ err = unpopulate(val, "UseSubDomainName", &c.UseSubDomainName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", c, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DateAfterCreation.
+func (d DateAfterCreation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "daysAfterCreationGreaterThan", d.DaysAfterCreationGreaterThan)
+ populate(objectMap, "daysAfterLastTierChangeGreaterThan", d.DaysAfterLastTierChangeGreaterThan)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DateAfterCreation.
+func (d *DateAfterCreation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "daysAfterCreationGreaterThan":
+ err = unpopulate(val, "DaysAfterCreationGreaterThan", &d.DaysAfterCreationGreaterThan)
+ delete(rawMsg, key)
+ case "daysAfterLastTierChangeGreaterThan":
+ err = unpopulate(val, "DaysAfterLastTierChangeGreaterThan", &d.DaysAfterLastTierChangeGreaterThan)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DateAfterModification.
+func (d DateAfterModification) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "daysAfterCreationGreaterThan", d.DaysAfterCreationGreaterThan)
+ populate(objectMap, "daysAfterLastAccessTimeGreaterThan", d.DaysAfterLastAccessTimeGreaterThan)
+ populate(objectMap, "daysAfterLastTierChangeGreaterThan", d.DaysAfterLastTierChangeGreaterThan)
+ populate(objectMap, "daysAfterModificationGreaterThan", d.DaysAfterModificationGreaterThan)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DateAfterModification.
+func (d *DateAfterModification) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "daysAfterCreationGreaterThan":
+ err = unpopulate(val, "DaysAfterCreationGreaterThan", &d.DaysAfterCreationGreaterThan)
+ delete(rawMsg, key)
+ case "daysAfterLastAccessTimeGreaterThan":
+ err = unpopulate(val, "DaysAfterLastAccessTimeGreaterThan", &d.DaysAfterLastAccessTimeGreaterThan)
+ delete(rawMsg, key)
+ case "daysAfterLastTierChangeGreaterThan":
+ err = unpopulate(val, "DaysAfterLastTierChangeGreaterThan", &d.DaysAfterLastTierChangeGreaterThan)
+ delete(rawMsg, key)
+ case "daysAfterModificationGreaterThan":
+ err = unpopulate(val, "DaysAfterModificationGreaterThan", &d.DaysAfterModificationGreaterThan)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeleteRetentionPolicy.
+func (d DeleteRetentionPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowPermanentDelete", d.AllowPermanentDelete)
+ populate(objectMap, "days", d.Days)
+ populate(objectMap, "enabled", d.Enabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeleteRetentionPolicy.
+func (d *DeleteRetentionPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowPermanentDelete":
+ err = unpopulate(val, "AllowPermanentDelete", &d.AllowPermanentDelete)
+ delete(rawMsg, key)
+ case "days":
+ err = unpopulate(val, "Days", &d.Days)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &d.Enabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeletedAccount.
+func (d DeletedAccount) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", d.ID)
+ populate(objectMap, "name", d.Name)
+ populate(objectMap, "properties", d.Properties)
+ populate(objectMap, "type", d.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedAccount.
+func (d *DeletedAccount) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &d.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &d.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &d.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeletedAccountListResult.
+func (d DeletedAccountListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", d.NextLink)
+ populate(objectMap, "value", d.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedAccountListResult.
+func (d *DeletedAccountListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &d.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &d.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeletedAccountProperties.
+func (d DeletedAccountProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "creationTime", d.CreationTime)
+ populate(objectMap, "deletionTime", d.DeletionTime)
+ populate(objectMap, "location", d.Location)
+ populate(objectMap, "restoreReference", d.RestoreReference)
+ populate(objectMap, "storageAccountResourceId", d.StorageAccountResourceID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedAccountProperties.
+func (d *DeletedAccountProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "creationTime":
+ err = unpopulate(val, "CreationTime", &d.CreationTime)
+ delete(rawMsg, key)
+ case "deletionTime":
+ err = unpopulate(val, "DeletionTime", &d.DeletionTime)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &d.Location)
+ delete(rawMsg, key)
+ case "restoreReference":
+ err = unpopulate(val, "RestoreReference", &d.RestoreReference)
+ delete(rawMsg, key)
+ case "storageAccountResourceId":
+ err = unpopulate(val, "StorageAccountResourceID", &d.StorageAccountResourceID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type DeletedShare.
+func (d DeletedShare) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "deletedShareName", d.DeletedShareName)
+ populate(objectMap, "deletedShareVersion", d.DeletedShareVersion)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedShare.
+func (d *DeletedShare) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "deletedShareName":
+ err = unpopulate(val, "DeletedShareName", &d.DeletedShareName)
+ delete(rawMsg, key)
+ case "deletedShareVersion":
+ err = unpopulate(val, "DeletedShareVersion", &d.DeletedShareVersion)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Dimension.
+func (d Dimension) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "displayName", d.DisplayName)
+ populate(objectMap, "name", d.Name)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Dimension.
+func (d *Dimension) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "displayName":
+ err = unpopulate(val, "DisplayName", &d.DisplayName)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &d.Name)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", d, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Encryption.
+func (e Encryption) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "identity", e.EncryptionIdentity)
+ populate(objectMap, "keySource", e.KeySource)
+ populate(objectMap, "keyvaultproperties", e.KeyVaultProperties)
+ populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption)
+ populate(objectMap, "services", e.Services)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Encryption.
+func (e *Encryption) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "identity":
+ err = unpopulate(val, "EncryptionIdentity", &e.EncryptionIdentity)
+ delete(rawMsg, key)
+ case "keySource":
+ err = unpopulate(val, "KeySource", &e.KeySource)
+ delete(rawMsg, key)
+ case "keyvaultproperties":
+ err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties)
+ delete(rawMsg, key)
+ case "requireInfrastructureEncryption":
+ err = unpopulate(val, "RequireInfrastructureEncryption", &e.RequireInfrastructureEncryption)
+ delete(rawMsg, key)
+ case "services":
+ err = unpopulate(val, "Services", &e.Services)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionIdentity.
+func (e EncryptionIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "federatedIdentityClientId", e.EncryptionFederatedIdentityClientID)
+ populate(objectMap, "userAssignedIdentity", e.EncryptionUserAssignedIdentity)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionIdentity.
+func (e *EncryptionIdentity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "federatedIdentityClientId":
+ err = unpopulate(val, "EncryptionFederatedIdentityClientID", &e.EncryptionFederatedIdentityClientID)
+ delete(rawMsg, key)
+ case "userAssignedIdentity":
+ err = unpopulate(val, "EncryptionUserAssignedIdentity", &e.EncryptionUserAssignedIdentity)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionScope.
+func (e EncryptionScope) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", e.EncryptionScopeProperties)
+ populate(objectMap, "id", e.ID)
+ populate(objectMap, "name", e.Name)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScope.
+func (e *EncryptionScope) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "EncryptionScopeProperties", &e.EncryptionScopeProperties)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &e.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &e.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionScopeKeyVaultProperties.
+func (e EncryptionScopeKeyVaultProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "currentVersionedKeyIdentifier", e.CurrentVersionedKeyIdentifier)
+ populate(objectMap, "keyUri", e.KeyURI)
+ populateDateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", e.LastKeyRotationTimestamp)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeKeyVaultProperties.
+func (e *EncryptionScopeKeyVaultProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "currentVersionedKeyIdentifier":
+ err = unpopulate(val, "CurrentVersionedKeyIdentifier", &e.CurrentVersionedKeyIdentifier)
+ delete(rawMsg, key)
+ case "keyUri":
+ err = unpopulate(val, "KeyURI", &e.KeyURI)
+ delete(rawMsg, key)
+ case "lastKeyRotationTimestamp":
+ err = unpopulateDateTimeRFC3339(val, "LastKeyRotationTimestamp", &e.LastKeyRotationTimestamp)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionScopeListResult.
+func (e EncryptionScopeListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", e.NextLink)
+ populate(objectMap, "value", e.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeListResult.
+func (e *EncryptionScopeListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &e.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &e.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionScopeProperties.
+func (e EncryptionScopeProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "creationTime", e.CreationTime)
+ populate(objectMap, "keyVaultProperties", e.KeyVaultProperties)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", e.LastModifiedTime)
+ populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption)
+ populate(objectMap, "source", e.Source)
+ populate(objectMap, "state", e.State)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeProperties.
+func (e *EncryptionScopeProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "creationTime":
+ err = unpopulateDateTimeRFC3339(val, "CreationTime", &e.CreationTime)
+ delete(rawMsg, key)
+ case "keyVaultProperties":
+ err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties)
+ delete(rawMsg, key)
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &e.LastModifiedTime)
+ delete(rawMsg, key)
+ case "requireInfrastructureEncryption":
+ err = unpopulate(val, "RequireInfrastructureEncryption", &e.RequireInfrastructureEncryption)
+ delete(rawMsg, key)
+ case "source":
+ err = unpopulate(val, "Source", &e.Source)
+ delete(rawMsg, key)
+ case "state":
+ err = unpopulate(val, "State", &e.State)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionService.
+func (e EncryptionService) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", e.Enabled)
+ populate(objectMap, "keyType", e.KeyType)
+ populateDateTimeRFC3339(objectMap, "lastEnabledTime", e.LastEnabledTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionService.
+func (e *EncryptionService) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &e.Enabled)
+ delete(rawMsg, key)
+ case "keyType":
+ err = unpopulate(val, "KeyType", &e.KeyType)
+ delete(rawMsg, key)
+ case "lastEnabledTime":
+ err = unpopulateDateTimeRFC3339(val, "LastEnabledTime", &e.LastEnabledTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type EncryptionServices.
+func (e EncryptionServices) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blob", e.Blob)
+ populate(objectMap, "file", e.File)
+ populate(objectMap, "queue", e.Queue)
+ populate(objectMap, "table", e.Table)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionServices.
+func (e *EncryptionServices) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blob":
+ err = unpopulate(val, "Blob", &e.Blob)
+ delete(rawMsg, key)
+ case "file":
+ err = unpopulate(val, "File", &e.File)
+ delete(rawMsg, key)
+ case "queue":
+ err = unpopulate(val, "Queue", &e.Queue)
+ delete(rawMsg, key)
+ case "table":
+ err = unpopulate(val, "Table", &e.Table)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Endpoints.
+func (e Endpoints) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blob", e.Blob)
+ populate(objectMap, "dfs", e.Dfs)
+ populate(objectMap, "file", e.File)
+ populate(objectMap, "internetEndpoints", e.InternetEndpoints)
+ populate(objectMap, "microsoftEndpoints", e.MicrosoftEndpoints)
+ populate(objectMap, "queue", e.Queue)
+ populate(objectMap, "table", e.Table)
+ populate(objectMap, "web", e.Web)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Endpoints.
+func (e *Endpoints) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blob":
+ err = unpopulate(val, "Blob", &e.Blob)
+ delete(rawMsg, key)
+ case "dfs":
+ err = unpopulate(val, "Dfs", &e.Dfs)
+ delete(rawMsg, key)
+ case "file":
+ err = unpopulate(val, "File", &e.File)
+ delete(rawMsg, key)
+ case "internetEndpoints":
+ err = unpopulate(val, "InternetEndpoints", &e.InternetEndpoints)
+ delete(rawMsg, key)
+ case "microsoftEndpoints":
+ err = unpopulate(val, "MicrosoftEndpoints", &e.MicrosoftEndpoints)
+ delete(rawMsg, key)
+ case "queue":
+ err = unpopulate(val, "Queue", &e.Queue)
+ delete(rawMsg, key)
+ case "table":
+ err = unpopulate(val, "Table", &e.Table)
+ delete(rawMsg, key)
+ case "web":
+ err = unpopulate(val, "Web", &e.Web)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.
+func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateAny(objectMap, "info", e.Info)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.
+func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "info":
+ err = unpopulate(val, "Info", &e.Info)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorDetail.
+func (e ErrorDetail) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "additionalInfo", e.AdditionalInfo)
+ populate(objectMap, "code", e.Code)
+ populate(objectMap, "details", e.Details)
+ populate(objectMap, "message", e.Message)
+ populate(objectMap, "target", e.Target)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.
+func (e *ErrorDetail) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "additionalInfo":
+ err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo)
+ delete(rawMsg, key)
+ case "code":
+ err = unpopulate(val, "Code", &e.Code)
+ delete(rawMsg, key)
+ case "details":
+ err = unpopulate(val, "Details", &e.Details)
+ delete(rawMsg, key)
+ case "message":
+ err = unpopulate(val, "Message", &e.Message)
+ delete(rawMsg, key)
+ case "target":
+ err = unpopulate(val, "Target", &e.Target)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorResponse.
+func (e ErrorResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", e.Error)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.
+func (e *ErrorResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &e.Error)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated.
+func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "error", e.Error)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated.
+func (e *ErrorResponseAutoGenerated) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "error":
+ err = unpopulate(val, "Error", &e.Error)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ErrorResponseBody.
+func (e ErrorResponseBody) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "code", e.Code)
+ populate(objectMap, "message", e.Message)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBody.
+func (e *ErrorResponseBody) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "code":
+ err = unpopulate(val, "Code", &e.Code)
+ delete(rawMsg, key)
+ case "message":
+ err = unpopulate(val, "Message", &e.Message)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation.
+func (e ExtendedLocation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", e.Name)
+ populate(objectMap, "type", e.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation.
+func (e *ExtendedLocation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &e.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &e.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", e, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileServiceItems.
+func (f FileServiceItems) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", f.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceItems.
+func (f *FileServiceItems) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &f.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileServiceProperties.
+func (f FileServiceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "properties", f.FileServiceProperties)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "sku", f.SKU)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceProperties.
+func (f *FileServiceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "properties":
+ err = unpopulate(val, "FileServiceProperties", &f.FileServiceProperties)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "sku":
+ err = unpopulate(val, "SKU", &f.SKU)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileServicePropertiesProperties.
+func (f FileServicePropertiesProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "cors", f.Cors)
+ populate(objectMap, "protocolSettings", f.ProtocolSettings)
+ populate(objectMap, "shareDeleteRetentionPolicy", f.ShareDeleteRetentionPolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileServicePropertiesProperties.
+func (f *FileServicePropertiesProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "cors":
+ err = unpopulate(val, "Cors", &f.Cors)
+ delete(rawMsg, key)
+ case "protocolSettings":
+ err = unpopulate(val, "ProtocolSettings", &f.ProtocolSettings)
+ delete(rawMsg, key)
+ case "shareDeleteRetentionPolicy":
+ err = unpopulate(val, "ShareDeleteRetentionPolicy", &f.ShareDeleteRetentionPolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileShare.
+func (f FileShare) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", f.Etag)
+ populate(objectMap, "properties", f.FileShareProperties)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileShare.
+func (f *FileShare) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &f.Etag)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "FileShareProperties", &f.FileShareProperties)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileShareItem.
+func (f FileShareItem) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", f.Etag)
+ populate(objectMap, "id", f.ID)
+ populate(objectMap, "name", f.Name)
+ populate(objectMap, "properties", f.Properties)
+ populate(objectMap, "type", f.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareItem.
+func (f *FileShareItem) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &f.Etag)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &f.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &f.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &f.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &f.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileShareItems.
+func (f FileShareItems) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", f.NextLink)
+ populate(objectMap, "value", f.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareItems.
+func (f *FileShareItems) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &f.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &f.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type FileShareProperties.
+func (f FileShareProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessTier", f.AccessTier)
+ populateDateTimeRFC3339(objectMap, "accessTierChangeTime", f.AccessTierChangeTime)
+ populate(objectMap, "accessTierStatus", f.AccessTierStatus)
+ populate(objectMap, "deleted", f.Deleted)
+ populateDateTimeRFC3339(objectMap, "deletedTime", f.DeletedTime)
+ populate(objectMap, "enabledProtocols", f.EnabledProtocols)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", f.LastModifiedTime)
+ populate(objectMap, "leaseDuration", f.LeaseDuration)
+ populate(objectMap, "leaseState", f.LeaseState)
+ populate(objectMap, "leaseStatus", f.LeaseStatus)
+ populate(objectMap, "metadata", f.Metadata)
+ populate(objectMap, "remainingRetentionDays", f.RemainingRetentionDays)
+ populate(objectMap, "rootSquash", f.RootSquash)
+ populate(objectMap, "shareQuota", f.ShareQuota)
+ populate(objectMap, "shareUsageBytes", f.ShareUsageBytes)
+ populate(objectMap, "signedIdentifiers", f.SignedIdentifiers)
+ populateDateTimeRFC3339(objectMap, "snapshotTime", f.SnapshotTime)
+ populate(objectMap, "version", f.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareProperties.
+func (f *FileShareProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessTier":
+ err = unpopulate(val, "AccessTier", &f.AccessTier)
+ delete(rawMsg, key)
+ case "accessTierChangeTime":
+ err = unpopulateDateTimeRFC3339(val, "AccessTierChangeTime", &f.AccessTierChangeTime)
+ delete(rawMsg, key)
+ case "accessTierStatus":
+ err = unpopulate(val, "AccessTierStatus", &f.AccessTierStatus)
+ delete(rawMsg, key)
+ case "deleted":
+ err = unpopulate(val, "Deleted", &f.Deleted)
+ delete(rawMsg, key)
+ case "deletedTime":
+ err = unpopulateDateTimeRFC3339(val, "DeletedTime", &f.DeletedTime)
+ delete(rawMsg, key)
+ case "enabledProtocols":
+ err = unpopulate(val, "EnabledProtocols", &f.EnabledProtocols)
+ delete(rawMsg, key)
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &f.LastModifiedTime)
+ delete(rawMsg, key)
+ case "leaseDuration":
+ err = unpopulate(val, "LeaseDuration", &f.LeaseDuration)
+ delete(rawMsg, key)
+ case "leaseState":
+ err = unpopulate(val, "LeaseState", &f.LeaseState)
+ delete(rawMsg, key)
+ case "leaseStatus":
+ err = unpopulate(val, "LeaseStatus", &f.LeaseStatus)
+ delete(rawMsg, key)
+ case "metadata":
+ err = unpopulate(val, "Metadata", &f.Metadata)
+ delete(rawMsg, key)
+ case "remainingRetentionDays":
+ err = unpopulate(val, "RemainingRetentionDays", &f.RemainingRetentionDays)
+ delete(rawMsg, key)
+ case "rootSquash":
+ err = unpopulate(val, "RootSquash", &f.RootSquash)
+ delete(rawMsg, key)
+ case "shareQuota":
+ err = unpopulate(val, "ShareQuota", &f.ShareQuota)
+ delete(rawMsg, key)
+ case "shareUsageBytes":
+ err = unpopulate(val, "ShareUsageBytes", &f.ShareUsageBytes)
+ delete(rawMsg, key)
+ case "signedIdentifiers":
+ err = unpopulate(val, "SignedIdentifiers", &f.SignedIdentifiers)
+ delete(rawMsg, key)
+ case "snapshotTime":
+ err = unpopulateDateTimeRFC3339(val, "SnapshotTime", &f.SnapshotTime)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &f.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", f, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type GeoReplicationStats.
+func (g GeoReplicationStats) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "canFailover", g.CanFailover)
+ populate(objectMap, "canPlannedFailover", g.CanPlannedFailover)
+ populateDateTimeRFC3339(objectMap, "lastSyncTime", g.LastSyncTime)
+ populate(objectMap, "postFailoverRedundancy", g.PostFailoverRedundancy)
+ populate(objectMap, "postPlannedFailoverRedundancy", g.PostPlannedFailoverRedundancy)
+ populate(objectMap, "status", g.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type GeoReplicationStats.
+func (g *GeoReplicationStats) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "canFailover":
+ err = unpopulate(val, "CanFailover", &g.CanFailover)
+ delete(rawMsg, key)
+ case "canPlannedFailover":
+ err = unpopulate(val, "CanPlannedFailover", &g.CanPlannedFailover)
+ delete(rawMsg, key)
+ case "lastSyncTime":
+ err = unpopulateDateTimeRFC3339(val, "LastSyncTime", &g.LastSyncTime)
+ delete(rawMsg, key)
+ case "postFailoverRedundancy":
+ err = unpopulate(val, "PostFailoverRedundancy", &g.PostFailoverRedundancy)
+ delete(rawMsg, key)
+ case "postPlannedFailoverRedundancy":
+ err = unpopulate(val, "PostPlannedFailoverRedundancy", &g.PostPlannedFailoverRedundancy)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &g.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", g, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type IPRule.
+func (i IPRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ objectMap["action"] = "Allow"
+ populate(objectMap, "value", i.IPAddressOrRange)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type IPRule.
+func (i *IPRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "action":
+ err = unpopulate(val, "Action", &i.Action)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "IPAddressOrRange", &i.IPAddressOrRange)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Identity.
+func (i Identity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "principalId", i.PrincipalID)
+ populate(objectMap, "tenantId", i.TenantID)
+ populate(objectMap, "type", i.Type)
+ populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Identity.
+func (i *Identity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &i.PrincipalID)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &i.TenantID)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &i.Type)
+ delete(rawMsg, key)
+ case "userAssignedIdentities":
+ err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImmutabilityPolicy.
+func (i ImmutabilityPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", i.Etag)
+ populate(objectMap, "id", i.ID)
+ populate(objectMap, "name", i.Name)
+ populate(objectMap, "properties", i.Properties)
+ populate(objectMap, "type", i.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutabilityPolicy.
+func (i *ImmutabilityPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &i.Etag)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &i.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &i.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &i.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &i.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImmutabilityPolicyProperties.
+func (i ImmutabilityPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", i.Etag)
+ populate(objectMap, "properties", i.Properties)
+ populate(objectMap, "updateHistory", i.UpdateHistory)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutabilityPolicyProperties.
+func (i *ImmutabilityPolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &i.Etag)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &i.Properties)
+ delete(rawMsg, key)
+ case "updateHistory":
+ err = unpopulate(val, "UpdateHistory", &i.UpdateHistory)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImmutabilityPolicyProperty.
+func (i ImmutabilityPolicyProperty) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowProtectedAppendWrites", i.AllowProtectedAppendWrites)
+ populate(objectMap, "allowProtectedAppendWritesAll", i.AllowProtectedAppendWritesAll)
+ populate(objectMap, "immutabilityPeriodSinceCreationInDays", i.ImmutabilityPeriodSinceCreationInDays)
+ populate(objectMap, "state", i.State)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutabilityPolicyProperty.
+func (i *ImmutabilityPolicyProperty) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowProtectedAppendWrites":
+ err = unpopulate(val, "AllowProtectedAppendWrites", &i.AllowProtectedAppendWrites)
+ delete(rawMsg, key)
+ case "allowProtectedAppendWritesAll":
+ err = unpopulate(val, "AllowProtectedAppendWritesAll", &i.AllowProtectedAppendWritesAll)
+ delete(rawMsg, key)
+ case "immutabilityPeriodSinceCreationInDays":
+ err = unpopulate(val, "ImmutabilityPeriodSinceCreationInDays", &i.ImmutabilityPeriodSinceCreationInDays)
+ delete(rawMsg, key)
+ case "state":
+ err = unpopulate(val, "State", &i.State)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImmutableStorageAccount.
+func (i ImmutableStorageAccount) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", i.Enabled)
+ populate(objectMap, "immutabilityPolicy", i.ImmutabilityPolicy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutableStorageAccount.
+func (i *ImmutableStorageAccount) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &i.Enabled)
+ delete(rawMsg, key)
+ case "immutabilityPolicy":
+ err = unpopulate(val, "ImmutabilityPolicy", &i.ImmutabilityPolicy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ImmutableStorageWithVersioning.
+func (i ImmutableStorageWithVersioning) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", i.Enabled)
+ populate(objectMap, "migrationState", i.MigrationState)
+ populateDateTimeRFC3339(objectMap, "timeStamp", i.TimeStamp)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ImmutableStorageWithVersioning.
+func (i *ImmutableStorageWithVersioning) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &i.Enabled)
+ delete(rawMsg, key)
+ case "migrationState":
+ err = unpopulate(val, "MigrationState", &i.MigrationState)
+ delete(rawMsg, key)
+ case "timeStamp":
+ err = unpopulateDateTimeRFC3339(val, "TimeStamp", &i.TimeStamp)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", i, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type KeyCreationTime.
+func (k KeyCreationTime) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "key1", k.Key1)
+ populateDateTimeRFC3339(objectMap, "key2", k.Key2)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type KeyCreationTime.
+func (k *KeyCreationTime) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "key1":
+ err = unpopulateDateTimeRFC3339(val, "Key1", &k.Key1)
+ delete(rawMsg, key)
+ case "key2":
+ err = unpopulateDateTimeRFC3339(val, "Key2", &k.Key2)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type KeyPolicy.
+func (k KeyPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "keyExpirationPeriodInDays", k.KeyExpirationPeriodInDays)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type KeyPolicy.
+func (k *KeyPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "keyExpirationPeriodInDays":
+ err = unpopulate(val, "KeyExpirationPeriodInDays", &k.KeyExpirationPeriodInDays)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties.
+func (k KeyVaultProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "currentVersionedKeyExpirationTimestamp", k.CurrentVersionedKeyExpirationTimestamp)
+ populate(objectMap, "currentVersionedKeyIdentifier", k.CurrentVersionedKeyIdentifier)
+ populate(objectMap, "keyname", k.KeyName)
+ populate(objectMap, "keyvaulturi", k.KeyVaultURI)
+ populate(objectMap, "keyversion", k.KeyVersion)
+ populateDateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", k.LastKeyRotationTimestamp)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties.
+func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "currentVersionedKeyExpirationTimestamp":
+ err = unpopulateDateTimeRFC3339(val, "CurrentVersionedKeyExpirationTimestamp", &k.CurrentVersionedKeyExpirationTimestamp)
+ delete(rawMsg, key)
+ case "currentVersionedKeyIdentifier":
+ err = unpopulate(val, "CurrentVersionedKeyIdentifier", &k.CurrentVersionedKeyIdentifier)
+ delete(rawMsg, key)
+ case "keyname":
+ err = unpopulate(val, "KeyName", &k.KeyName)
+ delete(rawMsg, key)
+ case "keyvaulturi":
+ err = unpopulate(val, "KeyVaultURI", &k.KeyVaultURI)
+ delete(rawMsg, key)
+ case "keyversion":
+ err = unpopulate(val, "KeyVersion", &k.KeyVersion)
+ delete(rawMsg, key)
+ case "lastKeyRotationTimestamp":
+ err = unpopulateDateTimeRFC3339(val, "LastKeyRotationTimestamp", &k.LastKeyRotationTimestamp)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", k, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LastAccessTimeTrackingPolicy.
+func (l LastAccessTimeTrackingPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobType", l.BlobType)
+ populate(objectMap, "enable", l.Enable)
+ populate(objectMap, "name", l.Name)
+ populate(objectMap, "trackingGranularityInDays", l.TrackingGranularityInDays)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LastAccessTimeTrackingPolicy.
+func (l *LastAccessTimeTrackingPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobType":
+ err = unpopulate(val, "BlobType", &l.BlobType)
+ delete(rawMsg, key)
+ case "enable":
+ err = unpopulate(val, "Enable", &l.Enable)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &l.Name)
+ delete(rawMsg, key)
+ case "trackingGranularityInDays":
+ err = unpopulate(val, "TrackingGranularityInDays", &l.TrackingGranularityInDays)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LeaseContainerRequest.
+func (l LeaseContainerRequest) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "action", l.Action)
+ populate(objectMap, "breakPeriod", l.BreakPeriod)
+ populate(objectMap, "leaseDuration", l.LeaseDuration)
+ populate(objectMap, "leaseId", l.LeaseID)
+ populate(objectMap, "proposedLeaseId", l.ProposedLeaseID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseContainerRequest.
+func (l *LeaseContainerRequest) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "action":
+ err = unpopulate(val, "Action", &l.Action)
+ delete(rawMsg, key)
+ case "breakPeriod":
+ err = unpopulate(val, "BreakPeriod", &l.BreakPeriod)
+ delete(rawMsg, key)
+ case "leaseDuration":
+ err = unpopulate(val, "LeaseDuration", &l.LeaseDuration)
+ delete(rawMsg, key)
+ case "leaseId":
+ err = unpopulate(val, "LeaseID", &l.LeaseID)
+ delete(rawMsg, key)
+ case "proposedLeaseId":
+ err = unpopulate(val, "ProposedLeaseID", &l.ProposedLeaseID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LeaseContainerResponse.
+func (l LeaseContainerResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "leaseId", l.LeaseID)
+ populate(objectMap, "leaseTimeSeconds", l.LeaseTimeSeconds)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseContainerResponse.
+func (l *LeaseContainerResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "leaseId":
+ err = unpopulate(val, "LeaseID", &l.LeaseID)
+ delete(rawMsg, key)
+ case "leaseTimeSeconds":
+ err = unpopulate(val, "LeaseTimeSeconds", &l.LeaseTimeSeconds)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LeaseShareRequest.
+func (l LeaseShareRequest) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "action", l.Action)
+ populate(objectMap, "breakPeriod", l.BreakPeriod)
+ populate(objectMap, "leaseDuration", l.LeaseDuration)
+ populate(objectMap, "leaseId", l.LeaseID)
+ populate(objectMap, "proposedLeaseId", l.ProposedLeaseID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseShareRequest.
+func (l *LeaseShareRequest) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "action":
+ err = unpopulate(val, "Action", &l.Action)
+ delete(rawMsg, key)
+ case "breakPeriod":
+ err = unpopulate(val, "BreakPeriod", &l.BreakPeriod)
+ delete(rawMsg, key)
+ case "leaseDuration":
+ err = unpopulate(val, "LeaseDuration", &l.LeaseDuration)
+ delete(rawMsg, key)
+ case "leaseId":
+ err = unpopulate(val, "LeaseID", &l.LeaseID)
+ delete(rawMsg, key)
+ case "proposedLeaseId":
+ err = unpopulate(val, "ProposedLeaseID", &l.ProposedLeaseID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LeaseShareResponse.
+func (l LeaseShareResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "leaseId", l.LeaseID)
+ populate(objectMap, "leaseTimeSeconds", l.LeaseTimeSeconds)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LeaseShareResponse.
+func (l *LeaseShareResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "leaseId":
+ err = unpopulate(val, "LeaseID", &l.LeaseID)
+ delete(rawMsg, key)
+ case "leaseTimeSeconds":
+ err = unpopulate(val, "LeaseTimeSeconds", &l.LeaseTimeSeconds)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LegalHold.
+func (l LegalHold) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowProtectedAppendWritesAll", l.AllowProtectedAppendWritesAll)
+ populate(objectMap, "hasLegalHold", l.HasLegalHold)
+ populate(objectMap, "tags", l.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LegalHold.
+func (l *LegalHold) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowProtectedAppendWritesAll":
+ err = unpopulate(val, "AllowProtectedAppendWritesAll", &l.AllowProtectedAppendWritesAll)
+ delete(rawMsg, key)
+ case "hasLegalHold":
+ err = unpopulate(val, "HasLegalHold", &l.HasLegalHold)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &l.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LegalHoldProperties.
+func (l LegalHoldProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "hasLegalHold", l.HasLegalHold)
+ populate(objectMap, "protectedAppendWritesHistory", l.ProtectedAppendWritesHistory)
+ populate(objectMap, "tags", l.Tags)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LegalHoldProperties.
+func (l *LegalHoldProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "hasLegalHold":
+ err = unpopulate(val, "HasLegalHold", &l.HasLegalHold)
+ delete(rawMsg, key)
+ case "protectedAppendWritesHistory":
+ err = unpopulate(val, "ProtectedAppendWritesHistory", &l.ProtectedAppendWritesHistory)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &l.Tags)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListAccountSasResponse.
+func (l ListAccountSasResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accountSasToken", l.AccountSasToken)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListAccountSasResponse.
+func (l *ListAccountSasResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accountSasToken":
+ err = unpopulate(val, "AccountSasToken", &l.AccountSasToken)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListBlobInventoryPolicy.
+func (l ListBlobInventoryPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListBlobInventoryPolicy.
+func (l *ListBlobInventoryPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListContainerItem.
+func (l ListContainerItem) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "etag", l.Etag)
+ populate(objectMap, "id", l.ID)
+ populate(objectMap, "name", l.Name)
+ populate(objectMap, "properties", l.Properties)
+ populate(objectMap, "type", l.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListContainerItem.
+func (l *ListContainerItem) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "etag":
+ err = unpopulate(val, "Etag", &l.Etag)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &l.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &l.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &l.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &l.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListContainerItems.
+func (l ListContainerItems) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", l.NextLink)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListContainerItems.
+func (l *ListContainerItems) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &l.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListQueue.
+func (l ListQueue) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", l.ID)
+ populate(objectMap, "name", l.Name)
+ populate(objectMap, "properties", l.QueueProperties)
+ populate(objectMap, "type", l.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueue.
+func (l *ListQueue) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &l.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &l.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "QueueProperties", &l.QueueProperties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &l.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListQueueProperties.
+func (l ListQueueProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "metadata", l.Metadata)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueueProperties.
+func (l *ListQueueProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "metadata":
+ err = unpopulate(val, "Metadata", &l.Metadata)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListQueueResource.
+func (l ListQueueResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", l.NextLink)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueueResource.
+func (l *ListQueueResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &l.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListQueueServices.
+func (l ListQueueServices) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListQueueServices.
+func (l *ListQueueServices) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListServiceSasResponse.
+func (l ListServiceSasResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "serviceSasToken", l.ServiceSasToken)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListServiceSasResponse.
+func (l *ListServiceSasResponse) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "serviceSasToken":
+ err = unpopulate(val, "ServiceSasToken", &l.ServiceSasToken)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListTableResource.
+func (l ListTableResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "nextLink", l.NextLink)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListTableResource.
+func (l *ListTableResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "nextLink":
+ err = unpopulate(val, "NextLink", &l.NextLink)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ListTableServices.
+func (l ListTableServices) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ListTableServices.
+func (l *ListTableServices) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LocalUser.
+func (l LocalUser) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", l.ID)
+ populate(objectMap, "name", l.Name)
+ populate(objectMap, "properties", l.Properties)
+ populate(objectMap, "systemData", l.SystemData)
+ populate(objectMap, "type", l.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUser.
+func (l *LocalUser) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &l.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &l.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &l.Properties)
+ delete(rawMsg, key)
+ case "systemData":
+ err = unpopulate(val, "SystemData", &l.SystemData)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &l.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LocalUserKeys.
+func (l LocalUserKeys) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "sshAuthorizedKeys", l.SSHAuthorizedKeys)
+ populate(objectMap, "sharedKey", l.SharedKey)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUserKeys.
+func (l *LocalUserKeys) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "sshAuthorizedKeys":
+ err = unpopulate(val, "SSHAuthorizedKeys", &l.SSHAuthorizedKeys)
+ delete(rawMsg, key)
+ case "sharedKey":
+ err = unpopulate(val, "SharedKey", &l.SharedKey)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LocalUserProperties.
+func (l LocalUserProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "hasSshKey", l.HasSSHKey)
+ populate(objectMap, "hasSshPassword", l.HasSSHPassword)
+ populate(objectMap, "hasSharedKey", l.HasSharedKey)
+ populate(objectMap, "homeDirectory", l.HomeDirectory)
+ populate(objectMap, "permissionScopes", l.PermissionScopes)
+ populate(objectMap, "sshAuthorizedKeys", l.SSHAuthorizedKeys)
+ populate(objectMap, "sid", l.Sid)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUserProperties.
+func (l *LocalUserProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "hasSshKey":
+ err = unpopulate(val, "HasSSHKey", &l.HasSSHKey)
+ delete(rawMsg, key)
+ case "hasSshPassword":
+ err = unpopulate(val, "HasSSHPassword", &l.HasSSHPassword)
+ delete(rawMsg, key)
+ case "hasSharedKey":
+ err = unpopulate(val, "HasSharedKey", &l.HasSharedKey)
+ delete(rawMsg, key)
+ case "homeDirectory":
+ err = unpopulate(val, "HomeDirectory", &l.HomeDirectory)
+ delete(rawMsg, key)
+ case "permissionScopes":
+ err = unpopulate(val, "PermissionScopes", &l.PermissionScopes)
+ delete(rawMsg, key)
+ case "sshAuthorizedKeys":
+ err = unpopulate(val, "SSHAuthorizedKeys", &l.SSHAuthorizedKeys)
+ delete(rawMsg, key)
+ case "sid":
+ err = unpopulate(val, "Sid", &l.Sid)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LocalUserRegeneratePasswordResult.
+func (l LocalUserRegeneratePasswordResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "sshPassword", l.SSHPassword)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUserRegeneratePasswordResult.
+func (l *LocalUserRegeneratePasswordResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "sshPassword":
+ err = unpopulate(val, "SSHPassword", &l.SSHPassword)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type LocalUsers.
+func (l LocalUsers) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", l.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type LocalUsers.
+func (l *LocalUsers) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &l.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", l, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicy.
+func (m ManagementPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", m.ID)
+ populate(objectMap, "name", m.Name)
+ populate(objectMap, "properties", m.Properties)
+ populate(objectMap, "type", m.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicy.
+func (m *ManagementPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &m.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &m.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &m.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &m.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyAction.
+func (m ManagementPolicyAction) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "baseBlob", m.BaseBlob)
+ populate(objectMap, "snapshot", m.Snapshot)
+ populate(objectMap, "version", m.Version)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyAction.
+func (m *ManagementPolicyAction) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "baseBlob":
+ err = unpopulate(val, "BaseBlob", &m.BaseBlob)
+ delete(rawMsg, key)
+ case "snapshot":
+ err = unpopulate(val, "Snapshot", &m.Snapshot)
+ delete(rawMsg, key)
+ case "version":
+ err = unpopulate(val, "Version", &m.Version)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyBaseBlob.
+func (m ManagementPolicyBaseBlob) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "delete", m.Delete)
+ populate(objectMap, "enableAutoTierToHotFromCool", m.EnableAutoTierToHotFromCool)
+ populate(objectMap, "tierToArchive", m.TierToArchive)
+ populate(objectMap, "tierToCold", m.TierToCold)
+ populate(objectMap, "tierToCool", m.TierToCool)
+ populate(objectMap, "tierToHot", m.TierToHot)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyBaseBlob.
+func (m *ManagementPolicyBaseBlob) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "delete":
+ err = unpopulate(val, "Delete", &m.Delete)
+ delete(rawMsg, key)
+ case "enableAutoTierToHotFromCool":
+ err = unpopulate(val, "EnableAutoTierToHotFromCool", &m.EnableAutoTierToHotFromCool)
+ delete(rawMsg, key)
+ case "tierToArchive":
+ err = unpopulate(val, "TierToArchive", &m.TierToArchive)
+ delete(rawMsg, key)
+ case "tierToCold":
+ err = unpopulate(val, "TierToCold", &m.TierToCold)
+ delete(rawMsg, key)
+ case "tierToCool":
+ err = unpopulate(val, "TierToCool", &m.TierToCool)
+ delete(rawMsg, key)
+ case "tierToHot":
+ err = unpopulate(val, "TierToHot", &m.TierToHot)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyDefinition.
+func (m ManagementPolicyDefinition) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "actions", m.Actions)
+ populate(objectMap, "filters", m.Filters)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyDefinition.
+func (m *ManagementPolicyDefinition) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "actions":
+ err = unpopulate(val, "Actions", &m.Actions)
+ delete(rawMsg, key)
+ case "filters":
+ err = unpopulate(val, "Filters", &m.Filters)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyFilter.
+func (m ManagementPolicyFilter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "blobIndexMatch", m.BlobIndexMatch)
+ populate(objectMap, "blobTypes", m.BlobTypes)
+ populate(objectMap, "prefixMatch", m.PrefixMatch)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyFilter.
+func (m *ManagementPolicyFilter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "blobIndexMatch":
+ err = unpopulate(val, "BlobIndexMatch", &m.BlobIndexMatch)
+ delete(rawMsg, key)
+ case "blobTypes":
+ err = unpopulate(val, "BlobTypes", &m.BlobTypes)
+ delete(rawMsg, key)
+ case "prefixMatch":
+ err = unpopulate(val, "PrefixMatch", &m.PrefixMatch)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyProperties.
+func (m ManagementPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "lastModifiedTime", m.LastModifiedTime)
+ populate(objectMap, "policy", m.Policy)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyProperties.
+func (m *ManagementPolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "lastModifiedTime":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &m.LastModifiedTime)
+ delete(rawMsg, key)
+ case "policy":
+ err = unpopulate(val, "Policy", &m.Policy)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyRule.
+func (m ManagementPolicyRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "definition", m.Definition)
+ populate(objectMap, "enabled", m.Enabled)
+ populate(objectMap, "name", m.Name)
+ populate(objectMap, "type", m.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyRule.
+func (m *ManagementPolicyRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "definition":
+ err = unpopulate(val, "Definition", &m.Definition)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &m.Enabled)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &m.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &m.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicySchema.
+func (m ManagementPolicySchema) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "rules", m.Rules)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicySchema.
+func (m *ManagementPolicySchema) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "rules":
+ err = unpopulate(val, "Rules", &m.Rules)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicySnapShot.
+func (m ManagementPolicySnapShot) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "delete", m.Delete)
+ populate(objectMap, "tierToArchive", m.TierToArchive)
+ populate(objectMap, "tierToCold", m.TierToCold)
+ populate(objectMap, "tierToCool", m.TierToCool)
+ populate(objectMap, "tierToHot", m.TierToHot)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicySnapShot.
+func (m *ManagementPolicySnapShot) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "delete":
+ err = unpopulate(val, "Delete", &m.Delete)
+ delete(rawMsg, key)
+ case "tierToArchive":
+ err = unpopulate(val, "TierToArchive", &m.TierToArchive)
+ delete(rawMsg, key)
+ case "tierToCold":
+ err = unpopulate(val, "TierToCold", &m.TierToCold)
+ delete(rawMsg, key)
+ case "tierToCool":
+ err = unpopulate(val, "TierToCool", &m.TierToCool)
+ delete(rawMsg, key)
+ case "tierToHot":
+ err = unpopulate(val, "TierToHot", &m.TierToHot)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ManagementPolicyVersion.
+func (m ManagementPolicyVersion) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "delete", m.Delete)
+ populate(objectMap, "tierToArchive", m.TierToArchive)
+ populate(objectMap, "tierToCold", m.TierToCold)
+ populate(objectMap, "tierToCool", m.TierToCool)
+ populate(objectMap, "tierToHot", m.TierToHot)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ManagementPolicyVersion.
+func (m *ManagementPolicyVersion) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "delete":
+ err = unpopulate(val, "Delete", &m.Delete)
+ delete(rawMsg, key)
+ case "tierToArchive":
+ err = unpopulate(val, "TierToArchive", &m.TierToArchive)
+ delete(rawMsg, key)
+ case "tierToCold":
+ err = unpopulate(val, "TierToCold", &m.TierToCold)
+ delete(rawMsg, key)
+ case "tierToCool":
+ err = unpopulate(val, "TierToCool", &m.TierToCool)
+ delete(rawMsg, key)
+ case "tierToHot":
+ err = unpopulate(val, "TierToHot", &m.TierToHot)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type MetricSpecification.
+func (m MetricSpecification) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "aggregationType", m.AggregationType)
+ populate(objectMap, "category", m.Category)
+ populate(objectMap, "dimensions", m.Dimensions)
+ populate(objectMap, "displayDescription", m.DisplayDescription)
+ populate(objectMap, "displayName", m.DisplayName)
+ populate(objectMap, "fillGapWithZero", m.FillGapWithZero)
+ populate(objectMap, "name", m.Name)
+ populate(objectMap, "resourceIdDimensionNameOverride", m.ResourceIDDimensionNameOverride)
+ populate(objectMap, "unit", m.Unit)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type MetricSpecification.
+func (m *MetricSpecification) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "aggregationType":
+ err = unpopulate(val, "AggregationType", &m.AggregationType)
+ delete(rawMsg, key)
+ case "category":
+ err = unpopulate(val, "Category", &m.Category)
+ delete(rawMsg, key)
+ case "dimensions":
+ err = unpopulate(val, "Dimensions", &m.Dimensions)
+ delete(rawMsg, key)
+ case "displayDescription":
+ err = unpopulate(val, "DisplayDescription", &m.DisplayDescription)
+ delete(rawMsg, key)
+ case "displayName":
+ err = unpopulate(val, "DisplayName", &m.DisplayName)
+ delete(rawMsg, key)
+ case "fillGapWithZero":
+ err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &m.Name)
+ delete(rawMsg, key)
+ case "resourceIdDimensionNameOverride":
+ err = unpopulate(val, "ResourceIDDimensionNameOverride", &m.ResourceIDDimensionNameOverride)
+ delete(rawMsg, key)
+ case "unit":
+ err = unpopulate(val, "Unit", &m.Unit)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Multichannel.
+func (m Multichannel) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "enabled", m.Enabled)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Multichannel.
+func (m *Multichannel) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "enabled":
+ err = unpopulate(val, "Enabled", &m.Enabled)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", m, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet.
+func (n NetworkRuleSet) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "bypass", n.Bypass)
+ populate(objectMap, "defaultAction", n.DefaultAction)
+ populate(objectMap, "ipRules", n.IPRules)
+ populate(objectMap, "resourceAccessRules", n.ResourceAccessRules)
+ populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet.
+func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "bypass":
+ err = unpopulate(val, "Bypass", &n.Bypass)
+ delete(rawMsg, key)
+ case "defaultAction":
+ err = unpopulate(val, "DefaultAction", &n.DefaultAction)
+ delete(rawMsg, key)
+ case "ipRules":
+ err = unpopulate(val, "IPRules", &n.IPRules)
+ delete(rawMsg, key)
+ case "resourceAccessRules":
+ err = unpopulate(val, "ResourceAccessRules", &n.ResourceAccessRules)
+ delete(rawMsg, key)
+ case "virtualNetworkRules":
+ err = unpopulate(val, "VirtualNetworkRules", &n.VirtualNetworkRules)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", n, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicies.
+func (o ObjectReplicationPolicies) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", o.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicies.
+func (o *ObjectReplicationPolicies) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &o.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicy.
+func (o ObjectReplicationPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", o.ID)
+ populate(objectMap, "name", o.Name)
+ populate(objectMap, "properties", o.Properties)
+ populate(objectMap, "type", o.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicy.
+func (o *ObjectReplicationPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &o.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &o.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &o.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyFilter.
+func (o ObjectReplicationPolicyFilter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "minCreationTime", o.MinCreationTime)
+ populate(objectMap, "prefixMatch", o.PrefixMatch)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyFilter.
+func (o *ObjectReplicationPolicyFilter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "minCreationTime":
+ err = unpopulate(val, "MinCreationTime", &o.MinCreationTime)
+ delete(rawMsg, key)
+ case "prefixMatch":
+ err = unpopulate(val, "PrefixMatch", &o.PrefixMatch)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyProperties.
+func (o ObjectReplicationPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "destinationAccount", o.DestinationAccount)
+ populateDateTimeRFC3339(objectMap, "enabledTime", o.EnabledTime)
+ populate(objectMap, "policyId", o.PolicyID)
+ populate(objectMap, "rules", o.Rules)
+ populate(objectMap, "sourceAccount", o.SourceAccount)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyProperties.
+func (o *ObjectReplicationPolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "destinationAccount":
+ err = unpopulate(val, "DestinationAccount", &o.DestinationAccount)
+ delete(rawMsg, key)
+ case "enabledTime":
+ err = unpopulateDateTimeRFC3339(val, "EnabledTime", &o.EnabledTime)
+ delete(rawMsg, key)
+ case "policyId":
+ err = unpopulate(val, "PolicyID", &o.PolicyID)
+ delete(rawMsg, key)
+ case "rules":
+ err = unpopulate(val, "Rules", &o.Rules)
+ delete(rawMsg, key)
+ case "sourceAccount":
+ err = unpopulate(val, "SourceAccount", &o.SourceAccount)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyRule.
+func (o ObjectReplicationPolicyRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "destinationContainer", o.DestinationContainer)
+ populate(objectMap, "filters", o.Filters)
+ populate(objectMap, "ruleId", o.RuleID)
+ populate(objectMap, "sourceContainer", o.SourceContainer)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyRule.
+func (o *ObjectReplicationPolicyRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "destinationContainer":
+ err = unpopulate(val, "DestinationContainer", &o.DestinationContainer)
+ delete(rawMsg, key)
+ case "filters":
+ err = unpopulate(val, "Filters", &o.Filters)
+ delete(rawMsg, key)
+ case "ruleId":
+ err = unpopulate(val, "RuleID", &o.RuleID)
+ delete(rawMsg, key)
+ case "sourceContainer":
+ err = unpopulate(val, "SourceContainer", &o.SourceContainer)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Operation.
+func (o Operation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "display", o.Display)
+ populate(objectMap, "name", o.Name)
+ populate(objectMap, "properties", o.OperationProperties)
+ populate(objectMap, "origin", o.Origin)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
+func (o *Operation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "display":
+ err = unpopulate(val, "Display", &o.Display)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &o.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "OperationProperties", &o.OperationProperties)
+ delete(rawMsg, key)
+ case "origin":
+ err = unpopulate(val, "Origin", &o.Origin)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
+func (o OperationDisplay) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", o.Description)
+ populate(objectMap, "operation", o.Operation)
+ populate(objectMap, "provider", o.Provider)
+ populate(objectMap, "resource", o.Resource)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
+func (o *OperationDisplay) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &o.Description)
+ delete(rawMsg, key)
+ case "operation":
+ err = unpopulate(val, "Operation", &o.Operation)
+ delete(rawMsg, key)
+ case "provider":
+ err = unpopulate(val, "Provider", &o.Provider)
+ delete(rawMsg, key)
+ case "resource":
+ err = unpopulate(val, "Resource", &o.Resource)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationListResult.
+func (o OperationListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", o.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
+func (o *OperationListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &o.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type OperationProperties.
+func (o OperationProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "serviceSpecification", o.ServiceSpecification)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties.
+func (o *OperationProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "serviceSpecification":
+ err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", o, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PermissionScope.
+func (p PermissionScope) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "permissions", p.Permissions)
+ populate(objectMap, "resourceName", p.ResourceName)
+ populate(objectMap, "service", p.Service)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PermissionScope.
+func (p *PermissionScope) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "permissions":
+ err = unpopulate(val, "Permissions", &p.Permissions)
+ delete(rawMsg, key)
+ case "resourceName":
+ err = unpopulate(val, "ResourceName", &p.ResourceName)
+ delete(rawMsg, key)
+ case "service":
+ err = unpopulate(val, "Service", &p.Service)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint.
+func (p PrivateEndpoint) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint.
+func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.
+func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "properties", p.Properties)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.
+func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &p.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.
+func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", p.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.
+func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &p.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.
+func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "privateEndpoint", p.PrivateEndpoint)
+ populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState)
+ populate(objectMap, "provisioningState", p.ProvisioningState)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.
+func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "privateEndpoint":
+ err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint)
+ delete(rawMsg, key)
+ case "privateLinkServiceConnectionState":
+ err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState)
+ delete(rawMsg, key)
+ case "provisioningState":
+ err = unpopulate(val, "ProvisioningState", &p.ProvisioningState)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.
+func (p PrivateLinkResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "properties", p.Properties)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.
+func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "Properties", &p.Properties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.
+func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", p.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.
+func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &p.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.
+func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "groupId", p.GroupID)
+ populate(objectMap, "requiredMembers", p.RequiredMembers)
+ populate(objectMap, "requiredZoneNames", p.RequiredZoneNames)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.
+func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "groupId":
+ err = unpopulate(val, "GroupID", &p.GroupID)
+ delete(rawMsg, key)
+ case "requiredMembers":
+ err = unpopulate(val, "RequiredMembers", &p.RequiredMembers)
+ delete(rawMsg, key)
+ case "requiredZoneNames":
+ err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.
+func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "actionRequired", p.ActionRequired)
+ populate(objectMap, "description", p.Description)
+ populate(objectMap, "status", p.Status)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.
+func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "actionRequired":
+ err = unpopulate(val, "ActionRequired", &p.ActionRequired)
+ delete(rawMsg, key)
+ case "description":
+ err = unpopulate(val, "Description", &p.Description)
+ delete(rawMsg, key)
+ case "status":
+ err = unpopulate(val, "Status", &p.Status)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProtectedAppendWritesHistory.
+func (p ProtectedAppendWritesHistory) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowProtectedAppendWritesAll", p.AllowProtectedAppendWritesAll)
+ populateDateTimeRFC3339(objectMap, "timestamp", p.Timestamp)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedAppendWritesHistory.
+func (p *ProtectedAppendWritesHistory) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowProtectedAppendWritesAll":
+ err = unpopulate(val, "AllowProtectedAppendWritesAll", &p.AllowProtectedAppendWritesAll)
+ delete(rawMsg, key)
+ case "timestamp":
+ err = unpopulateDateTimeRFC3339(val, "Timestamp", &p.Timestamp)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProtocolSettings.
+func (p ProtocolSettings) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "smb", p.Smb)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProtocolSettings.
+func (p *ProtocolSettings) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "smb":
+ err = unpopulate(val, "Smb", &p.Smb)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ProxyResource.
+func (p ProxyResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", p.ID)
+ populate(objectMap, "name", p.Name)
+ populate(objectMap, "type", p.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.
+func (p *ProxyResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &p.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &p.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &p.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", p, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Queue.
+func (q Queue) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", q.ID)
+ populate(objectMap, "name", q.Name)
+ populate(objectMap, "properties", q.QueueProperties)
+ populate(objectMap, "type", q.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Queue.
+func (q *Queue) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &q.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &q.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "QueueProperties", &q.QueueProperties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &q.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type QueueProperties.
+func (q QueueProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "approximateMessageCount", q.ApproximateMessageCount)
+ populate(objectMap, "metadata", q.Metadata)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type QueueProperties.
+func (q *QueueProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "approximateMessageCount":
+ err = unpopulate(val, "ApproximateMessageCount", &q.ApproximateMessageCount)
+ delete(rawMsg, key)
+ case "metadata":
+ err = unpopulate(val, "Metadata", &q.Metadata)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type QueueServiceProperties.
+func (q QueueServiceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", q.ID)
+ populate(objectMap, "name", q.Name)
+ populate(objectMap, "properties", q.QueueServiceProperties)
+ populate(objectMap, "type", q.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type QueueServiceProperties.
+func (q *QueueServiceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &q.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &q.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "QueueServiceProperties", &q.QueueServiceProperties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &q.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type QueueServicePropertiesProperties.
+func (q QueueServicePropertiesProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "cors", q.Cors)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type QueueServicePropertiesProperties.
+func (q *QueueServicePropertiesProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "cors":
+ err = unpopulate(val, "Cors", &q.Cors)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", q, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Resource.
+func (r Resource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", r.ID)
+ populate(objectMap, "name", r.Name)
+ populate(objectMap, "type", r.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
+func (r *Resource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &r.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &r.Name)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ResourceAccessRule.
+func (r ResourceAccessRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "resourceId", r.ResourceID)
+ populate(objectMap, "tenantId", r.TenantID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAccessRule.
+func (r *ResourceAccessRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "resourceId":
+ err = unpopulate(val, "ResourceID", &r.ResourceID)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &r.TenantID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RestorePolicyProperties.
+func (r RestorePolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "days", r.Days)
+ populate(objectMap, "enabled", r.Enabled)
+ populateDateTimeRFC3339(objectMap, "lastEnabledTime", r.LastEnabledTime)
+ populateDateTimeRFC3339(objectMap, "minRestoreTime", r.MinRestoreTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePolicyProperties.
+func (r *RestorePolicyProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "days":
+ err = unpopulate(val, "Days", &r.Days)
+ delete(rawMsg, key)
+ case "enabled":
+ err = unpopulate(val, "Enabled", &r.Enabled)
+ delete(rawMsg, key)
+ case "lastEnabledTime":
+ err = unpopulateDateTimeRFC3339(val, "LastEnabledTime", &r.LastEnabledTime)
+ delete(rawMsg, key)
+ case "minRestoreTime":
+ err = unpopulateDateTimeRFC3339(val, "MinRestoreTime", &r.MinRestoreTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Restriction.
+func (r Restriction) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "reasonCode", r.ReasonCode)
+ populate(objectMap, "type", r.Type)
+ populate(objectMap, "values", r.Values)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Restriction.
+func (r *Restriction) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "reasonCode":
+ err = unpopulate(val, "ReasonCode", &r.ReasonCode)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &r.Type)
+ delete(rawMsg, key)
+ case "values":
+ err = unpopulate(val, "Values", &r.Values)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type RoutingPreference.
+func (r RoutingPreference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "publishInternetEndpoints", r.PublishInternetEndpoints)
+ populate(objectMap, "publishMicrosoftEndpoints", r.PublishMicrosoftEndpoints)
+ populate(objectMap, "routingChoice", r.RoutingChoice)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type RoutingPreference.
+func (r *RoutingPreference) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "publishInternetEndpoints":
+ err = unpopulate(val, "PublishInternetEndpoints", &r.PublishInternetEndpoints)
+ delete(rawMsg, key)
+ case "publishMicrosoftEndpoints":
+ err = unpopulate(val, "PublishMicrosoftEndpoints", &r.PublishMicrosoftEndpoints)
+ delete(rawMsg, key)
+ case "routingChoice":
+ err = unpopulate(val, "RoutingChoice", &r.RoutingChoice)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", r, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SKU.
+func (s SKU) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "tier", s.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SKU.
+func (s *SKU) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &s.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SKUCapability.
+func (s SKUCapability) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "value", s.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapability.
+func (s *SKUCapability) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &s.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SKUInformation.
+func (s SKUInformation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "capabilities", s.Capabilities)
+ populate(objectMap, "kind", s.Kind)
+ populate(objectMap, "locations", s.Locations)
+ populate(objectMap, "name", s.Name)
+ populate(objectMap, "resourceType", s.ResourceType)
+ populate(objectMap, "restrictions", s.Restrictions)
+ populate(objectMap, "tier", s.Tier)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SKUInformation.
+func (s *SKUInformation) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "capabilities":
+ err = unpopulate(val, "Capabilities", &s.Capabilities)
+ delete(rawMsg, key)
+ case "kind":
+ err = unpopulate(val, "Kind", &s.Kind)
+ delete(rawMsg, key)
+ case "locations":
+ err = unpopulate(val, "Locations", &s.Locations)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &s.Name)
+ delete(rawMsg, key)
+ case "resourceType":
+ err = unpopulate(val, "ResourceType", &s.ResourceType)
+ delete(rawMsg, key)
+ case "restrictions":
+ err = unpopulate(val, "Restrictions", &s.Restrictions)
+ delete(rawMsg, key)
+ case "tier":
+ err = unpopulate(val, "Tier", &s.Tier)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SKUListResult.
+func (s SKUListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", s.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SKUListResult.
+func (s *SKUListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &s.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SSHPublicKey.
+func (s SSHPublicKey) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "description", s.Description)
+ populate(objectMap, "key", s.Key)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SSHPublicKey.
+func (s *SSHPublicKey) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "description":
+ err = unpopulate(val, "Description", &s.Description)
+ delete(rawMsg, key)
+ case "key":
+ err = unpopulate(val, "Key", &s.Key)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SasPolicy.
+func (s SasPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "expirationAction", s.ExpirationAction)
+ populate(objectMap, "sasExpirationPeriod", s.SasExpirationPeriod)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SasPolicy.
+func (s *SasPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "expirationAction":
+ err = unpopulate(val, "ExpirationAction", &s.ExpirationAction)
+ delete(rawMsg, key)
+ case "sasExpirationPeriod":
+ err = unpopulate(val, "SasExpirationPeriod", &s.SasExpirationPeriod)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ServiceSasParameters.
+func (s ServiceSasParameters) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "rscc", s.CacheControl)
+ populate(objectMap, "canonicalizedResource", s.CanonicalizedResource)
+ populate(objectMap, "rscd", s.ContentDisposition)
+ populate(objectMap, "rsce", s.ContentEncoding)
+ populate(objectMap, "rscl", s.ContentLanguage)
+ populate(objectMap, "rsct", s.ContentType)
+ populate(objectMap, "signedIp", s.IPAddressOrRange)
+ populate(objectMap, "signedIdentifier", s.Identifier)
+ populate(objectMap, "keyToSign", s.KeyToSign)
+ populate(objectMap, "endPk", s.PartitionKeyEnd)
+ populate(objectMap, "startPk", s.PartitionKeyStart)
+ populate(objectMap, "signedPermission", s.Permissions)
+ populate(objectMap, "signedProtocol", s.Protocols)
+ populate(objectMap, "signedResource", s.Resource)
+ populate(objectMap, "endRk", s.RowKeyEnd)
+ populate(objectMap, "startRk", s.RowKeyStart)
+ populateDateTimeRFC3339(objectMap, "signedExpiry", s.SharedAccessExpiryTime)
+ populateDateTimeRFC3339(objectMap, "signedStart", s.SharedAccessStartTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSasParameters.
+func (s *ServiceSasParameters) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "rscc":
+ err = unpopulate(val, "CacheControl", &s.CacheControl)
+ delete(rawMsg, key)
+ case "canonicalizedResource":
+ err = unpopulate(val, "CanonicalizedResource", &s.CanonicalizedResource)
+ delete(rawMsg, key)
+ case "rscd":
+ err = unpopulate(val, "ContentDisposition", &s.ContentDisposition)
+ delete(rawMsg, key)
+ case "rsce":
+ err = unpopulate(val, "ContentEncoding", &s.ContentEncoding)
+ delete(rawMsg, key)
+ case "rscl":
+ err = unpopulate(val, "ContentLanguage", &s.ContentLanguage)
+ delete(rawMsg, key)
+ case "rsct":
+ err = unpopulate(val, "ContentType", &s.ContentType)
+ delete(rawMsg, key)
+ case "signedIp":
+ err = unpopulate(val, "IPAddressOrRange", &s.IPAddressOrRange)
+ delete(rawMsg, key)
+ case "signedIdentifier":
+ err = unpopulate(val, "Identifier", &s.Identifier)
+ delete(rawMsg, key)
+ case "keyToSign":
+ err = unpopulate(val, "KeyToSign", &s.KeyToSign)
+ delete(rawMsg, key)
+ case "endPk":
+ err = unpopulate(val, "PartitionKeyEnd", &s.PartitionKeyEnd)
+ delete(rawMsg, key)
+ case "startPk":
+ err = unpopulate(val, "PartitionKeyStart", &s.PartitionKeyStart)
+ delete(rawMsg, key)
+ case "signedPermission":
+ err = unpopulate(val, "Permissions", &s.Permissions)
+ delete(rawMsg, key)
+ case "signedProtocol":
+ err = unpopulate(val, "Protocols", &s.Protocols)
+ delete(rawMsg, key)
+ case "signedResource":
+ err = unpopulate(val, "Resource", &s.Resource)
+ delete(rawMsg, key)
+ case "endRk":
+ err = unpopulate(val, "RowKeyEnd", &s.RowKeyEnd)
+ delete(rawMsg, key)
+ case "startRk":
+ err = unpopulate(val, "RowKeyStart", &s.RowKeyStart)
+ delete(rawMsg, key)
+ case "signedExpiry":
+ err = unpopulateDateTimeRFC3339(val, "SharedAccessExpiryTime", &s.SharedAccessExpiryTime)
+ delete(rawMsg, key)
+ case "signedStart":
+ err = unpopulateDateTimeRFC3339(val, "SharedAccessStartTime", &s.SharedAccessStartTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification.
+func (s ServiceSpecification) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "metricSpecifications", s.MetricSpecifications)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSpecification.
+func (s *ServiceSpecification) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "metricSpecifications":
+ err = unpopulate(val, "MetricSpecifications", &s.MetricSpecifications)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SignedIdentifier.
+func (s SignedIdentifier) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessPolicy", s.AccessPolicy)
+ populate(objectMap, "id", s.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SignedIdentifier.
+func (s *SignedIdentifier) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessPolicy":
+ err = unpopulate(val, "AccessPolicy", &s.AccessPolicy)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &s.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SmbSetting.
+func (s SmbSetting) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "authenticationMethods", s.AuthenticationMethods)
+ populate(objectMap, "channelEncryption", s.ChannelEncryption)
+ populate(objectMap, "kerberosTicketEncryption", s.KerberosTicketEncryption)
+ populate(objectMap, "multichannel", s.Multichannel)
+ populate(objectMap, "versions", s.Versions)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SmbSetting.
+func (s *SmbSetting) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "authenticationMethods":
+ err = unpopulate(val, "AuthenticationMethods", &s.AuthenticationMethods)
+ delete(rawMsg, key)
+ case "channelEncryption":
+ err = unpopulate(val, "ChannelEncryption", &s.ChannelEncryption)
+ delete(rawMsg, key)
+ case "kerberosTicketEncryption":
+ err = unpopulate(val, "KerberosTicketEncryption", &s.KerberosTicketEncryption)
+ delete(rawMsg, key)
+ case "multichannel":
+ err = unpopulate(val, "Multichannel", &s.Multichannel)
+ delete(rawMsg, key)
+ case "versions":
+ err = unpopulate(val, "Versions", &s.Versions)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type SystemData.
+func (s SystemData) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt)
+ populate(objectMap, "createdBy", s.CreatedBy)
+ populate(objectMap, "createdByType", s.CreatedByType)
+ populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt)
+ populate(objectMap, "lastModifiedBy", s.LastModifiedBy)
+ populate(objectMap, "lastModifiedByType", s.LastModifiedByType)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
+func (s *SystemData) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "createdAt":
+ err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt)
+ delete(rawMsg, key)
+ case "createdBy":
+ err = unpopulate(val, "CreatedBy", &s.CreatedBy)
+ delete(rawMsg, key)
+ case "createdByType":
+ err = unpopulate(val, "CreatedByType", &s.CreatedByType)
+ delete(rawMsg, key)
+ case "lastModifiedAt":
+ err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt)
+ delete(rawMsg, key)
+ case "lastModifiedBy":
+ err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy)
+ delete(rawMsg, key)
+ case "lastModifiedByType":
+ err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", s, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Table.
+func (t Table) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "properties", t.TableProperties)
+ populate(objectMap, "type", t.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Table.
+func (t *Table) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "TableProperties", &t.TableProperties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &t.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TableAccessPolicy.
+func (t TableAccessPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populateDateTimeRFC3339(objectMap, "expiryTime", t.ExpiryTime)
+ populate(objectMap, "permission", t.Permission)
+ populateDateTimeRFC3339(objectMap, "startTime", t.StartTime)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TableAccessPolicy.
+func (t *TableAccessPolicy) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "expiryTime":
+ err = unpopulateDateTimeRFC3339(val, "ExpiryTime", &t.ExpiryTime)
+ delete(rawMsg, key)
+ case "permission":
+ err = unpopulate(val, "Permission", &t.Permission)
+ delete(rawMsg, key)
+ case "startTime":
+ err = unpopulateDateTimeRFC3339(val, "StartTime", &t.StartTime)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TableProperties.
+func (t TableProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "signedIdentifiers", t.SignedIdentifiers)
+ populate(objectMap, "tableName", t.TableName)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TableProperties.
+func (t *TableProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "signedIdentifiers":
+ err = unpopulate(val, "SignedIdentifiers", &t.SignedIdentifiers)
+ delete(rawMsg, key)
+ case "tableName":
+ err = unpopulate(val, "TableName", &t.TableName)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TableServiceProperties.
+func (t TableServiceProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "properties", t.TableServiceProperties)
+ populate(objectMap, "type", t.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TableServiceProperties.
+func (t *TableServiceProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "properties":
+ err = unpopulate(val, "TableServiceProperties", &t.TableServiceProperties)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &t.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TableServicePropertiesProperties.
+func (t TableServicePropertiesProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "cors", t.Cors)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TableServicePropertiesProperties.
+func (t *TableServicePropertiesProperties) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "cors":
+ err = unpopulate(val, "Cors", &t.Cors)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TableSignedIdentifier.
+func (t TableSignedIdentifier) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "accessPolicy", t.AccessPolicy)
+ populate(objectMap, "id", t.ID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TableSignedIdentifier.
+func (t *TableSignedIdentifier) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "accessPolicy":
+ err = unpopulate(val, "AccessPolicy", &t.AccessPolicy)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TagFilter.
+func (t TagFilter) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "op", t.Op)
+ populate(objectMap, "value", t.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TagFilter.
+func (t *TagFilter) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "op":
+ err = unpopulate(val, "Op", &t.Op)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &t.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TagProperty.
+func (t TagProperty) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "objectIdentifier", t.ObjectIdentifier)
+ populate(objectMap, "tag", t.Tag)
+ populate(objectMap, "tenantId", t.TenantID)
+ populateDateTimeRFC3339(objectMap, "timestamp", t.Timestamp)
+ populate(objectMap, "upn", t.Upn)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TagProperty.
+func (t *TagProperty) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "objectIdentifier":
+ err = unpopulate(val, "ObjectIdentifier", &t.ObjectIdentifier)
+ delete(rawMsg, key)
+ case "tag":
+ err = unpopulate(val, "Tag", &t.Tag)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &t.TenantID)
+ delete(rawMsg, key)
+ case "timestamp":
+ err = unpopulateDateTimeRFC3339(val, "Timestamp", &t.Timestamp)
+ delete(rawMsg, key)
+ case "upn":
+ err = unpopulate(val, "Upn", &t.Upn)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type TrackedResource.
+func (t TrackedResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "id", t.ID)
+ populate(objectMap, "location", t.Location)
+ populate(objectMap, "name", t.Name)
+ populate(objectMap, "tags", t.Tags)
+ populate(objectMap, "type", t.Type)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.
+func (t *TrackedResource) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "id":
+ err = unpopulate(val, "ID", &t.ID)
+ delete(rawMsg, key)
+ case "location":
+ err = unpopulate(val, "Location", &t.Location)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &t.Name)
+ delete(rawMsg, key)
+ case "tags":
+ err = unpopulate(val, "Tags", &t.Tags)
+ delete(rawMsg, key)
+ case "type":
+ err = unpopulate(val, "Type", &t.Type)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", t, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UpdateHistoryProperty.
+func (u UpdateHistoryProperty) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "allowProtectedAppendWrites", u.AllowProtectedAppendWrites)
+ populate(objectMap, "allowProtectedAppendWritesAll", u.AllowProtectedAppendWritesAll)
+ populate(objectMap, "immutabilityPeriodSinceCreationInDays", u.ImmutabilityPeriodSinceCreationInDays)
+ populate(objectMap, "objectIdentifier", u.ObjectIdentifier)
+ populate(objectMap, "tenantId", u.TenantID)
+ populateDateTimeRFC3339(objectMap, "timestamp", u.Timestamp)
+ populate(objectMap, "update", u.Update)
+ populate(objectMap, "upn", u.Upn)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateHistoryProperty.
+func (u *UpdateHistoryProperty) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "allowProtectedAppendWrites":
+ err = unpopulate(val, "AllowProtectedAppendWrites", &u.AllowProtectedAppendWrites)
+ delete(rawMsg, key)
+ case "allowProtectedAppendWritesAll":
+ err = unpopulate(val, "AllowProtectedAppendWritesAll", &u.AllowProtectedAppendWritesAll)
+ delete(rawMsg, key)
+ case "immutabilityPeriodSinceCreationInDays":
+ err = unpopulate(val, "ImmutabilityPeriodSinceCreationInDays", &u.ImmutabilityPeriodSinceCreationInDays)
+ delete(rawMsg, key)
+ case "objectIdentifier":
+ err = unpopulate(val, "ObjectIdentifier", &u.ObjectIdentifier)
+ delete(rawMsg, key)
+ case "tenantId":
+ err = unpopulate(val, "TenantID", &u.TenantID)
+ delete(rawMsg, key)
+ case "timestamp":
+ err = unpopulateDateTimeRFC3339(val, "Timestamp", &u.Timestamp)
+ delete(rawMsg, key)
+ case "update":
+ err = unpopulate(val, "Update", &u.Update)
+ delete(rawMsg, key)
+ case "upn":
+ err = unpopulate(val, "Upn", &u.Upn)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type Usage.
+func (u Usage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "currentValue", u.CurrentValue)
+ populate(objectMap, "limit", u.Limit)
+ populate(objectMap, "name", u.Name)
+ populate(objectMap, "unit", u.Unit)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type Usage.
+func (u *Usage) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "currentValue":
+ err = unpopulate(val, "CurrentValue", &u.CurrentValue)
+ delete(rawMsg, key)
+ case "limit":
+ err = unpopulate(val, "Limit", &u.Limit)
+ delete(rawMsg, key)
+ case "name":
+ err = unpopulate(val, "Name", &u.Name)
+ delete(rawMsg, key)
+ case "unit":
+ err = unpopulate(val, "Unit", &u.Unit)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UsageListResult.
+func (u UsageListResult) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "value", u.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UsageListResult.
+func (u *UsageListResult) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "value":
+ err = unpopulate(val, "Value", &u.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UsageName.
+func (u UsageName) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "localizedValue", u.LocalizedValue)
+ populate(objectMap, "value", u.Value)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UsageName.
+func (u *UsageName) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "localizedValue":
+ err = unpopulate(val, "LocalizedValue", &u.LocalizedValue)
+ delete(rawMsg, key)
+ case "value":
+ err = unpopulate(val, "Value", &u.Value)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.
+func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ populate(objectMap, "clientId", u.ClientID)
+ populate(objectMap, "principalId", u.PrincipalID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.
+func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "clientId":
+ err = unpopulate(val, "ClientID", &u.ClientID)
+ delete(rawMsg, key)
+ case "principalId":
+ err = unpopulate(val, "PrincipalID", &u.PrincipalID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", u, err)
+ }
+ }
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule.
+func (v VirtualNetworkRule) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]any)
+ objectMap["action"] = "Allow"
+ populate(objectMap, "state", v.State)
+ populate(objectMap, "id", v.VirtualNetworkResourceID)
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule.
+func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error {
+ var rawMsg map[string]json.RawMessage
+ if err := json.Unmarshal(data, &rawMsg); err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ for key, val := range rawMsg {
+ var err error
+ switch key {
+ case "action":
+ err = unpopulate(val, "Action", &v.Action)
+ delete(rawMsg, key)
+ case "state":
+ err = unpopulate(val, "State", &v.State)
+ delete(rawMsg, key)
+ case "id":
+ err = unpopulate(val, "VirtualNetworkResourceID", &v.VirtualNetworkResourceID)
+ delete(rawMsg, key)
+ }
+ if err != nil {
+ return fmt.Errorf("unmarshalling type %T: %v", v, err)
+ }
+ }
+ return nil
+}
+
+func populate(m map[string]any, k string, v any) {
+ if v == nil {
+ return
+ } else if azcore.IsNullValue(v) {
+ m[k] = nil
+ } else if !reflect.ValueOf(v).IsNil() {
+ m[k] = v
+ }
+}
+
+func populateAny(m map[string]any, k string, v any) {
+ if v == nil {
+ return
+ } else if azcore.IsNullValue(v) {
+ m[k] = nil
+ } else {
+ m[k] = v
+ }
+}
+
+func unpopulate(data json.RawMessage, fn string, v any) error {
+ if data == nil {
+ return nil
+ }
+ if err := json.Unmarshal(data, v); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ return nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/objectreplicationpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/objectreplicationpolicies_client.go
new file mode 100644
index 000000000..dc91e8ca3
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/objectreplicationpolicies_client.go
@@ -0,0 +1,324 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// ObjectReplicationPoliciesClient contains the methods for the ObjectReplicationPolicies group.
+// Don't use this type directly, use NewObjectReplicationPoliciesClient() instead.
+type ObjectReplicationPoliciesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewObjectReplicationPoliciesClient creates a new instance of ObjectReplicationPoliciesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewObjectReplicationPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ObjectReplicationPoliciesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &ObjectReplicationPoliciesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// CreateOrUpdate - Create or update the object replication policy of the storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - objectReplicationPolicyID - For the destination account, provide the value 'default'. Configure the policy on the destination
+// account first. For the source account, provide the value of the policy ID that is returned when you
+// download the policy that was defined on the destination account. The policy is downloaded as a JSON file.
+// - properties - The object replication policy set to a storage account. A unique policy ID will be created if absent.
+// - options - ObjectReplicationPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ObjectReplicationPoliciesClient.CreateOrUpdate
+// method.
+func (client *ObjectReplicationPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, properties ObjectReplicationPolicy, options *ObjectReplicationPoliciesClientCreateOrUpdateOptions) (ObjectReplicationPoliciesClientCreateOrUpdateResponse, error) {
+ var err error
+ const operationName = "ObjectReplicationPoliciesClient.CreateOrUpdate"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, objectReplicationPolicyID, properties, options)
+ if err != nil {
+ return ObjectReplicationPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ObjectReplicationPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ObjectReplicationPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ resp, err := client.createOrUpdateHandleResponse(httpResp)
+ return resp, err
+}
+
+// createOrUpdateCreateRequest creates the CreateOrUpdate request.
+func (client *ObjectReplicationPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, properties ObjectReplicationPolicy, options *ObjectReplicationPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if objectReplicationPolicyID == "" {
+ return nil, errors.New("parameter objectReplicationPolicyID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{objectReplicationPolicyId}", url.PathEscape(objectReplicationPolicyID))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createOrUpdateHandleResponse handles the CreateOrUpdate response.
+func (client *ObjectReplicationPoliciesClient) createOrUpdateHandleResponse(resp *http.Response) (ObjectReplicationPoliciesClientCreateOrUpdateResponse, error) {
+ result := ObjectReplicationPoliciesClientCreateOrUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ObjectReplicationPolicy); err != nil {
+ return ObjectReplicationPoliciesClientCreateOrUpdateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the object replication policy associated with the specified storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - objectReplicationPolicyID - For the destination account, provide the value 'default'. Configure the policy on the destination
+// account first. For the source account, provide the value of the policy ID that is returned when you
+// download the policy that was defined on the destination account. The policy is downloaded as a JSON file.
+// - options - ObjectReplicationPoliciesClientDeleteOptions contains the optional parameters for the ObjectReplicationPoliciesClient.Delete
+// method.
+func (client *ObjectReplicationPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, options *ObjectReplicationPoliciesClientDeleteOptions) (ObjectReplicationPoliciesClientDeleteResponse, error) {
+ var err error
+ const operationName = "ObjectReplicationPoliciesClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, objectReplicationPolicyID, options)
+ if err != nil {
+ return ObjectReplicationPoliciesClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ObjectReplicationPoliciesClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return ObjectReplicationPoliciesClientDeleteResponse{}, err
+ }
+ return ObjectReplicationPoliciesClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, options *ObjectReplicationPoliciesClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if objectReplicationPolicyID == "" {
+ return nil, errors.New("parameter objectReplicationPolicyID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{objectReplicationPolicyId}", url.PathEscape(objectReplicationPolicyID))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Get the object replication policy of the storage account by policy ID.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - objectReplicationPolicyID - For the destination account, provide the value 'default'. Configure the policy on the destination
+// account first. For the source account, provide the value of the policy ID that is returned when you
+// download the policy that was defined on the destination account. The policy is downloaded as a JSON file.
+// - options - ObjectReplicationPoliciesClientGetOptions contains the optional parameters for the ObjectReplicationPoliciesClient.Get
+// method.
+func (client *ObjectReplicationPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, options *ObjectReplicationPoliciesClientGetOptions) (ObjectReplicationPoliciesClientGetResponse, error) {
+ var err error
+ const operationName = "ObjectReplicationPoliciesClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, objectReplicationPolicyID, options)
+ if err != nil {
+ return ObjectReplicationPoliciesClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ObjectReplicationPoliciesClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return ObjectReplicationPoliciesClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *ObjectReplicationPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, options *ObjectReplicationPoliciesClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if objectReplicationPolicyID == "" {
+ return nil, errors.New("parameter objectReplicationPolicyID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{objectReplicationPolicyId}", url.PathEscape(objectReplicationPolicyID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *ObjectReplicationPoliciesClient) getHandleResponse(resp *http.Response) (ObjectReplicationPoliciesClientGetResponse, error) {
+ result := ObjectReplicationPoliciesClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ObjectReplicationPolicy); err != nil {
+ return ObjectReplicationPoliciesClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List the object replication policies associated with the storage account.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - ObjectReplicationPoliciesClientListOptions contains the optional parameters for the ObjectReplicationPoliciesClient.NewListPager
+// method.
+func (client *ObjectReplicationPoliciesClient) NewListPager(resourceGroupName string, accountName string, options *ObjectReplicationPoliciesClientListOptions) *runtime.Pager[ObjectReplicationPoliciesClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[ObjectReplicationPoliciesClientListResponse]{
+ More: func(page ObjectReplicationPoliciesClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *ObjectReplicationPoliciesClientListResponse) (ObjectReplicationPoliciesClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ObjectReplicationPoliciesClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return ObjectReplicationPoliciesClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return ObjectReplicationPoliciesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return ObjectReplicationPoliciesClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *ObjectReplicationPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *ObjectReplicationPoliciesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *ObjectReplicationPoliciesClient) listHandleResponse(resp *http.Response) (ObjectReplicationPoliciesClientListResponse, error) {
+ result := ObjectReplicationPoliciesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ObjectReplicationPolicies); err != nil {
+ return ObjectReplicationPoliciesClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/operations_client.go
new file mode 100644
index 000000000..74621df13
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/operations_client.go
@@ -0,0 +1,89 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+)
+
+// OperationsClient contains the methods for the Operations group.
+// Don't use this type directly, use NewOperationsClient() instead.
+type OperationsClient struct {
+ internal *arm.Client
+}
+
+// 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 NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &OperationsClient{
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - Lists all of the available Storage Rest API operations.
+//
+// Generated from API version 2023-01-01
+// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{
+ More: func(page OperationsClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationsClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, options)
+ if err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return OperationsClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) {
+ urlPath := "/providers/Microsoft.Storage/operations"
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) {
+ result := OperationsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil {
+ return OperationsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/options.go
new file mode 100644
index 000000000..d143bdb48
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/options.go
@@ -0,0 +1,577 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+// AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginAbortHierarchicalNamespaceMigration
+// method.
+type AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientBeginCreateOptions contains the optional parameters for the AccountsClient.BeginCreate method.
+type AccountsClientBeginCreateOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientBeginCustomerInitiatedMigrationOptions contains the optional parameters for the AccountsClient.BeginCustomerInitiatedMigration
+// method.
+type AccountsClientBeginCustomerInitiatedMigrationOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientBeginFailoverOptions contains the optional parameters for the AccountsClient.BeginFailover method.
+type AccountsClientBeginFailoverOptions struct {
+ // The parameter is set to 'Planned' to indicate whether a Planned failover is requested.. Specifying any value will set the
+ // value to Planned.
+ FailoverType *string
+
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientBeginHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginHierarchicalNamespaceMigration
+// method.
+type AccountsClientBeginHierarchicalNamespaceMigrationOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientBeginRestoreBlobRangesOptions contains the optional parameters for the AccountsClient.BeginRestoreBlobRanges
+// method.
+type AccountsClientBeginRestoreBlobRangesOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// AccountsClientCheckNameAvailabilityOptions contains the optional parameters for the AccountsClient.CheckNameAvailability
+// method.
+type AccountsClientCheckNameAvailabilityOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientDeleteOptions contains the optional parameters for the AccountsClient.Delete method.
+type AccountsClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientGetCustomerInitiatedMigrationOptions contains the optional parameters for the AccountsClient.GetCustomerInitiatedMigration
+// method.
+type AccountsClientGetCustomerInitiatedMigrationOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientGetPropertiesOptions contains the optional parameters for the AccountsClient.GetProperties method.
+type AccountsClientGetPropertiesOptions struct {
+ // May be used to expand the properties within account's properties. By default, data is not included when fetching properties.
+ // Currently we only support geoReplicationStats and blobRestoreStatus.
+ Expand *StorageAccountExpand
+}
+
+// AccountsClientListAccountSASOptions contains the optional parameters for the AccountsClient.ListAccountSAS method.
+type AccountsClientListAccountSASOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.NewListByResourceGroupPager
+// method.
+type AccountsClientListByResourceGroupOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientListKeysOptions contains the optional parameters for the AccountsClient.ListKeys method.
+type AccountsClientListKeysOptions struct {
+ // Specifies type of the key to be listed. Possible value is kerb.. Specifying any value will set the value to kerb.
+ Expand *string
+}
+
+// AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method.
+type AccountsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientListServiceSASOptions contains the optional parameters for the AccountsClient.ListServiceSAS method.
+type AccountsClientListServiceSASOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientRegenerateKeyOptions contains the optional parameters for the AccountsClient.RegenerateKey method.
+type AccountsClientRegenerateKeyOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientRevokeUserDelegationKeysOptions contains the optional parameters for the AccountsClient.RevokeUserDelegationKeys
+// method.
+type AccountsClientRevokeUserDelegationKeysOptions struct {
+ // placeholder for future optional parameters
+}
+
+// AccountsClientUpdateOptions contains the optional parameters for the AccountsClient.Update method.
+type AccountsClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientBeginObjectLevelWormOptions contains the optional parameters for the BlobContainersClient.BeginObjectLevelWorm
+// method.
+type BlobContainersClientBeginObjectLevelWormOptions struct {
+ // Resumes the LRO from the provided token.
+ ResumeToken string
+}
+
+// BlobContainersClientClearLegalHoldOptions contains the optional parameters for the BlobContainersClient.ClearLegalHold
+// method.
+type BlobContainersClientClearLegalHoldOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientCreateOptions contains the optional parameters for the BlobContainersClient.Create method.
+type BlobContainersClientCreateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.CreateOrUpdateImmutabilityPolicy
+// method.
+type BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions struct {
+ // The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation
+ // only if the immutability policy already exists. If omitted, this operation will
+ // always be applied.
+ IfMatch *string
+
+ // The ImmutabilityPolicy Properties that will be created or updated to a blob container.
+ Parameters *ImmutabilityPolicy
+}
+
+// BlobContainersClientDeleteImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.DeleteImmutabilityPolicy
+// method.
+type BlobContainersClientDeleteImmutabilityPolicyOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientDeleteOptions contains the optional parameters for the BlobContainersClient.Delete method.
+type BlobContainersClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientExtendImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.ExtendImmutabilityPolicy
+// method.
+type BlobContainersClientExtendImmutabilityPolicyOptions struct {
+ // The ImmutabilityPolicy Properties that will be extended for a blob container.
+ Parameters *ImmutabilityPolicy
+}
+
+// BlobContainersClientGetImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.GetImmutabilityPolicy
+// method.
+type BlobContainersClientGetImmutabilityPolicyOptions struct {
+ // The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation
+ // only if the immutability policy already exists. If omitted, this operation will
+ // always be applied.
+ IfMatch *string
+}
+
+// BlobContainersClientGetOptions contains the optional parameters for the BlobContainersClient.Get method.
+type BlobContainersClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientLeaseOptions contains the optional parameters for the BlobContainersClient.Lease method.
+type BlobContainersClientLeaseOptions struct {
+ // Lease Container request body.
+ Parameters *LeaseContainerRequest
+}
+
+// BlobContainersClientListOptions contains the optional parameters for the BlobContainersClient.NewListPager method.
+type BlobContainersClientListOptions struct {
+ // Optional. When specified, only container names starting with the filter will be listed.
+ Filter *string
+
+ // Optional, used to include the properties for soft deleted blob containers.
+ Include *ListContainersInclude
+
+ // Optional. Specified maximum number of containers that can be included in the list.
+ Maxpagesize *string
+}
+
+// BlobContainersClientLockImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.LockImmutabilityPolicy
+// method.
+type BlobContainersClientLockImmutabilityPolicyOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientSetLegalHoldOptions contains the optional parameters for the BlobContainersClient.SetLegalHold method.
+type BlobContainersClientSetLegalHoldOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobContainersClientUpdateOptions contains the optional parameters for the BlobContainersClient.Update method.
+type BlobContainersClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobInventoryPoliciesClientCreateOrUpdateOptions contains the optional parameters for the BlobInventoryPoliciesClient.CreateOrUpdate
+// method.
+type BlobInventoryPoliciesClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobInventoryPoliciesClientDeleteOptions contains the optional parameters for the BlobInventoryPoliciesClient.Delete method.
+type BlobInventoryPoliciesClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobInventoryPoliciesClientGetOptions contains the optional parameters for the BlobInventoryPoliciesClient.Get method.
+type BlobInventoryPoliciesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobInventoryPoliciesClientListOptions contains the optional parameters for the BlobInventoryPoliciesClient.NewListPager
+// method.
+type BlobInventoryPoliciesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobServicesClientGetServicePropertiesOptions contains the optional parameters for the BlobServicesClient.GetServiceProperties
+// method.
+type BlobServicesClientGetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobServicesClientListOptions contains the optional parameters for the BlobServicesClient.NewListPager method.
+type BlobServicesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// BlobServicesClientSetServicePropertiesOptions contains the optional parameters for the BlobServicesClient.SetServiceProperties
+// method.
+type BlobServicesClientSetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeletedAccountsClientGetOptions contains the optional parameters for the DeletedAccountsClient.Get method.
+type DeletedAccountsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// DeletedAccountsClientListOptions contains the optional parameters for the DeletedAccountsClient.NewListPager method.
+type DeletedAccountsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// EncryptionScopesClientGetOptions contains the optional parameters for the EncryptionScopesClient.Get method.
+type EncryptionScopesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// EncryptionScopesClientListOptions contains the optional parameters for the EncryptionScopesClient.NewListPager method.
+type EncryptionScopesClientListOptions struct {
+ // Optional. When specified, only encryption scope names starting with the filter will be listed.
+ Filter *string
+
+ // Optional, when specified, will list encryption scopes with the specific state. Defaults to All
+ Include *ListEncryptionScopesInclude
+
+ // Optional, specifies the maximum number of encryption scopes that will be included in the list response.
+ Maxpagesize *int32
+}
+
+// EncryptionScopesClientPatchOptions contains the optional parameters for the EncryptionScopesClient.Patch method.
+type EncryptionScopesClientPatchOptions struct {
+ // placeholder for future optional parameters
+}
+
+// EncryptionScopesClientPutOptions contains the optional parameters for the EncryptionScopesClient.Put method.
+type EncryptionScopesClientPutOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FileServicesClientGetServicePropertiesOptions contains the optional parameters for the FileServicesClient.GetServiceProperties
+// method.
+type FileServicesClientGetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FileServicesClientListOptions contains the optional parameters for the FileServicesClient.List method.
+type FileServicesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FileServicesClientSetServicePropertiesOptions contains the optional parameters for the FileServicesClient.SetServiceProperties
+// method.
+type FileServicesClientSetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FileSharesClientCreateOptions contains the optional parameters for the FileSharesClient.Create method.
+type FileSharesClientCreateOptions struct {
+ // Optional, used to expand the properties within share's properties. Valid values are: snapshots. Should be passed as a string
+ // with delimiter ','
+ Expand *string
+}
+
+// FileSharesClientDeleteOptions contains the optional parameters for the FileSharesClient.Delete method.
+type FileSharesClientDeleteOptions struct {
+ // Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For 'snapshots', the file
+ // share is deleted including all of its file share snapshots. If the file share
+ // contains leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file
+ // share snapshots (leased/unleased). For 'none', the file share is deleted if it
+ // has no share snapshots. If the file share contains any snapshots (leased or unleased), the deletion fails.
+ Include *string
+
+ // Optional, used to delete a snapshot.
+ XMSSnapshot *string
+}
+
+// FileSharesClientGetOptions contains the optional parameters for the FileSharesClient.Get method.
+type FileSharesClientGetOptions struct {
+ // Optional, used to expand the properties within share's properties. Valid values are: stats. Should be passed as a string
+ // with delimiter ','.
+ Expand *string
+
+ // Optional, used to retrieve properties of a snapshot.
+ XMSSnapshot *string
+}
+
+// FileSharesClientLeaseOptions contains the optional parameters for the FileSharesClient.Lease method.
+type FileSharesClientLeaseOptions struct {
+ // Lease Share request body.
+ Parameters *LeaseShareRequest
+
+ // Optional. Specify the snapshot time to lease a snapshot.
+ XMSSnapshot *string
+}
+
+// FileSharesClientListOptions contains the optional parameters for the FileSharesClient.NewListPager method.
+type FileSharesClientListOptions struct {
+ // Optional, used to expand the properties within share's properties. Valid values are: deleted, snapshots. Should be passed
+ // as a string with delimiter ','
+ Expand *string
+
+ // Optional. When specified, only share names starting with the filter will be listed.
+ Filter *string
+
+ // Optional. Specified maximum number of shares that can be included in the list.
+ Maxpagesize *string
+}
+
+// FileSharesClientRestoreOptions contains the optional parameters for the FileSharesClient.Restore method.
+type FileSharesClientRestoreOptions struct {
+ // placeholder for future optional parameters
+}
+
+// FileSharesClientUpdateOptions contains the optional parameters for the FileSharesClient.Update method.
+type FileSharesClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LocalUsersClientCreateOrUpdateOptions contains the optional parameters for the LocalUsersClient.CreateOrUpdate method.
+type LocalUsersClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LocalUsersClientDeleteOptions contains the optional parameters for the LocalUsersClient.Delete method.
+type LocalUsersClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LocalUsersClientGetOptions contains the optional parameters for the LocalUsersClient.Get method.
+type LocalUsersClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LocalUsersClientListKeysOptions contains the optional parameters for the LocalUsersClient.ListKeys method.
+type LocalUsersClientListKeysOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LocalUsersClientListOptions contains the optional parameters for the LocalUsersClient.NewListPager method.
+type LocalUsersClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// LocalUsersClientRegeneratePasswordOptions contains the optional parameters for the LocalUsersClient.RegeneratePassword
+// method.
+type LocalUsersClientRegeneratePasswordOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ManagementPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ManagementPoliciesClient.CreateOrUpdate
+// method.
+type ManagementPoliciesClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ManagementPoliciesClientDeleteOptions contains the optional parameters for the ManagementPoliciesClient.Delete method.
+type ManagementPoliciesClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ManagementPoliciesClientGetOptions contains the optional parameters for the ManagementPoliciesClient.Get method.
+type ManagementPoliciesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ObjectReplicationPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ObjectReplicationPoliciesClient.CreateOrUpdate
+// method.
+type ObjectReplicationPoliciesClientCreateOrUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ObjectReplicationPoliciesClientDeleteOptions contains the optional parameters for the ObjectReplicationPoliciesClient.Delete
+// method.
+type ObjectReplicationPoliciesClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ObjectReplicationPoliciesClientGetOptions contains the optional parameters for the ObjectReplicationPoliciesClient.Get
+// method.
+type ObjectReplicationPoliciesClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// ObjectReplicationPoliciesClientListOptions contains the optional parameters for the ObjectReplicationPoliciesClient.NewListPager
+// method.
+type ObjectReplicationPoliciesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
+type OperationsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete
+// method.
+type PrivateEndpointConnectionsClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get
+// method.
+type PrivateEndpointConnectionsClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager
+// method.
+type PrivateEndpointConnectionsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// PrivateEndpointConnectionsClientPutOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Put
+// method.
+type PrivateEndpointConnectionsClientPutOptions struct {
+ // placeholder for future optional parameters
+}
+
+// PrivateLinkResourcesClientListByStorageAccountOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByStorageAccount
+// method.
+type PrivateLinkResourcesClientListByStorageAccountOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueClientCreateOptions contains the optional parameters for the QueueClient.Create method.
+type QueueClientCreateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueClientDeleteOptions contains the optional parameters for the QueueClient.Delete method.
+type QueueClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueClientGetOptions contains the optional parameters for the QueueClient.Get method.
+type QueueClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueClientListOptions contains the optional parameters for the QueueClient.NewListPager method.
+type QueueClientListOptions struct {
+ // Optional, When specified, only the queues with a name starting with the given filter will be listed.
+ Filter *string
+
+ // Optional, a maximum number of queues that should be included in a list queue response
+ Maxpagesize *string
+}
+
+// QueueClientUpdateOptions contains the optional parameters for the QueueClient.Update method.
+type QueueClientUpdateOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueServicesClientGetServicePropertiesOptions contains the optional parameters for the QueueServicesClient.GetServiceProperties
+// method.
+type QueueServicesClientGetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueServicesClientListOptions contains the optional parameters for the QueueServicesClient.List method.
+type QueueServicesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// QueueServicesClientSetServicePropertiesOptions contains the optional parameters for the QueueServicesClient.SetServiceProperties
+// method.
+type QueueServicesClientSetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method.
+type SKUsClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableClientCreateOptions contains the optional parameters for the TableClient.Create method.
+type TableClientCreateOptions struct {
+ // The parameters to provide to create a table.
+ Parameters *Table
+}
+
+// TableClientDeleteOptions contains the optional parameters for the TableClient.Delete method.
+type TableClientDeleteOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableClientGetOptions contains the optional parameters for the TableClient.Get method.
+type TableClientGetOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableClientListOptions contains the optional parameters for the TableClient.NewListPager method.
+type TableClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableClientUpdateOptions contains the optional parameters for the TableClient.Update method.
+type TableClientUpdateOptions struct {
+ // The parameters to provide to create a table.
+ Parameters *Table
+}
+
+// TableServicesClientGetServicePropertiesOptions contains the optional parameters for the TableServicesClient.GetServiceProperties
+// method.
+type TableServicesClientGetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableServicesClientListOptions contains the optional parameters for the TableServicesClient.List method.
+type TableServicesClientListOptions struct {
+ // placeholder for future optional parameters
+}
+
+// TableServicesClientSetServicePropertiesOptions contains the optional parameters for the TableServicesClient.SetServiceProperties
+// method.
+type TableServicesClientSetServicePropertiesOptions struct {
+ // placeholder for future optional parameters
+}
+
+// UsagesClientListByLocationOptions contains the optional parameters for the UsagesClient.NewListByLocationPager method.
+type UsagesClientListByLocationOptions struct {
+ // placeholder for future optional parameters
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privateendpointconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privateendpointconnections_client.go
new file mode 100644
index 000000000..cde0f2d21
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privateendpointconnections_client.go
@@ -0,0 +1,318 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group.
+// Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead.
+type PrivateEndpointConnectionsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &PrivateEndpointConnectionsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Delete - Deletes the specified private endpoint connection associated with the storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
+// - options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete
+// method.
+func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteOptions) (PrivateEndpointConnectionsClientDeleteResponse, error) {
+ var err error
+ const operationName = "PrivateEndpointConnectionsClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options)
+ if err != nil {
+ return PrivateEndpointConnectionsClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return PrivateEndpointConnectionsClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return PrivateEndpointConnectionsClientDeleteResponse{}, err
+ }
+ return PrivateEndpointConnectionsClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if privateEndpointConnectionName == "" {
+ return nil, errors.New("parameter privateEndpointConnectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets the specified private endpoint connection associated with the storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
+// - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get
+// method.
+func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) {
+ var err error
+ const operationName = "PrivateEndpointConnectionsClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options)
+ if err != nil {
+ return PrivateEndpointConnectionsClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return PrivateEndpointConnectionsClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return PrivateEndpointConnectionsClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if privateEndpointConnectionName == "" {
+ return nil, errors.New("parameter privateEndpointConnectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetResponse, error) {
+ result := PrivateEndpointConnectionsClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil {
+ return PrivateEndpointConnectionsClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - List all the private endpoint connections associated with the storage account.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager
+// method.
+func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, accountName string, options *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListResponse]{
+ More: func(page PrivateEndpointConnectionsClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListResponse) (PrivateEndpointConnectionsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PrivateEndpointConnectionsClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return PrivateEndpointConnectionsClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return PrivateEndpointConnectionsClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return PrivateEndpointConnectionsClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListResponse, error) {
+ result := PrivateEndpointConnectionsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil {
+ return PrivateEndpointConnectionsClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// Put - Update the state of specified private endpoint connection associated with the storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource
+// - properties - The private endpoint connection properties.
+// - options - PrivateEndpointConnectionsClientPutOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Put
+// method.
+func (client *PrivateEndpointConnectionsClient) Put(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientPutOptions) (PrivateEndpointConnectionsClientPutResponse, error) {
+ var err error
+ const operationName = "PrivateEndpointConnectionsClient.Put"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.putCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, properties, options)
+ if err != nil {
+ return PrivateEndpointConnectionsClientPutResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return PrivateEndpointConnectionsClientPutResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return PrivateEndpointConnectionsClientPutResponse{}, err
+ }
+ resp, err := client.putHandleResponse(httpResp)
+ return resp, err
+}
+
+// putCreateRequest creates the Put request.
+func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientPutOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if privateEndpointConnectionName == "" {
+ return nil, errors.New("parameter privateEndpointConnectionName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, properties); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// putHandleResponse handles the Put response.
+func (client *PrivateEndpointConnectionsClient) putHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientPutResponse, error) {
+ result := PrivateEndpointConnectionsClientPutResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil {
+ return PrivateEndpointConnectionsClientPutResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privatelinkresources_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privatelinkresources_client.go
new file mode 100644
index 000000000..7127815f0
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privatelinkresources_client.go
@@ -0,0 +1,110 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group.
+// Don't use this type directly, use NewPrivateLinkResourcesClient() instead.
+type PrivateLinkResourcesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &PrivateLinkResourcesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// ListByStorageAccount - Gets the private link resources that need to be created for a storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - PrivateLinkResourcesClientListByStorageAccountOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByStorageAccount
+// method.
+func (client *PrivateLinkResourcesClient) ListByStorageAccount(ctx context.Context, resourceGroupName string, accountName string, options *PrivateLinkResourcesClientListByStorageAccountOptions) (PrivateLinkResourcesClientListByStorageAccountResponse, error) {
+ var err error
+ const operationName = "PrivateLinkResourcesClient.ListByStorageAccount"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listByStorageAccountCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return PrivateLinkResourcesClientListByStorageAccountResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return PrivateLinkResourcesClientListByStorageAccountResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return PrivateLinkResourcesClientListByStorageAccountResponse{}, err
+ }
+ resp, err := client.listByStorageAccountHandleResponse(httpResp)
+ return resp, err
+}
+
+// listByStorageAccountCreateRequest creates the ListByStorageAccount request.
+func (client *PrivateLinkResourcesClient) listByStorageAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *PrivateLinkResourcesClientListByStorageAccountOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByStorageAccountHandleResponse handles the ListByStorageAccount response.
+func (client *PrivateLinkResourcesClient) listByStorageAccountHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListByStorageAccountResponse, error) {
+ result := PrivateLinkResourcesClientListByStorageAccountResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil {
+ return PrivateLinkResourcesClientListByStorageAccountResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queue_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queue_client.go
new file mode 100644
index 000000000..743fcc983
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queue_client.go
@@ -0,0 +1,401 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// QueueClient contains the methods for the Queue group.
+// Don't use this type directly, use NewQueueClient() instead.
+type QueueClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewQueueClient creates a new instance of QueueClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewQueueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QueueClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &QueueClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Create - Creates a new queue with the specified queue name, under the specified account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - queueName - A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with
+// an alphanumeric character and it cannot have two consecutive dash(-) characters.
+// - queue - Queue properties and metadata to be created with
+// - options - QueueClientCreateOptions contains the optional parameters for the QueueClient.Create method.
+func (client *QueueClient) Create(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, options *QueueClientCreateOptions) (QueueClientCreateResponse, error) {
+ var err error
+ const operationName = "QueueClient.Create"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, queueName, queue, options)
+ if err != nil {
+ return QueueClientCreateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueClientCreateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueClientCreateResponse{}, err
+ }
+ resp, err := client.createHandleResponse(httpResp)
+ return resp, err
+}
+
+// createCreateRequest creates the Create request.
+func (client *QueueClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, options *QueueClientCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if queueName == "" {
+ return nil, errors.New("parameter queueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, queue); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// createHandleResponse handles the Create response.
+func (client *QueueClient) createHandleResponse(resp *http.Response) (QueueClientCreateResponse, error) {
+ result := QueueClientCreateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Queue); err != nil {
+ return QueueClientCreateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the queue with the specified queue name, under the specified account if it exists.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - queueName - A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with
+// an alphanumeric character and it cannot have two consecutive dash(-) characters.
+// - options - QueueClientDeleteOptions contains the optional parameters for the QueueClient.Delete method.
+func (client *QueueClient) Delete(ctx context.Context, resourceGroupName string, accountName string, queueName string, options *QueueClientDeleteOptions) (QueueClientDeleteResponse, error) {
+ var err error
+ const operationName = "QueueClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, queueName, options)
+ if err != nil {
+ return QueueClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueClientDeleteResponse{}, err
+ }
+ return QueueClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, options *QueueClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if queueName == "" {
+ return nil, errors.New("parameter queueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets the queue with the specified queue name, under the specified account if it exists.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - queueName - A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with
+// an alphanumeric character and it cannot have two consecutive dash(-) characters.
+// - options - QueueClientGetOptions contains the optional parameters for the QueueClient.Get method.
+func (client *QueueClient) Get(ctx context.Context, resourceGroupName string, accountName string, queueName string, options *QueueClientGetOptions) (QueueClientGetResponse, error) {
+ var err error
+ const operationName = "QueueClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, queueName, options)
+ if err != nil {
+ return QueueClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *QueueClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, options *QueueClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if queueName == "" {
+ return nil, errors.New("parameter queueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *QueueClient) getHandleResponse(resp *http.Response) (QueueClientGetResponse, error) {
+ result := QueueClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Queue); err != nil {
+ return QueueClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets a list of all the queues under the specified storage account
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - QueueClientListOptions contains the optional parameters for the QueueClient.NewListPager method.
+func (client *QueueClient) NewListPager(resourceGroupName string, accountName string, options *QueueClientListOptions) *runtime.Pager[QueueClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[QueueClientListResponse]{
+ More: func(page QueueClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *QueueClientListResponse) (QueueClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "QueueClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return QueueClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *QueueClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *QueueClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ if options != nil && options.Maxpagesize != nil {
+ reqQP.Set("$maxpagesize", *options.Maxpagesize)
+ }
+ if options != nil && options.Filter != nil {
+ reqQP.Set("$filter", *options.Filter)
+ }
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *QueueClient) listHandleResponse(resp *http.Response) (QueueClientListResponse, error) {
+ result := QueueClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListQueueResource); err != nil {
+ return QueueClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - Creates a new queue with the specified queue name, under the specified account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - queueName - A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with
+// an alphanumeric character and it cannot have two consecutive dash(-) characters.
+// - queue - Queue properties and metadata to be created with
+// - options - QueueClientUpdateOptions contains the optional parameters for the QueueClient.Update method.
+func (client *QueueClient) Update(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, options *QueueClientUpdateOptions) (QueueClientUpdateResponse, error) {
+ var err error
+ const operationName = "QueueClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, queueName, queue, options)
+ if err != nil {
+ return QueueClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *QueueClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, options *QueueClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if queueName == "" {
+ return nil, errors.New("parameter queueName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{queueName}", url.PathEscape(queueName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, queue); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *QueueClient) updateHandleResponse(resp *http.Response) (QueueClientUpdateResponse, error) {
+ result := QueueClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Queue); err != nil {
+ return QueueClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queueservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queueservices_client.go
new file mode 100644
index 000000000..75786fe94
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queueservices_client.go
@@ -0,0 +1,250 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// QueueServicesClient contains the methods for the QueueServices group.
+// Don't use this type directly, use NewQueueServicesClient() instead.
+type QueueServicesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewQueueServicesClient creates a new instance of QueueServicesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewQueueServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QueueServicesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &QueueServicesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// GetServiceProperties - Gets the properties of a storage account’s Queue service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - QueueServicesClientGetServicePropertiesOptions contains the optional parameters for the QueueServicesClient.GetServiceProperties
+// method.
+func (client *QueueServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, options *QueueServicesClientGetServicePropertiesOptions) (QueueServicesClientGetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "QueueServicesClient.GetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return QueueServicesClientGetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueServicesClientGetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueServicesClientGetServicePropertiesResponse{}, err
+ }
+ resp, err := client.getServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// getServicePropertiesCreateRequest creates the GetServiceProperties request.
+func (client *QueueServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *QueueServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{queueServiceName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getServicePropertiesHandleResponse handles the GetServiceProperties response.
+func (client *QueueServicesClient) getServicePropertiesHandleResponse(resp *http.Response) (QueueServicesClientGetServicePropertiesResponse, error) {
+ result := QueueServicesClientGetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.QueueServiceProperties); err != nil {
+ return QueueServicesClientGetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
+
+// List - List all queue services for the storage account
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - QueueServicesClientListOptions contains the optional parameters for the QueueServicesClient.List method.
+func (client *QueueServicesClient) List(ctx context.Context, resourceGroupName string, accountName string, options *QueueServicesClientListOptions) (QueueServicesClientListResponse, error) {
+ var err error
+ const operationName = "QueueServicesClient.List"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return QueueServicesClientListResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueServicesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueServicesClientListResponse{}, err
+ }
+ resp, err := client.listHandleResponse(httpResp)
+ return resp, err
+}
+
+// listCreateRequest creates the List request.
+func (client *QueueServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *QueueServicesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *QueueServicesClient) listHandleResponse(resp *http.Response) (QueueServicesClientListResponse, error) {
+ result := QueueServicesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListQueueServices); err != nil {
+ return QueueServicesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// SetServiceProperties - Sets the properties of a storage account’s Queue service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The properties of a storage account’s Queue service, only properties for Storage Analytics and CORS (Cross-Origin
+// Resource Sharing) rules can be specified.
+// - options - QueueServicesClientSetServicePropertiesOptions contains the optional parameters for the QueueServicesClient.SetServiceProperties
+// method.
+func (client *QueueServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters QueueServiceProperties, options *QueueServicesClientSetServicePropertiesOptions) (QueueServicesClientSetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "QueueServicesClient.SetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.setServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return QueueServicesClientSetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return QueueServicesClientSetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return QueueServicesClientSetServicePropertiesResponse{}, err
+ }
+ resp, err := client.setServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// setServicePropertiesCreateRequest creates the SetServiceProperties request.
+func (client *QueueServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters QueueServiceProperties, options *QueueServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{queueServiceName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// setServicePropertiesHandleResponse handles the SetServiceProperties response.
+func (client *QueueServicesClient) setServicePropertiesHandleResponse(resp *http.Response) (QueueServicesClientSetServicePropertiesResponse, error) {
+ result := QueueServicesClientSetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.QueueServiceProperties); err != nil {
+ return QueueServicesClientSetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/response_types.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/response_types.go
new file mode 100644
index 000000000..e5b7eb742
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/response_types.go
@@ -0,0 +1,557 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+// AccountsClientAbortHierarchicalNamespaceMigrationResponse contains the response from method AccountsClient.BeginAbortHierarchicalNamespaceMigration.
+type AccountsClientAbortHierarchicalNamespaceMigrationResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientCheckNameAvailabilityResponse contains the response from method AccountsClient.CheckNameAvailability.
+type AccountsClientCheckNameAvailabilityResponse struct {
+ // The CheckNameAvailability operation response.
+ CheckNameAvailabilityResult
+}
+
+// AccountsClientCreateResponse contains the response from method AccountsClient.BeginCreate.
+type AccountsClientCreateResponse struct {
+ // The storage account.
+ Account
+}
+
+// AccountsClientCustomerInitiatedMigrationResponse contains the response from method AccountsClient.BeginCustomerInitiatedMigration.
+type AccountsClientCustomerInitiatedMigrationResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientDeleteResponse contains the response from method AccountsClient.Delete.
+type AccountsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientFailoverResponse contains the response from method AccountsClient.BeginFailover.
+type AccountsClientFailoverResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientGetCustomerInitiatedMigrationResponse contains the response from method AccountsClient.GetCustomerInitiatedMigration.
+type AccountsClientGetCustomerInitiatedMigrationResponse struct {
+ // The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current
+ // SKU or region.
+ AccountMigration
+}
+
+// AccountsClientGetPropertiesResponse contains the response from method AccountsClient.GetProperties.
+type AccountsClientGetPropertiesResponse struct {
+ // The storage account.
+ Account
+}
+
+// AccountsClientHierarchicalNamespaceMigrationResponse contains the response from method AccountsClient.BeginHierarchicalNamespaceMigration.
+type AccountsClientHierarchicalNamespaceMigrationResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientListAccountSASResponse contains the response from method AccountsClient.ListAccountSAS.
+type AccountsClientListAccountSASResponse struct {
+ // The List SAS credentials operation response.
+ ListAccountSasResponse
+}
+
+// AccountsClientListByResourceGroupResponse contains the response from method AccountsClient.NewListByResourceGroupPager.
+type AccountsClientListByResourceGroupResponse struct {
+ // The response from the List Storage Accounts operation.
+ AccountListResult
+}
+
+// AccountsClientListKeysResponse contains the response from method AccountsClient.ListKeys.
+type AccountsClientListKeysResponse struct {
+ // The response from the ListKeys operation.
+ AccountListKeysResult
+}
+
+// AccountsClientListResponse contains the response from method AccountsClient.NewListPager.
+type AccountsClientListResponse struct {
+ // The response from the List Storage Accounts operation.
+ AccountListResult
+}
+
+// AccountsClientListServiceSASResponse contains the response from method AccountsClient.ListServiceSAS.
+type AccountsClientListServiceSASResponse struct {
+ // The List service SAS credentials operation response.
+ ListServiceSasResponse
+}
+
+// AccountsClientRegenerateKeyResponse contains the response from method AccountsClient.RegenerateKey.
+type AccountsClientRegenerateKeyResponse struct {
+ // The response from the ListKeys operation.
+ AccountListKeysResult
+}
+
+// AccountsClientRestoreBlobRangesResponse contains the response from method AccountsClient.BeginRestoreBlobRanges.
+type AccountsClientRestoreBlobRangesResponse struct {
+ // Blob restore status.
+ BlobRestoreStatus
+}
+
+// AccountsClientRevokeUserDelegationKeysResponse contains the response from method AccountsClient.RevokeUserDelegationKeys.
+type AccountsClientRevokeUserDelegationKeysResponse struct {
+ // placeholder for future response values
+}
+
+// AccountsClientUpdateResponse contains the response from method AccountsClient.Update.
+type AccountsClientUpdateResponse struct {
+ // The storage account.
+ Account
+}
+
+// BlobContainersClientClearLegalHoldResponse contains the response from method BlobContainersClient.ClearLegalHold.
+type BlobContainersClientClearLegalHoldResponse struct {
+ // The LegalHold property of a blob container.
+ LegalHold
+}
+
+// BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse contains the response from method BlobContainersClient.CreateOrUpdateImmutabilityPolicy.
+type BlobContainersClientCreateOrUpdateImmutabilityPolicyResponse struct {
+ // The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+ ImmutabilityPolicy
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// BlobContainersClientCreateResponse contains the response from method BlobContainersClient.Create.
+type BlobContainersClientCreateResponse struct {
+ // Properties of the blob container, including Id, resource name, resource type, Etag.
+ BlobContainer
+}
+
+// BlobContainersClientDeleteImmutabilityPolicyResponse contains the response from method BlobContainersClient.DeleteImmutabilityPolicy.
+type BlobContainersClientDeleteImmutabilityPolicyResponse struct {
+ // The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+ ImmutabilityPolicy
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// BlobContainersClientDeleteResponse contains the response from method BlobContainersClient.Delete.
+type BlobContainersClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// BlobContainersClientExtendImmutabilityPolicyResponse contains the response from method BlobContainersClient.ExtendImmutabilityPolicy.
+type BlobContainersClientExtendImmutabilityPolicyResponse struct {
+ // The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+ ImmutabilityPolicy
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// BlobContainersClientGetImmutabilityPolicyResponse contains the response from method BlobContainersClient.GetImmutabilityPolicy.
+type BlobContainersClientGetImmutabilityPolicyResponse struct {
+ // The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+ ImmutabilityPolicy
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// BlobContainersClientGetResponse contains the response from method BlobContainersClient.Get.
+type BlobContainersClientGetResponse struct {
+ // Properties of the blob container, including Id, resource name, resource type, Etag.
+ BlobContainer
+}
+
+// BlobContainersClientLeaseResponse contains the response from method BlobContainersClient.Lease.
+type BlobContainersClientLeaseResponse struct {
+ // Lease Container response schema.
+ LeaseContainerResponse
+}
+
+// BlobContainersClientListResponse contains the response from method BlobContainersClient.NewListPager.
+type BlobContainersClientListResponse struct {
+ // Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers.
+ ListContainerItems
+}
+
+// BlobContainersClientLockImmutabilityPolicyResponse contains the response from method BlobContainersClient.LockImmutabilityPolicy.
+type BlobContainersClientLockImmutabilityPolicyResponse struct {
+ // The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
+ ImmutabilityPolicy
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// BlobContainersClientObjectLevelWormResponse contains the response from method BlobContainersClient.BeginObjectLevelWorm.
+type BlobContainersClientObjectLevelWormResponse struct {
+ // placeholder for future response values
+}
+
+// BlobContainersClientSetLegalHoldResponse contains the response from method BlobContainersClient.SetLegalHold.
+type BlobContainersClientSetLegalHoldResponse struct {
+ // The LegalHold property of a blob container.
+ LegalHold
+}
+
+// BlobContainersClientUpdateResponse contains the response from method BlobContainersClient.Update.
+type BlobContainersClientUpdateResponse struct {
+ // Properties of the blob container, including Id, resource name, resource type, Etag.
+ BlobContainer
+}
+
+// BlobInventoryPoliciesClientCreateOrUpdateResponse contains the response from method BlobInventoryPoliciesClient.CreateOrUpdate.
+type BlobInventoryPoliciesClientCreateOrUpdateResponse struct {
+ // The storage account blob inventory policy.
+ BlobInventoryPolicy
+}
+
+// BlobInventoryPoliciesClientDeleteResponse contains the response from method BlobInventoryPoliciesClient.Delete.
+type BlobInventoryPoliciesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// BlobInventoryPoliciesClientGetResponse contains the response from method BlobInventoryPoliciesClient.Get.
+type BlobInventoryPoliciesClientGetResponse struct {
+ // The storage account blob inventory policy.
+ BlobInventoryPolicy
+}
+
+// BlobInventoryPoliciesClientListResponse contains the response from method BlobInventoryPoliciesClient.NewListPager.
+type BlobInventoryPoliciesClientListResponse struct {
+ // List of blob inventory policies returned.
+ ListBlobInventoryPolicy
+}
+
+// BlobServicesClientGetServicePropertiesResponse contains the response from method BlobServicesClient.GetServiceProperties.
+type BlobServicesClientGetServicePropertiesResponse struct {
+ // The properties of a storage account’s Blob service.
+ BlobServiceProperties
+}
+
+// BlobServicesClientListResponse contains the response from method BlobServicesClient.NewListPager.
+type BlobServicesClientListResponse struct {
+ BlobServiceItems
+}
+
+// BlobServicesClientSetServicePropertiesResponse contains the response from method BlobServicesClient.SetServiceProperties.
+type BlobServicesClientSetServicePropertiesResponse struct {
+ // The properties of a storage account’s Blob service.
+ BlobServiceProperties
+}
+
+// DeletedAccountsClientGetResponse contains the response from method DeletedAccountsClient.Get.
+type DeletedAccountsClientGetResponse struct {
+ // Deleted storage account
+ DeletedAccount
+}
+
+// DeletedAccountsClientListResponse contains the response from method DeletedAccountsClient.NewListPager.
+type DeletedAccountsClientListResponse struct {
+ // The response from the List Deleted Accounts operation.
+ DeletedAccountListResult
+}
+
+// EncryptionScopesClientGetResponse contains the response from method EncryptionScopesClient.Get.
+type EncryptionScopesClientGetResponse struct {
+ // The Encryption Scope resource.
+ EncryptionScope
+}
+
+// EncryptionScopesClientListResponse contains the response from method EncryptionScopesClient.NewListPager.
+type EncryptionScopesClientListResponse struct {
+ // List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes.
+ EncryptionScopeListResult
+}
+
+// EncryptionScopesClientPatchResponse contains the response from method EncryptionScopesClient.Patch.
+type EncryptionScopesClientPatchResponse struct {
+ // The Encryption Scope resource.
+ EncryptionScope
+}
+
+// EncryptionScopesClientPutResponse contains the response from method EncryptionScopesClient.Put.
+type EncryptionScopesClientPutResponse struct {
+ // The Encryption Scope resource.
+ EncryptionScope
+}
+
+// FileServicesClientGetServicePropertiesResponse contains the response from method FileServicesClient.GetServiceProperties.
+type FileServicesClientGetServicePropertiesResponse struct {
+ // The properties of File services in storage account.
+ FileServiceProperties
+}
+
+// FileServicesClientListResponse contains the response from method FileServicesClient.List.
+type FileServicesClientListResponse struct {
+ FileServiceItems
+}
+
+// FileServicesClientSetServicePropertiesResponse contains the response from method FileServicesClient.SetServiceProperties.
+type FileServicesClientSetServicePropertiesResponse struct {
+ // The properties of File services in storage account.
+ FileServiceProperties
+}
+
+// FileSharesClientCreateResponse contains the response from method FileSharesClient.Create.
+type FileSharesClientCreateResponse struct {
+ // Properties of the file share, including Id, resource name, resource type, Etag.
+ FileShare
+}
+
+// FileSharesClientDeleteResponse contains the response from method FileSharesClient.Delete.
+type FileSharesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// FileSharesClientGetResponse contains the response from method FileSharesClient.Get.
+type FileSharesClientGetResponse struct {
+ // Properties of the file share, including Id, resource name, resource type, Etag.
+ FileShare
+}
+
+// FileSharesClientLeaseResponse contains the response from method FileSharesClient.Lease.
+type FileSharesClientLeaseResponse struct {
+ // Lease Share response schema.
+ LeaseShareResponse
+
+ // ETag contains the information returned from the ETag header response.
+ ETag *string
+}
+
+// FileSharesClientListResponse contains the response from method FileSharesClient.NewListPager.
+type FileSharesClientListResponse struct {
+ // Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares.
+ FileShareItems
+}
+
+// FileSharesClientRestoreResponse contains the response from method FileSharesClient.Restore.
+type FileSharesClientRestoreResponse struct {
+ // placeholder for future response values
+}
+
+// FileSharesClientUpdateResponse contains the response from method FileSharesClient.Update.
+type FileSharesClientUpdateResponse struct {
+ // Properties of the file share, including Id, resource name, resource type, Etag.
+ FileShare
+}
+
+// LocalUsersClientCreateOrUpdateResponse contains the response from method LocalUsersClient.CreateOrUpdate.
+type LocalUsersClientCreateOrUpdateResponse struct {
+ // The local user associated with the storage accounts.
+ LocalUser
+}
+
+// LocalUsersClientDeleteResponse contains the response from method LocalUsersClient.Delete.
+type LocalUsersClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// LocalUsersClientGetResponse contains the response from method LocalUsersClient.Get.
+type LocalUsersClientGetResponse struct {
+ // The local user associated with the storage accounts.
+ LocalUser
+}
+
+// LocalUsersClientListKeysResponse contains the response from method LocalUsersClient.ListKeys.
+type LocalUsersClientListKeysResponse struct {
+ // The Storage Account Local User keys.
+ LocalUserKeys
+}
+
+// LocalUsersClientListResponse contains the response from method LocalUsersClient.NewListPager.
+type LocalUsersClientListResponse struct {
+ // List storage account local users.
+ LocalUsers
+}
+
+// LocalUsersClientRegeneratePasswordResponse contains the response from method LocalUsersClient.RegeneratePassword.
+type LocalUsersClientRegeneratePasswordResponse struct {
+ // The secrets of Storage Account Local User.
+ LocalUserRegeneratePasswordResult
+}
+
+// ManagementPoliciesClientCreateOrUpdateResponse contains the response from method ManagementPoliciesClient.CreateOrUpdate.
+type ManagementPoliciesClientCreateOrUpdateResponse struct {
+ // The Get Storage Account ManagementPolicies operation response.
+ ManagementPolicy
+}
+
+// ManagementPoliciesClientDeleteResponse contains the response from method ManagementPoliciesClient.Delete.
+type ManagementPoliciesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// ManagementPoliciesClientGetResponse contains the response from method ManagementPoliciesClient.Get.
+type ManagementPoliciesClientGetResponse struct {
+ // The Get Storage Account ManagementPolicies operation response.
+ ManagementPolicy
+}
+
+// ObjectReplicationPoliciesClientCreateOrUpdateResponse contains the response from method ObjectReplicationPoliciesClient.CreateOrUpdate.
+type ObjectReplicationPoliciesClientCreateOrUpdateResponse struct {
+ // The replication policy between two storage accounts. Multiple rules can be defined in one policy.
+ ObjectReplicationPolicy
+}
+
+// ObjectReplicationPoliciesClientDeleteResponse contains the response from method ObjectReplicationPoliciesClient.Delete.
+type ObjectReplicationPoliciesClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// ObjectReplicationPoliciesClientGetResponse contains the response from method ObjectReplicationPoliciesClient.Get.
+type ObjectReplicationPoliciesClientGetResponse struct {
+ // The replication policy between two storage accounts. Multiple rules can be defined in one policy.
+ ObjectReplicationPolicy
+}
+
+// ObjectReplicationPoliciesClientListResponse contains the response from method ObjectReplicationPoliciesClient.NewListPager.
+type ObjectReplicationPoliciesClientListResponse struct {
+ // List storage account object replication policies.
+ ObjectReplicationPolicies
+}
+
+// OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
+type OperationsClientListResponse struct {
+ // Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set of
+ // results.
+ OperationListResult
+}
+
+// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete.
+type PrivateEndpointConnectionsClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.
+type PrivateEndpointConnectionsClientGetResponse struct {
+ // The Private Endpoint Connection resource.
+ PrivateEndpointConnection
+}
+
+// PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.NewListPager.
+type PrivateEndpointConnectionsClientListResponse struct {
+ // List of private endpoint connection associated with the specified storage account
+ PrivateEndpointConnectionListResult
+}
+
+// PrivateEndpointConnectionsClientPutResponse contains the response from method PrivateEndpointConnectionsClient.Put.
+type PrivateEndpointConnectionsClientPutResponse struct {
+ // The Private Endpoint Connection resource.
+ PrivateEndpointConnection
+}
+
+// PrivateLinkResourcesClientListByStorageAccountResponse contains the response from method PrivateLinkResourcesClient.ListByStorageAccount.
+type PrivateLinkResourcesClientListByStorageAccountResponse struct {
+ // A list of private link resources
+ PrivateLinkResourceListResult
+}
+
+// QueueClientCreateResponse contains the response from method QueueClient.Create.
+type QueueClientCreateResponse struct {
+ Queue
+}
+
+// QueueClientDeleteResponse contains the response from method QueueClient.Delete.
+type QueueClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// QueueClientGetResponse contains the response from method QueueClient.Get.
+type QueueClientGetResponse struct {
+ Queue
+}
+
+// QueueClientListResponse contains the response from method QueueClient.NewListPager.
+type QueueClientListResponse struct {
+ // Response schema. Contains list of queues returned
+ ListQueueResource
+}
+
+// QueueClientUpdateResponse contains the response from method QueueClient.Update.
+type QueueClientUpdateResponse struct {
+ Queue
+}
+
+// QueueServicesClientGetServicePropertiesResponse contains the response from method QueueServicesClient.GetServiceProperties.
+type QueueServicesClientGetServicePropertiesResponse struct {
+ // The properties of a storage account’s Queue service.
+ QueueServiceProperties
+}
+
+// QueueServicesClientListResponse contains the response from method QueueServicesClient.List.
+type QueueServicesClientListResponse struct {
+ ListQueueServices
+}
+
+// QueueServicesClientSetServicePropertiesResponse contains the response from method QueueServicesClient.SetServiceProperties.
+type QueueServicesClientSetServicePropertiesResponse struct {
+ // The properties of a storage account’s Queue service.
+ QueueServiceProperties
+}
+
+// SKUsClientListResponse contains the response from method SKUsClient.NewListPager.
+type SKUsClientListResponse struct {
+ // The response from the List Storage SKUs operation.
+ SKUListResult
+}
+
+// TableClientCreateResponse contains the response from method TableClient.Create.
+type TableClientCreateResponse struct {
+ // Properties of the table, including Id, resource name, resource type.
+ Table
+}
+
+// TableClientDeleteResponse contains the response from method TableClient.Delete.
+type TableClientDeleteResponse struct {
+ // placeholder for future response values
+}
+
+// TableClientGetResponse contains the response from method TableClient.Get.
+type TableClientGetResponse struct {
+ // Properties of the table, including Id, resource name, resource type.
+ Table
+}
+
+// TableClientListResponse contains the response from method TableClient.NewListPager.
+type TableClientListResponse struct {
+ // Response schema. Contains list of tables returned
+ ListTableResource
+}
+
+// TableClientUpdateResponse contains the response from method TableClient.Update.
+type TableClientUpdateResponse struct {
+ // Properties of the table, including Id, resource name, resource type.
+ Table
+}
+
+// TableServicesClientGetServicePropertiesResponse contains the response from method TableServicesClient.GetServiceProperties.
+type TableServicesClientGetServicePropertiesResponse struct {
+ // The properties of a storage account’s Table service.
+ TableServiceProperties
+}
+
+// TableServicesClientListResponse contains the response from method TableServicesClient.List.
+type TableServicesClientListResponse struct {
+ ListTableServices
+}
+
+// TableServicesClientSetServicePropertiesResponse contains the response from method TableServicesClient.SetServiceProperties.
+type TableServicesClientSetServicePropertiesResponse struct {
+ // The properties of a storage account’s Table service.
+ TableServiceProperties
+}
+
+// UsagesClientListByLocationResponse contains the response from method UsagesClient.NewListByLocationPager.
+type UsagesClientListByLocationResponse struct {
+ // The response from the List Usages operation.
+ UsageListResult
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/skus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/skus_client.go
new file mode 100644
index 000000000..db7979df3
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/skus_client.go
@@ -0,0 +1,99 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// SKUsClient contains the methods for the SKUs group.
+// Don't use this type directly, use NewSKUsClient() instead.
+type SKUsClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewSKUsClient creates a new instance of SKUsClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SKUsClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &SKUsClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListPager - Lists the available SKUs supported by Microsoft.Storage for given subscription.
+//
+// Generated from API version 2023-01-01
+// - options - SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method.
+func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{
+ More: func(page SKUsClientListResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *SKUsClientListResponse) (SKUsClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SKUsClient.NewListPager")
+ req, err := client.listCreateRequest(ctx, options)
+ if err != nil {
+ return SKUsClientListResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return SKUsClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return SKUsClientListResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *SKUsClient) listHandleResponse(resp *http.Response) (SKUsClientListResponse, error) {
+ result := SKUsClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.SKUListResult); err != nil {
+ return SKUsClientListResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/table_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/table_client.go
new file mode 100644
index 000000000..169dd385e
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/table_client.go
@@ -0,0 +1,395 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// TableClient contains the methods for the Table group.
+// Don't use this type directly, use NewTableClient() instead.
+type TableClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewTableClient creates a new instance of TableClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewTableClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TableClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &TableClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// Create - Creates a new table with the specified table name, under the specified account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - tableName - A table name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of only alphanumeric characters and it cannot begin with a numeric character.
+// - options - TableClientCreateOptions contains the optional parameters for the TableClient.Create method.
+func (client *TableClient) Create(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientCreateOptions) (TableClientCreateResponse, error) {
+ var err error
+ const operationName = "TableClient.Create"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, tableName, options)
+ if err != nil {
+ return TableClientCreateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableClientCreateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableClientCreateResponse{}, err
+ }
+ resp, err := client.createHandleResponse(httpResp)
+ return resp, err
+}
+
+// createCreateRequest creates the Create request.
+func (client *TableClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientCreateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if tableName == "" {
+ return nil, errors.New("parameter tableName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// createHandleResponse handles the Create response.
+func (client *TableClient) createHandleResponse(resp *http.Response) (TableClientCreateResponse, error) {
+ result := TableClientCreateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Table); err != nil {
+ return TableClientCreateResponse{}, err
+ }
+ return result, nil
+}
+
+// Delete - Deletes the table with the specified table name, under the specified account if it exists.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - tableName - A table name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of only alphanumeric characters and it cannot begin with a numeric character.
+// - options - TableClientDeleteOptions contains the optional parameters for the TableClient.Delete method.
+func (client *TableClient) Delete(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientDeleteOptions) (TableClientDeleteResponse, error) {
+ var err error
+ const operationName = "TableClient.Delete"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, tableName, options)
+ if err != nil {
+ return TableClientDeleteResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableClientDeleteResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusNoContent) {
+ err = runtime.NewResponseError(httpResp)
+ return TableClientDeleteResponse{}, err
+ }
+ return TableClientDeleteResponse{}, nil
+}
+
+// deleteCreateRequest creates the Delete request.
+func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientDeleteOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if tableName == "" {
+ return nil, errors.New("parameter tableName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName))
+ req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// Get - Gets the table with the specified table name, under the specified account if it exists.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - tableName - A table name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of only alphanumeric characters and it cannot begin with a numeric character.
+// - options - TableClientGetOptions contains the optional parameters for the TableClient.Get method.
+func (client *TableClient) Get(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientGetOptions) (TableClientGetResponse, error) {
+ var err error
+ const operationName = "TableClient.Get"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, tableName, options)
+ if err != nil {
+ return TableClientGetResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableClientGetResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableClientGetResponse{}, err
+ }
+ resp, err := client.getHandleResponse(httpResp)
+ return resp, err
+}
+
+// getCreateRequest creates the Get request.
+func (client *TableClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientGetOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if tableName == "" {
+ return nil, errors.New("parameter tableName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getHandleResponse handles the Get response.
+func (client *TableClient) getHandleResponse(resp *http.Response) (TableClientGetResponse, error) {
+ result := TableClientGetResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Table); err != nil {
+ return TableClientGetResponse{}, err
+ }
+ return result, nil
+}
+
+// NewListPager - Gets a list of all the tables under the specified storage account
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - TableClientListOptions contains the optional parameters for the TableClient.NewListPager method.
+func (client *TableClient) NewListPager(resourceGroupName string, accountName string, options *TableClientListOptions) *runtime.Pager[TableClientListResponse] {
+ return runtime.NewPager(runtime.PagingHandler[TableClientListResponse]{
+ More: func(page TableClientListResponse) bool {
+ return page.NextLink != nil && len(*page.NextLink) > 0
+ },
+ Fetcher: func(ctx context.Context, page *TableClientListResponse) (TableClientListResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "TableClient.NewListPager")
+ nextLink := ""
+ if page != nil {
+ nextLink = *page.NextLink
+ }
+ resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) {
+ return client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ }, nil)
+ if err != nil {
+ return TableClientListResponse{}, err
+ }
+ return client.listHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listCreateRequest creates the List request.
+func (client *TableClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *TableClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *TableClient) listHandleResponse(resp *http.Response) (TableClientListResponse, error) {
+ result := TableClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListTableResource); err != nil {
+ return TableClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// Update - Creates a new table with the specified table name, under the specified account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - tableName - A table name must be unique within a storage account and must be between 3 and 63 characters.The name must
+// comprise of only alphanumeric characters and it cannot begin with a numeric character.
+// - options - TableClientUpdateOptions contains the optional parameters for the TableClient.Update method.
+func (client *TableClient) Update(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientUpdateOptions) (TableClientUpdateResponse, error) {
+ var err error
+ const operationName = "TableClient.Update"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, tableName, options)
+ if err != nil {
+ return TableClientUpdateResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableClientUpdateResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableClientUpdateResponse{}, err
+ }
+ resp, err := client.updateHandleResponse(httpResp)
+ return resp, err
+}
+
+// updateCreateRequest creates the Update request.
+func (client *TableClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientUpdateOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if tableName == "" {
+ return nil, errors.New("parameter tableName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName))
+ req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if options != nil && options.Parameters != nil {
+ if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+ }
+ return req, nil
+}
+
+// updateHandleResponse handles the Update response.
+func (client *TableClient) updateHandleResponse(resp *http.Response) (TableClientUpdateResponse, error) {
+ result := TableClientUpdateResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.Table); err != nil {
+ return TableClientUpdateResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/tableservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/tableservices_client.go
new file mode 100644
index 000000000..f53f5f982
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/tableservices_client.go
@@ -0,0 +1,250 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// TableServicesClient contains the methods for the TableServices group.
+// Don't use this type directly, use NewTableServicesClient() instead.
+type TableServicesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewTableServicesClient creates a new instance of TableServicesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewTableServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TableServicesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &TableServicesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// GetServiceProperties - Gets the properties of a storage account’s Table service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - TableServicesClientGetServicePropertiesOptions contains the optional parameters for the TableServicesClient.GetServiceProperties
+// method.
+func (client *TableServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, options *TableServicesClientGetServicePropertiesOptions) (TableServicesClientGetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "TableServicesClient.GetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.getServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return TableServicesClientGetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableServicesClientGetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableServicesClientGetServicePropertiesResponse{}, err
+ }
+ resp, err := client.getServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// getServicePropertiesCreateRequest creates the GetServiceProperties request.
+func (client *TableServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *TableServicesClientGetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{tableServiceName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// getServicePropertiesHandleResponse handles the GetServiceProperties response.
+func (client *TableServicesClient) getServicePropertiesHandleResponse(resp *http.Response) (TableServicesClientGetServicePropertiesResponse, error) {
+ result := TableServicesClientGetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TableServiceProperties); err != nil {
+ return TableServicesClientGetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
+
+// List - List all table services for the storage account.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - options - TableServicesClientListOptions contains the optional parameters for the TableServicesClient.List method.
+func (client *TableServicesClient) List(ctx context.Context, resourceGroupName string, accountName string, options *TableServicesClientListOptions) (TableServicesClientListResponse, error) {
+ var err error
+ const operationName = "TableServicesClient.List"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options)
+ if err != nil {
+ return TableServicesClientListResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableServicesClientListResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableServicesClientListResponse{}, err
+ }
+ resp, err := client.listHandleResponse(httpResp)
+ return resp, err
+}
+
+// listCreateRequest creates the List request.
+func (client *TableServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *TableServicesClientListOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listHandleResponse handles the List response.
+func (client *TableServicesClient) listHandleResponse(resp *http.Response) (TableServicesClientListResponse, error) {
+ result := TableServicesClientListResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.ListTableServices); err != nil {
+ return TableServicesClientListResponse{}, err
+ }
+ return result, nil
+}
+
+// SetServiceProperties - Sets the properties of a storage account’s Table service, including properties for Storage Analytics
+// and CORS (Cross-Origin Resource Sharing) rules.
+// If the operation fails it returns an *azcore.ResponseError type.
+//
+// Generated from API version 2023-01-01
+// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive.
+// - accountName - The name of the storage account within the specified resource group. Storage account names must be between
+// 3 and 24 characters in length and use numbers and lower-case letters only.
+// - parameters - The properties of a storage account’s Table service, only properties for Storage Analytics and CORS (Cross-Origin
+// Resource Sharing) rules can be specified.
+// - options - TableServicesClientSetServicePropertiesOptions contains the optional parameters for the TableServicesClient.SetServiceProperties
+// method.
+func (client *TableServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters TableServiceProperties, options *TableServicesClientSetServicePropertiesOptions) (TableServicesClientSetServicePropertiesResponse, error) {
+ var err error
+ const operationName = "TableServicesClient.SetServiceProperties"
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName)
+ ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil)
+ defer func() { endSpan(err) }()
+ req, err := client.setServicePropertiesCreateRequest(ctx, resourceGroupName, accountName, parameters, options)
+ if err != nil {
+ return TableServicesClientSetServicePropertiesResponse{}, err
+ }
+ httpResp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return TableServicesClientSetServicePropertiesResponse{}, err
+ }
+ if !runtime.HasStatusCode(httpResp, http.StatusOK) {
+ err = runtime.NewResponseError(httpResp)
+ return TableServicesClientSetServicePropertiesResponse{}, err
+ }
+ resp, err := client.setServicePropertiesHandleResponse(httpResp)
+ return resp, err
+}
+
+// setServicePropertiesCreateRequest creates the SetServiceProperties request.
+func (client *TableServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters TableServiceProperties, options *TableServicesClientSetServicePropertiesOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}"
+ if resourceGroupName == "" {
+ return nil, errors.New("parameter resourceGroupName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
+ if accountName == "" {
+ return nil, errors.New("parameter accountName cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName))
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ urlPath = strings.ReplaceAll(urlPath, "{tableServiceName}", url.PathEscape("default"))
+ req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ if err := runtime.MarshalAsJSON(req, parameters); err != nil {
+ return nil, err
+ }
+ return req, nil
+}
+
+// setServicePropertiesHandleResponse handles the SetServiceProperties response.
+func (client *TableServicesClient) setServicePropertiesHandleResponse(resp *http.Response) (TableServicesClientSetServicePropertiesResponse, error) {
+ result := TableServicesClientSetServicePropertiesResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.TableServiceProperties); err != nil {
+ return TableServicesClientSetServicePropertiesResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/time_rfc3339.go
new file mode 100644
index 000000000..201ffd255
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/time_rfc3339.go
@@ -0,0 +1,86 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "reflect"
+ "regexp"
+ "strings"
+ "time"
+)
+
+// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases.
+var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`)
+
+const (
+ utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"`
+ utcDateTime = "2006-01-02T15:04:05.999999999"
+ dateTimeJSON = `"` + time.RFC3339Nano + `"`
+)
+
+type dateTimeRFC3339 time.Time
+
+func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalJSON()
+}
+
+func (t dateTimeRFC3339) MarshalText() ([]byte, error) {
+ tt := time.Time(t)
+ return tt.MarshalText()
+}
+
+func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error {
+ layout := utcDateTimeJSON
+ if tzOffsetRegex.Match(data) {
+ layout = dateTimeJSON
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) UnmarshalText(data []byte) error {
+ layout := utcDateTime
+ if tzOffsetRegex.Match(data) {
+ layout = time.RFC3339Nano
+ }
+ return t.Parse(layout, string(data))
+}
+
+func (t *dateTimeRFC3339) Parse(layout, value string) error {
+ p, err := time.Parse(layout, strings.ToUpper(value))
+ *t = dateTimeRFC3339(p)
+ return err
+}
+
+func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) {
+ if t == nil {
+ return
+ } else if azcore.IsNullValue(t) {
+ m[k] = nil
+ return
+ } else if reflect.ValueOf(t).IsNil() {
+ return
+ }
+ m[k] = (*dateTimeRFC3339)(t)
+}
+
+func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error {
+ if data == nil || strings.EqualFold(string(data), "null") {
+ return nil
+ }
+ var aux dateTimeRFC3339
+ if err := json.Unmarshal(data, &aux); err != nil {
+ return fmt.Errorf("struct field %s: %v", fn, err)
+ }
+ *t = (*time.Time)(&aux)
+ return nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/usages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/usages_client.go
new file mode 100644
index 000000000..2f4a974fa
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/usages_client.go
@@ -0,0 +1,105 @@
+//go:build go1.18
+// +build go1.18
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+package armstorage
+
+import (
+ "context"
+ "errors"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
+ "net/http"
+ "net/url"
+ "strings"
+)
+
+// UsagesClient contains the methods for the Usages group.
+// Don't use this type directly, use NewUsagesClient() instead.
+type UsagesClient struct {
+ internal *arm.Client
+ subscriptionID string
+}
+
+// NewUsagesClient creates a new instance of UsagesClient with the specified values.
+// - subscriptionID - The ID of the target subscription.
+// - credential - used to authorize requests. Usually a credential from azidentity.
+// - options - pass nil to accept the default values.
+func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) {
+ cl, err := arm.NewClient(moduleName, moduleVersion, credential, options)
+ if err != nil {
+ return nil, err
+ }
+ client := &UsagesClient{
+ subscriptionID: subscriptionID,
+ internal: cl,
+ }
+ return client, nil
+}
+
+// NewListByLocationPager - Gets the current usage count and the limit for the resources of the location under the subscription.
+//
+// Generated from API version 2023-01-01
+// - location - The location of the Azure Storage resource.
+// - options - UsagesClientListByLocationOptions contains the optional parameters for the UsagesClient.NewListByLocationPager
+// method.
+func (client *UsagesClient) NewListByLocationPager(location string, options *UsagesClientListByLocationOptions) *runtime.Pager[UsagesClientListByLocationResponse] {
+ return runtime.NewPager(runtime.PagingHandler[UsagesClientListByLocationResponse]{
+ More: func(page UsagesClientListByLocationResponse) bool {
+ return false
+ },
+ Fetcher: func(ctx context.Context, page *UsagesClientListByLocationResponse) (UsagesClientListByLocationResponse, error) {
+ ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "UsagesClient.NewListByLocationPager")
+ req, err := client.listByLocationCreateRequest(ctx, location, options)
+ if err != nil {
+ return UsagesClientListByLocationResponse{}, err
+ }
+ resp, err := client.internal.Pipeline().Do(req)
+ if err != nil {
+ return UsagesClientListByLocationResponse{}, err
+ }
+ if !runtime.HasStatusCode(resp, http.StatusOK) {
+ return UsagesClientListByLocationResponse{}, runtime.NewResponseError(resp)
+ }
+ return client.listByLocationHandleResponse(resp)
+ },
+ Tracer: client.internal.Tracer(),
+ })
+}
+
+// listByLocationCreateRequest creates the ListByLocation request.
+func (client *UsagesClient) listByLocationCreateRequest(ctx context.Context, location string, options *UsagesClientListByLocationOptions) (*policy.Request, error) {
+ urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages"
+ if client.subscriptionID == "" {
+ return nil, errors.New("parameter client.subscriptionID cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
+ if location == "" {
+ return nil, errors.New("parameter location cannot be empty")
+ }
+ urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath))
+ if err != nil {
+ return nil, err
+ }
+ reqQP := req.Raw().URL.Query()
+ reqQP.Set("api-version", "2023-01-01")
+ req.Raw().URL.RawQuery = reqQP.Encode()
+ req.Raw().Header["Accept"] = []string{"application/json"}
+ return req, nil
+}
+
+// listByLocationHandleResponse handles the ListByLocation response.
+func (client *UsagesClient) listByLocationHandleResponse(resp *http.Response) (UsagesClientListByLocationResponse, error) {
+ result := UsagesClientListByLocationResponse{}
+ if err := runtime.UnmarshalAsJSON(resp, &result.UsageListResult); err != nil {
+ return UsagesClientListByLocationResponse{}, err
+ }
+ return result, nil
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/CHANGELOG.md
deleted file mode 100644
index 52911e4cc..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/CHANGELOG.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# Change History
-
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/_meta.json
deleted file mode 100644
index fd8e05023..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/_meta.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
- "readme": "/_/azure-rest-api-specs/specification/compute/resource-manager/readme.md",
- "tag": "package-compute-2017-12",
- "use": "@microsoft.azure/autorest.go@2.1.187",
- "repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
- "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-compute-2017-12 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/compute/resource-manager/readme.md",
- "additional_properties": {
- "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION"
- }
-}
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/availabilitysets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/availabilitysets.go
deleted file mode 100644
index 4bbf244d3..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/availabilitysets.go
+++ /dev/null
@@ -1,653 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// AvailabilitySetsClient is the compute Client
-type AvailabilitySetsClient struct {
- BaseClient
-}
-
-// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient client.
-func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient {
- return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewAvailabilitySetsClientWithBaseURI creates an instance of the AvailabilitySetsClient client using a custom
-// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
-// stack).
-func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient {
- return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdate create or update an availability set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// availabilitySetName - the name of the availability set.
-// parameters - parameters supplied to the Create Availability Set operation.
-func (client AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreateOrUpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreateOrUpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "availabilitySetName": autorest.Encode("path", availabilitySetName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete delete an availability set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// availabilitySetName - the name of the availability set.
-func (client AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string) (result OperationStatusResponse, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Delete")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeletePreparer(ctx, resourceGroupName, availabilitySetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "availabilitySetName": autorest.Encode("path", availabilitySetName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get retrieves information about an availability set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// availabilitySetName - the name of the availability set.
-func (client AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, resourceGroupName, availabilitySetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "availabilitySetName": autorest.Encode("path", availabilitySetName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client AvailabilitySetsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all availability sets in a resource group.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List")
- defer func() {
- sc := -1
- if result.aslr.Response.Response != nil {
- sc = result.aslr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, resourceGroupName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.aslr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure sending request")
- return
- }
-
- result.aslr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request")
- return
- }
- if result.aslr.hasNextLink() && result.aslr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client AvailabilitySetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client AvailabilitySetsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client AvailabilitySetsClient) listNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) {
- req, err := lastResults.availabilitySetListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AvailabilitySetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx, resourceGroupName)
- return
-}
-
-// ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an
-// existing availability set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// availabilitySetName - the name of the availability set.
-func (client AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListAvailableSizes")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, availabilitySetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListAvailableSizesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListAvailableSizesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListAvailableSizesPreparer prepares the ListAvailableSizes request.
-func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "availabilitySetName": autorest.Encode("path", availabilitySetName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the
-// http.Response Body if it receives an error.
-func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always
-// closes the http.Response Body.
-func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListBySubscription lists all availability sets in a subscription.
-// Parameters:
-// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'.
-func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
- defer func() {
- sc := -1
- if result.aslr.Response.Response != nil {
- sc = result.aslr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listBySubscriptionNextResults
- req, err := client.ListBySubscriptionPreparer(ctx, expand)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListBySubscriptionSender(req)
- if err != nil {
- result.aslr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure sending request")
- return
- }
-
- result.aslr, err = client.ListBySubscriptionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request")
- return
- }
- if result.aslr.hasNextLink() && result.aslr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListBySubscriptionPreparer prepares the ListBySubscription request.
-func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
-// http.Response Body if it receives an error.
-func (client AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
-// closes the http.Response Body.
-func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listBySubscriptionNextResults retrieves the next set of results, if any.
-func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) {
- req, err := lastResults.availabilitySetListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListBySubscriptionSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListBySubscriptionResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
-func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListBySubscription(ctx, expand)
- return
-}
-
-// Update update an availability set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// availabilitySetName - the name of the availability set.
-// parameters - parameters supplied to the Update Availability Set operation.
-func (client AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (result AvailabilitySet, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Update")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.UpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client AvailabilitySetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "availabilitySetName": autorest.Encode("path", availabilitySetName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client AvailabilitySetsClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/client.go
deleted file mode 100644
index c7c454315..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/client.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details.
-//
-// Package compute implements the Azure ARM Compute service API version .
-//
-// Compute Client
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "github.com/Azure/go-autorest/autorest"
-)
-
-const (
- // DefaultBaseURI is the default URI used for the service Compute
- DefaultBaseURI = "https://management.azure.com"
-)
-
-// BaseClient is the base client for Compute.
-type BaseClient struct {
- autorest.Client
- BaseURI string
- SubscriptionID string
-}
-
-// New creates an instance of the BaseClient client.
-func New(subscriptionID string) BaseClient {
- return NewWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with
-// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return BaseClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- SubscriptionID: subscriptionID,
- }
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/disks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/disks.go
deleted file mode 100644
index f91d2c759..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/disks.go
+++ /dev/null
@@ -1,781 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// DisksClient is the compute Client
-type DisksClient struct {
- BaseClient
-}
-
-// NewDisksClient creates an instance of the DisksClient client.
-func NewDisksClient(subscriptionID string) DisksClient {
- return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewDisksClientWithBaseURI creates an instance of the DisksClient client using a custom endpoint. Use this when
-// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient {
- return DisksClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdate creates or updates a disk.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
-// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
-// characters.
-// disk - disk object supplied in the body of the Put disk operation.
-func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (result DisksCreateOrUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: disk,
- Constraints: []validation.Constraint{{Target: "disk.DiskProperties", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "disk.DiskProperties.EncryptionSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("compute.DisksClient", "CreateOrUpdate", err.Error())
- }
-
- req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskName, disk)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateOrUpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "diskName": autorest.Encode("path", diskName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- disk.ManagedBy = nil
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
- autorest.WithJSON(disk),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksCreateOrUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes a disk.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
-// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
-// characters.
-func (client DisksClient) Delete(ctx context.Context, resourceGroupName string, diskName string) (result DisksDeleteFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Delete")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeletePreparer(ctx, resourceGroupName, diskName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "diskName": autorest.Encode("path", diskName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client DisksClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get gets information about a disk.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
-// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
-// characters.
-func (client DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string) (result Disk, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, resourceGroupName, diskName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "diskName": autorest.Encode("path", diskName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GrantAccess grants access to a disk.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
-// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
-// characters.
-// grantAccessData - access data object supplied in the body of the get disk access operation.
-func (client DisksClient) GrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (result DisksGrantAccessFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.GrantAccess")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: grantAccessData,
- Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.DisksClient", "GrantAccess", err.Error())
- }
-
- req, err := client.GrantAccessPreparer(ctx, resourceGroupName, diskName, grantAccessData)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", nil, "Failure preparing request")
- return
- }
-
- result, err = client.GrantAccessSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// GrantAccessPreparer prepares the GrantAccess request.
-func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "diskName": autorest.Encode("path", diskName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", pathParameters),
- autorest.WithJSON(grantAccessData),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GrantAccessSender sends the GrantAccess request. The method will close the
-// http.Response Body if it receives an error.
-func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGrantAccessFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// GrantAccessResponder handles the response to the GrantAccess request. The method always
-// closes the http.Response Body.
-func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all the disks under a subscription.
-func (client DisksClient) List(ctx context.Context) (result DiskListPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List")
- defer func() {
- sc := -1
- if result.dl.Response.Response != nil {
- sc = result.dl.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.dl.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure sending request")
- return
- }
-
- result.dl, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request")
- return
- }
- if result.dl.hasNextLink() && result.dl.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client DisksClient) listNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) {
- req, err := lastResults.diskListPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client DisksClient) ListComplete(ctx context.Context) (result DiskListIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx)
- return
-}
-
-// ListByResourceGroup lists all the disks under a resource group.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup")
- defer func() {
- sc := -1
- if result.dl.Response.Response != nil {
- sc = result.dl.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listByResourceGroupNextResults
- req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.dl.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure sending request")
- return
- }
-
- result.dl, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request")
- return
- }
- if result.dl.hasNextLink() && result.dl.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
-func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
-// http.Response Body if it receives an error.
-func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
-// closes the http.Response Body.
-func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listByResourceGroupNextResults retrieves the next set of results, if any.
-func (client DisksClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) {
- req, err := lastResults.diskListPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
-func (client DisksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskListIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
- return
-}
-
-// RevokeAccess revokes access to a disk.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
-// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
-// characters.
-func (client DisksClient) RevokeAccess(ctx context.Context, resourceGroupName string, diskName string) (result DisksRevokeAccessFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.RevokeAccess")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, diskName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", nil, "Failure preparing request")
- return
- }
-
- result, err = client.RevokeAccessSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// RevokeAccessPreparer prepares the RevokeAccess request.
-func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "diskName": autorest.Encode("path", diskName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RevokeAccessSender sends the RevokeAccess request. The method will close the
-// http.Response Body if it receives an error.
-func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRevokeAccessFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// RevokeAccessResponder handles the response to the RevokeAccess request. The method always
-// closes the http.Response Body.
-func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Update updates (patches) a disk.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
-// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
-// characters.
-// disk - disk object supplied in the body of the Patch disk operation.
-func (client DisksClient) Update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (result DisksUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Update")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.UpdatePreparer(ctx, resourceGroupName, diskName, disk)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", nil, "Failure preparing request")
- return
- }
-
- result, err = client.UpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "diskName": autorest.Encode("path", diskName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
- autorest.WithJSON(disk),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/enums.go
deleted file mode 100644
index d1bfa9d0b..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/enums.go
+++ /dev/null
@@ -1,802 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-// AccessLevel enumerates the values for access level.
-type AccessLevel string
-
-const (
- // None ...
- None AccessLevel = "None"
- // Read ...
- Read AccessLevel = "Read"
-)
-
-// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type.
-func PossibleAccessLevelValues() []AccessLevel {
- return []AccessLevel{None, Read}
-}
-
-// CachingTypes enumerates the values for caching types.
-type CachingTypes string
-
-const (
- // CachingTypesNone ...
- CachingTypesNone CachingTypes = "None"
- // CachingTypesReadOnly ...
- CachingTypesReadOnly CachingTypes = "ReadOnly"
- // CachingTypesReadWrite ...
- CachingTypesReadWrite CachingTypes = "ReadWrite"
-)
-
-// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type.
-func PossibleCachingTypesValues() []CachingTypes {
- return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite}
-}
-
-// ComponentNames enumerates the values for component names.
-type ComponentNames string
-
-const (
- // MicrosoftWindowsShellSetup ...
- MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup"
-)
-
-// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type.
-func PossibleComponentNamesValues() []ComponentNames {
- return []ComponentNames{MicrosoftWindowsShellSetup}
-}
-
-// DiskCreateOption enumerates the values for disk create option.
-type DiskCreateOption string
-
-const (
- // Attach ...
- Attach DiskCreateOption = "Attach"
- // Copy ...
- Copy DiskCreateOption = "Copy"
- // Empty ...
- Empty DiskCreateOption = "Empty"
- // FromImage ...
- FromImage DiskCreateOption = "FromImage"
- // Import ...
- Import DiskCreateOption = "Import"
-)
-
-// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type.
-func PossibleDiskCreateOptionValues() []DiskCreateOption {
- return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import}
-}
-
-// DiskCreateOptionTypes enumerates the values for disk create option types.
-type DiskCreateOptionTypes string
-
-const (
- // DiskCreateOptionTypesAttach ...
- DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach"
- // DiskCreateOptionTypesEmpty ...
- DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty"
- // DiskCreateOptionTypesFromImage ...
- DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage"
-)
-
-// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type.
-func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes {
- return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage}
-}
-
-// InstanceViewTypes enumerates the values for instance view types.
-type InstanceViewTypes string
-
-const (
- // InstanceView ...
- InstanceView InstanceViewTypes = "instanceView"
-)
-
-// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type.
-func PossibleInstanceViewTypesValues() []InstanceViewTypes {
- return []InstanceViewTypes{InstanceView}
-}
-
-// IntervalInMins enumerates the values for interval in mins.
-type IntervalInMins string
-
-const (
- // FiveMins ...
- FiveMins IntervalInMins = "FiveMins"
- // SixtyMins ...
- SixtyMins IntervalInMins = "SixtyMins"
- // ThirtyMins ...
- ThirtyMins IntervalInMins = "ThirtyMins"
- // ThreeMins ...
- ThreeMins IntervalInMins = "ThreeMins"
-)
-
-// PossibleIntervalInMinsValues returns an array of possible values for the IntervalInMins const type.
-func PossibleIntervalInMinsValues() []IntervalInMins {
- return []IntervalInMins{FiveMins, SixtyMins, ThirtyMins, ThreeMins}
-}
-
-// IPVersion enumerates the values for ip version.
-type IPVersion string
-
-const (
- // IPv4 ...
- IPv4 IPVersion = "IPv4"
- // IPv6 ...
- IPv6 IPVersion = "IPv6"
-)
-
-// PossibleIPVersionValues returns an array of possible values for the IPVersion const type.
-func PossibleIPVersionValues() []IPVersion {
- return []IPVersion{IPv4, IPv6}
-}
-
-// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types.
-type MaintenanceOperationResultCodeTypes string
-
-const (
- // MaintenanceOperationResultCodeTypesMaintenanceAborted ...
- MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted"
- // MaintenanceOperationResultCodeTypesMaintenanceCompleted ...
- MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted"
- // MaintenanceOperationResultCodeTypesNone ...
- MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None"
- // MaintenanceOperationResultCodeTypesRetryLater ...
- MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater"
-)
-
-// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type.
-func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes {
- return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater}
-}
-
-// OperatingSystemStateTypes enumerates the values for operating system state types.
-type OperatingSystemStateTypes string
-
-const (
- // Generalized ...
- Generalized OperatingSystemStateTypes = "Generalized"
- // Specialized ...
- Specialized OperatingSystemStateTypes = "Specialized"
-)
-
-// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type.
-func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes {
- return []OperatingSystemStateTypes{Generalized, Specialized}
-}
-
-// OperatingSystemTypes enumerates the values for operating system types.
-type OperatingSystemTypes string
-
-const (
- // Linux ...
- Linux OperatingSystemTypes = "Linux"
- // Windows ...
- Windows OperatingSystemTypes = "Windows"
-)
-
-// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type.
-func PossibleOperatingSystemTypesValues() []OperatingSystemTypes {
- return []OperatingSystemTypes{Linux, Windows}
-}
-
-// PassNames enumerates the values for pass names.
-type PassNames string
-
-const (
- // OobeSystem ...
- OobeSystem PassNames = "OobeSystem"
-)
-
-// PossiblePassNamesValues returns an array of possible values for the PassNames const type.
-func PossiblePassNamesValues() []PassNames {
- return []PassNames{OobeSystem}
-}
-
-// ProtocolTypes enumerates the values for protocol types.
-type ProtocolTypes string
-
-const (
- // HTTP ...
- HTTP ProtocolTypes = "Http"
- // HTTPS ...
- HTTPS ProtocolTypes = "Https"
-)
-
-// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type.
-func PossibleProtocolTypesValues() []ProtocolTypes {
- return []ProtocolTypes{HTTP, HTTPS}
-}
-
-// ResourceIdentityType enumerates the values for resource identity type.
-type ResourceIdentityType string
-
-const (
- // ResourceIdentityTypeNone ...
- ResourceIdentityTypeNone ResourceIdentityType = "None"
- // ResourceIdentityTypeSystemAssigned ...
- ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned"
- // ResourceIdentityTypeSystemAssignedUserAssigned ...
- ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned"
- // ResourceIdentityTypeUserAssigned ...
- ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned"
-)
-
-// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type.
-func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
- return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned}
-}
-
-// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type.
-type ResourceSkuCapacityScaleType string
-
-const (
- // ResourceSkuCapacityScaleTypeAutomatic ...
- ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic"
- // ResourceSkuCapacityScaleTypeManual ...
- ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual"
- // ResourceSkuCapacityScaleTypeNone ...
- ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None"
-)
-
-// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type.
-func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType {
- return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone}
-}
-
-// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code.
-type ResourceSkuRestrictionsReasonCode string
-
-const (
- // NotAvailableForSubscription ...
- NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription"
- // QuotaID ...
- QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId"
-)
-
-// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type.
-func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode {
- return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID}
-}
-
-// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type.
-type ResourceSkuRestrictionsType string
-
-const (
- // Location ...
- Location ResourceSkuRestrictionsType = "Location"
- // Zone ...
- Zone ResourceSkuRestrictionsType = "Zone"
-)
-
-// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type.
-func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType {
- return []ResourceSkuRestrictionsType{Location, Zone}
-}
-
-// RollingUpgradeActionType enumerates the values for rolling upgrade action type.
-type RollingUpgradeActionType string
-
-const (
- // Cancel ...
- Cancel RollingUpgradeActionType = "Cancel"
- // Start ...
- Start RollingUpgradeActionType = "Start"
-)
-
-// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type.
-func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType {
- return []RollingUpgradeActionType{Cancel, Start}
-}
-
-// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code.
-type RollingUpgradeStatusCode string
-
-const (
- // Cancelled ...
- Cancelled RollingUpgradeStatusCode = "Cancelled"
- // Completed ...
- Completed RollingUpgradeStatusCode = "Completed"
- // Faulted ...
- Faulted RollingUpgradeStatusCode = "Faulted"
- // RollingForward ...
- RollingForward RollingUpgradeStatusCode = "RollingForward"
-)
-
-// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type.
-func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode {
- return []RollingUpgradeStatusCode{Cancelled, Completed, Faulted, RollingForward}
-}
-
-// SettingNames enumerates the values for setting names.
-type SettingNames string
-
-const (
- // AutoLogon ...
- AutoLogon SettingNames = "AutoLogon"
- // FirstLogonCommands ...
- FirstLogonCommands SettingNames = "FirstLogonCommands"
-)
-
-// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type.
-func PossibleSettingNamesValues() []SettingNames {
- return []SettingNames{AutoLogon, FirstLogonCommands}
-}
-
-// StatusLevelTypes enumerates the values for status level types.
-type StatusLevelTypes string
-
-const (
- // Error ...
- Error StatusLevelTypes = "Error"
- // Info ...
- Info StatusLevelTypes = "Info"
- // Warning ...
- Warning StatusLevelTypes = "Warning"
-)
-
-// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type.
-func PossibleStatusLevelTypesValues() []StatusLevelTypes {
- return []StatusLevelTypes{Error, Info, Warning}
-}
-
-// StorageAccountTypes enumerates the values for storage account types.
-type StorageAccountTypes string
-
-const (
- // PremiumLRS ...
- PremiumLRS StorageAccountTypes = "Premium_LRS"
- // StandardLRS ...
- StandardLRS StorageAccountTypes = "Standard_LRS"
-)
-
-// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type.
-func PossibleStorageAccountTypesValues() []StorageAccountTypes {
- return []StorageAccountTypes{PremiumLRS, StandardLRS}
-}
-
-// UpgradeMode enumerates the values for upgrade mode.
-type UpgradeMode string
-
-const (
- // Automatic ...
- Automatic UpgradeMode = "Automatic"
- // Manual ...
- Manual UpgradeMode = "Manual"
- // Rolling ...
- Rolling UpgradeMode = "Rolling"
-)
-
-// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type.
-func PossibleUpgradeModeValues() []UpgradeMode {
- return []UpgradeMode{Automatic, Manual, Rolling}
-}
-
-// UpgradeOperationInvoker enumerates the values for upgrade operation invoker.
-type UpgradeOperationInvoker string
-
-const (
- // Platform ...
- Platform UpgradeOperationInvoker = "Platform"
- // Unknown ...
- Unknown UpgradeOperationInvoker = "Unknown"
- // User ...
- User UpgradeOperationInvoker = "User"
-)
-
-// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type.
-func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker {
- return []UpgradeOperationInvoker{Platform, Unknown, User}
-}
-
-// UpgradeState enumerates the values for upgrade state.
-type UpgradeState string
-
-const (
- // UpgradeStateCancelled ...
- UpgradeStateCancelled UpgradeState = "Cancelled"
- // UpgradeStateCompleted ...
- UpgradeStateCompleted UpgradeState = "Completed"
- // UpgradeStateFaulted ...
- UpgradeStateFaulted UpgradeState = "Faulted"
- // UpgradeStateRollingForward ...
- UpgradeStateRollingForward UpgradeState = "RollingForward"
-)
-
-// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type.
-func PossibleUpgradeStateValues() []UpgradeState {
- return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward}
-}
-
-// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types.
-type VirtualMachineEvictionPolicyTypes string
-
-const (
- // Deallocate ...
- Deallocate VirtualMachineEvictionPolicyTypes = "Deallocate"
- // Delete ...
- Delete VirtualMachineEvictionPolicyTypes = "Delete"
-)
-
-// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type.
-func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes {
- return []VirtualMachineEvictionPolicyTypes{Deallocate, Delete}
-}
-
-// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types.
-type VirtualMachinePriorityTypes string
-
-const (
- // Low ...
- Low VirtualMachinePriorityTypes = "Low"
- // Regular ...
- Regular VirtualMachinePriorityTypes = "Regular"
-)
-
-// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type.
-func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes {
- return []VirtualMachinePriorityTypes{Low, Regular}
-}
-
-// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type.
-type VirtualMachineScaleSetSkuScaleType string
-
-const (
- // VirtualMachineScaleSetSkuScaleTypeAutomatic ...
- VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic"
- // VirtualMachineScaleSetSkuScaleTypeNone ...
- VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None"
-)
-
-// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type.
-func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType {
- return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone}
-}
-
-// VirtualMachineSizeTypes enumerates the values for virtual machine size types.
-type VirtualMachineSizeTypes string
-
-const (
- // BasicA0 ...
- BasicA0 VirtualMachineSizeTypes = "Basic_A0"
- // BasicA1 ...
- BasicA1 VirtualMachineSizeTypes = "Basic_A1"
- // BasicA2 ...
- BasicA2 VirtualMachineSizeTypes = "Basic_A2"
- // BasicA3 ...
- BasicA3 VirtualMachineSizeTypes = "Basic_A3"
- // BasicA4 ...
- BasicA4 VirtualMachineSizeTypes = "Basic_A4"
- // StandardA0 ...
- StandardA0 VirtualMachineSizeTypes = "Standard_A0"
- // StandardA1 ...
- StandardA1 VirtualMachineSizeTypes = "Standard_A1"
- // StandardA10 ...
- StandardA10 VirtualMachineSizeTypes = "Standard_A10"
- // StandardA11 ...
- StandardA11 VirtualMachineSizeTypes = "Standard_A11"
- // StandardA1V2 ...
- StandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2"
- // StandardA2 ...
- StandardA2 VirtualMachineSizeTypes = "Standard_A2"
- // StandardA2mV2 ...
- StandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2"
- // StandardA2V2 ...
- StandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2"
- // StandardA3 ...
- StandardA3 VirtualMachineSizeTypes = "Standard_A3"
- // StandardA4 ...
- StandardA4 VirtualMachineSizeTypes = "Standard_A4"
- // StandardA4mV2 ...
- StandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2"
- // StandardA4V2 ...
- StandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2"
- // StandardA5 ...
- StandardA5 VirtualMachineSizeTypes = "Standard_A5"
- // StandardA6 ...
- StandardA6 VirtualMachineSizeTypes = "Standard_A6"
- // StandardA7 ...
- StandardA7 VirtualMachineSizeTypes = "Standard_A7"
- // StandardA8 ...
- StandardA8 VirtualMachineSizeTypes = "Standard_A8"
- // StandardA8mV2 ...
- StandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2"
- // StandardA8V2 ...
- StandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2"
- // StandardA9 ...
- StandardA9 VirtualMachineSizeTypes = "Standard_A9"
- // StandardB1ms ...
- StandardB1ms VirtualMachineSizeTypes = "Standard_B1ms"
- // StandardB1s ...
- StandardB1s VirtualMachineSizeTypes = "Standard_B1s"
- // StandardB2ms ...
- StandardB2ms VirtualMachineSizeTypes = "Standard_B2ms"
- // StandardB2s ...
- StandardB2s VirtualMachineSizeTypes = "Standard_B2s"
- // StandardB4ms ...
- StandardB4ms VirtualMachineSizeTypes = "Standard_B4ms"
- // StandardB8ms ...
- StandardB8ms VirtualMachineSizeTypes = "Standard_B8ms"
- // StandardD1 ...
- StandardD1 VirtualMachineSizeTypes = "Standard_D1"
- // StandardD11 ...
- StandardD11 VirtualMachineSizeTypes = "Standard_D11"
- // StandardD11V2 ...
- StandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2"
- // StandardD12 ...
- StandardD12 VirtualMachineSizeTypes = "Standard_D12"
- // StandardD12V2 ...
- StandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2"
- // StandardD13 ...
- StandardD13 VirtualMachineSizeTypes = "Standard_D13"
- // StandardD13V2 ...
- StandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2"
- // StandardD14 ...
- StandardD14 VirtualMachineSizeTypes = "Standard_D14"
- // StandardD14V2 ...
- StandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2"
- // StandardD15V2 ...
- StandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2"
- // StandardD16sV3 ...
- StandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3"
- // StandardD16V3 ...
- StandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3"
- // StandardD1V2 ...
- StandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2"
- // StandardD2 ...
- StandardD2 VirtualMachineSizeTypes = "Standard_D2"
- // StandardD2sV3 ...
- StandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3"
- // StandardD2V2 ...
- StandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2"
- // StandardD2V3 ...
- StandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3"
- // StandardD3 ...
- StandardD3 VirtualMachineSizeTypes = "Standard_D3"
- // StandardD32sV3 ...
- StandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3"
- // StandardD32V3 ...
- StandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3"
- // StandardD3V2 ...
- StandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2"
- // StandardD4 ...
- StandardD4 VirtualMachineSizeTypes = "Standard_D4"
- // StandardD4sV3 ...
- StandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3"
- // StandardD4V2 ...
- StandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2"
- // StandardD4V3 ...
- StandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3"
- // StandardD5V2 ...
- StandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2"
- // StandardD64sV3 ...
- StandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3"
- // StandardD64V3 ...
- StandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3"
- // StandardD8sV3 ...
- StandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3"
- // StandardD8V3 ...
- StandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3"
- // StandardDS1 ...
- StandardDS1 VirtualMachineSizeTypes = "Standard_DS1"
- // StandardDS11 ...
- StandardDS11 VirtualMachineSizeTypes = "Standard_DS11"
- // StandardDS11V2 ...
- StandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2"
- // StandardDS12 ...
- StandardDS12 VirtualMachineSizeTypes = "Standard_DS12"
- // StandardDS12V2 ...
- StandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2"
- // StandardDS13 ...
- StandardDS13 VirtualMachineSizeTypes = "Standard_DS13"
- // StandardDS132V2 ...
- StandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2"
- // StandardDS134V2 ...
- StandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2"
- // StandardDS13V2 ...
- StandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2"
- // StandardDS14 ...
- StandardDS14 VirtualMachineSizeTypes = "Standard_DS14"
- // StandardDS144V2 ...
- StandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2"
- // StandardDS148V2 ...
- StandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2"
- // StandardDS14V2 ...
- StandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2"
- // StandardDS15V2 ...
- StandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2"
- // StandardDS1V2 ...
- StandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2"
- // StandardDS2 ...
- StandardDS2 VirtualMachineSizeTypes = "Standard_DS2"
- // StandardDS2V2 ...
- StandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2"
- // StandardDS3 ...
- StandardDS3 VirtualMachineSizeTypes = "Standard_DS3"
- // StandardDS3V2 ...
- StandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2"
- // StandardDS4 ...
- StandardDS4 VirtualMachineSizeTypes = "Standard_DS4"
- // StandardDS4V2 ...
- StandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2"
- // StandardDS5V2 ...
- StandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2"
- // StandardE16sV3 ...
- StandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3"
- // StandardE16V3 ...
- StandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3"
- // StandardE2sV3 ...
- StandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3"
- // StandardE2V3 ...
- StandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3"
- // StandardE3216V3 ...
- StandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3"
- // StandardE328sV3 ...
- StandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3"
- // StandardE32sV3 ...
- StandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3"
- // StandardE32V3 ...
- StandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3"
- // StandardE4sV3 ...
- StandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3"
- // StandardE4V3 ...
- StandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3"
- // StandardE6416sV3 ...
- StandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3"
- // StandardE6432sV3 ...
- StandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3"
- // StandardE64sV3 ...
- StandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3"
- // StandardE64V3 ...
- StandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3"
- // StandardE8sV3 ...
- StandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3"
- // StandardE8V3 ...
- StandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3"
- // StandardF1 ...
- StandardF1 VirtualMachineSizeTypes = "Standard_F1"
- // StandardF16 ...
- StandardF16 VirtualMachineSizeTypes = "Standard_F16"
- // StandardF16s ...
- StandardF16s VirtualMachineSizeTypes = "Standard_F16s"
- // StandardF16sV2 ...
- StandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2"
- // StandardF1s ...
- StandardF1s VirtualMachineSizeTypes = "Standard_F1s"
- // StandardF2 ...
- StandardF2 VirtualMachineSizeTypes = "Standard_F2"
- // StandardF2s ...
- StandardF2s VirtualMachineSizeTypes = "Standard_F2s"
- // StandardF2sV2 ...
- StandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2"
- // StandardF32sV2 ...
- StandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2"
- // StandardF4 ...
- StandardF4 VirtualMachineSizeTypes = "Standard_F4"
- // StandardF4s ...
- StandardF4s VirtualMachineSizeTypes = "Standard_F4s"
- // StandardF4sV2 ...
- StandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2"
- // StandardF64sV2 ...
- StandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2"
- // StandardF72sV2 ...
- StandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2"
- // StandardF8 ...
- StandardF8 VirtualMachineSizeTypes = "Standard_F8"
- // StandardF8s ...
- StandardF8s VirtualMachineSizeTypes = "Standard_F8s"
- // StandardF8sV2 ...
- StandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2"
- // StandardG1 ...
- StandardG1 VirtualMachineSizeTypes = "Standard_G1"
- // StandardG2 ...
- StandardG2 VirtualMachineSizeTypes = "Standard_G2"
- // StandardG3 ...
- StandardG3 VirtualMachineSizeTypes = "Standard_G3"
- // StandardG4 ...
- StandardG4 VirtualMachineSizeTypes = "Standard_G4"
- // StandardG5 ...
- StandardG5 VirtualMachineSizeTypes = "Standard_G5"
- // StandardGS1 ...
- StandardGS1 VirtualMachineSizeTypes = "Standard_GS1"
- // StandardGS2 ...
- StandardGS2 VirtualMachineSizeTypes = "Standard_GS2"
- // StandardGS3 ...
- StandardGS3 VirtualMachineSizeTypes = "Standard_GS3"
- // StandardGS4 ...
- StandardGS4 VirtualMachineSizeTypes = "Standard_GS4"
- // StandardGS44 ...
- StandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4"
- // StandardGS48 ...
- StandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8"
- // StandardGS5 ...
- StandardGS5 VirtualMachineSizeTypes = "Standard_GS5"
- // StandardGS516 ...
- StandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16"
- // StandardGS58 ...
- StandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8"
- // StandardH16 ...
- StandardH16 VirtualMachineSizeTypes = "Standard_H16"
- // StandardH16m ...
- StandardH16m VirtualMachineSizeTypes = "Standard_H16m"
- // StandardH16mr ...
- StandardH16mr VirtualMachineSizeTypes = "Standard_H16mr"
- // StandardH16r ...
- StandardH16r VirtualMachineSizeTypes = "Standard_H16r"
- // StandardH8 ...
- StandardH8 VirtualMachineSizeTypes = "Standard_H8"
- // StandardH8m ...
- StandardH8m VirtualMachineSizeTypes = "Standard_H8m"
- // StandardL16s ...
- StandardL16s VirtualMachineSizeTypes = "Standard_L16s"
- // StandardL32s ...
- StandardL32s VirtualMachineSizeTypes = "Standard_L32s"
- // StandardL4s ...
- StandardL4s VirtualMachineSizeTypes = "Standard_L4s"
- // StandardL8s ...
- StandardL8s VirtualMachineSizeTypes = "Standard_L8s"
- // StandardM12832ms ...
- StandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms"
- // StandardM12864ms ...
- StandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms"
- // StandardM128ms ...
- StandardM128ms VirtualMachineSizeTypes = "Standard_M128ms"
- // StandardM128s ...
- StandardM128s VirtualMachineSizeTypes = "Standard_M128s"
- // StandardM6416ms ...
- StandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms"
- // StandardM6432ms ...
- StandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms"
- // StandardM64ms ...
- StandardM64ms VirtualMachineSizeTypes = "Standard_M64ms"
- // StandardM64s ...
- StandardM64s VirtualMachineSizeTypes = "Standard_M64s"
- // StandardNC12 ...
- StandardNC12 VirtualMachineSizeTypes = "Standard_NC12"
- // StandardNC12sV2 ...
- StandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2"
- // StandardNC12sV3 ...
- StandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3"
- // StandardNC24 ...
- StandardNC24 VirtualMachineSizeTypes = "Standard_NC24"
- // StandardNC24r ...
- StandardNC24r VirtualMachineSizeTypes = "Standard_NC24r"
- // StandardNC24rsV2 ...
- StandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2"
- // StandardNC24rsV3 ...
- StandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3"
- // StandardNC24sV2 ...
- StandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2"
- // StandardNC24sV3 ...
- StandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3"
- // StandardNC6 ...
- StandardNC6 VirtualMachineSizeTypes = "Standard_NC6"
- // StandardNC6sV2 ...
- StandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2"
- // StandardNC6sV3 ...
- StandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3"
- // StandardND12s ...
- StandardND12s VirtualMachineSizeTypes = "Standard_ND12s"
- // StandardND24rs ...
- StandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs"
- // StandardND24s ...
- StandardND24s VirtualMachineSizeTypes = "Standard_ND24s"
- // StandardND6s ...
- StandardND6s VirtualMachineSizeTypes = "Standard_ND6s"
- // StandardNV12 ...
- StandardNV12 VirtualMachineSizeTypes = "Standard_NV12"
- // StandardNV24 ...
- StandardNV24 VirtualMachineSizeTypes = "Standard_NV24"
- // StandardNV6 ...
- StandardNV6 VirtualMachineSizeTypes = "Standard_NV6"
-)
-
-// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type.
-func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes {
- return []VirtualMachineSizeTypes{BasicA0, BasicA1, BasicA2, BasicA3, BasicA4, StandardA0, StandardA1, StandardA10, StandardA11, StandardA1V2, StandardA2, StandardA2mV2, StandardA2V2, StandardA3, StandardA4, StandardA4mV2, StandardA4V2, StandardA5, StandardA6, StandardA7, StandardA8, StandardA8mV2, StandardA8V2, StandardA9, StandardB1ms, StandardB1s, StandardB2ms, StandardB2s, StandardB4ms, StandardB8ms, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD15V2, StandardD16sV3, StandardD16V3, StandardD1V2, StandardD2, StandardD2sV3, StandardD2V2, StandardD2V3, StandardD3, StandardD32sV3, StandardD32V3, StandardD3V2, StandardD4, StandardD4sV3, StandardD4V2, StandardD4V3, StandardD5V2, StandardD64sV3, StandardD64V3, StandardD8sV3, StandardD8V3, StandardDS1, StandardDS11, StandardDS11V2, StandardDS12, StandardDS12V2, StandardDS13, StandardDS132V2, StandardDS134V2, StandardDS13V2, StandardDS14, StandardDS144V2, StandardDS148V2, StandardDS14V2, StandardDS15V2, StandardDS1V2, StandardDS2, StandardDS2V2, StandardDS3, StandardDS3V2, StandardDS4, StandardDS4V2, StandardDS5V2, StandardE16sV3, StandardE16V3, StandardE2sV3, StandardE2V3, StandardE3216V3, StandardE328sV3, StandardE32sV3, StandardE32V3, StandardE4sV3, StandardE4V3, StandardE6416sV3, StandardE6432sV3, StandardE64sV3, StandardE64V3, StandardE8sV3, StandardE8V3, StandardF1, StandardF16, StandardF16s, StandardF16sV2, StandardF1s, StandardF2, StandardF2s, StandardF2sV2, StandardF32sV2, StandardF4, StandardF4s, StandardF4sV2, StandardF64sV2, StandardF72sV2, StandardF8, StandardF8s, StandardF8sV2, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS44, StandardGS48, StandardGS5, StandardGS516, StandardGS58, StandardH16, StandardH16m, StandardH16mr, StandardH16r, StandardH8, StandardH8m, StandardL16s, StandardL32s, StandardL4s, StandardL8s, StandardM12832ms, StandardM12864ms, StandardM128ms, StandardM128s, StandardM6416ms, StandardM6432ms, StandardM64ms, StandardM64s, StandardNC12, StandardNC12sV2, StandardNC12sV3, StandardNC24, StandardNC24r, StandardNC24rsV2, StandardNC24rsV3, StandardNC24sV2, StandardNC24sV3, StandardNC6, StandardNC6sV2, StandardNC6sV3, StandardND12s, StandardND24rs, StandardND24s, StandardND6s, StandardNV12, StandardNV24, StandardNV6}
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/images.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/images.go
deleted file mode 100644
index bbafec288..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/images.go
+++ /dev/null
@@ -1,584 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// ImagesClient is the compute Client
-type ImagesClient struct {
- BaseClient
-}
-
-// NewImagesClient creates an instance of the ImagesClient client.
-func NewImagesClient(subscriptionID string) ImagesClient {
- return NewImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewImagesClientWithBaseURI creates an instance of the ImagesClient client using a custom endpoint. Use this when
-// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient {
- return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdate create or update an image.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// imageName - the name of the image.
-// parameters - parameters supplied to the Create Image operation.
-func (client ImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (result ImagesCreateOrUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, imageName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateOrUpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "imageName": autorest.Encode("path", imageName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client ImagesClient) CreateOrUpdateSender(req *http.Request) (future ImagesCreateOrUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes an Image.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// imageName - the name of the image.
-func (client ImagesClient) Delete(ctx context.Context, resourceGroupName string, imageName string) (result ImagesDeleteFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Delete")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeletePreparer(ctx, resourceGroupName, imageName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client ImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, imageName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "imageName": autorest.Encode("path", imageName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client ImagesClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get gets an image.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// imageName - the name of the image.
-// expand - the expand expression to apply on the operation.
-func (client ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, expand string) (result Image, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, resourceGroupName, imageName, expand)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, imageName string, expand string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "imageName": autorest.Encode("path", imageName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ImagesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets the list of Images in the subscription. Use nextLink property in the response to get the next page of
-// Images. Do this till nextLink is null to fetch all the Images.
-func (client ImagesClient) List(ctx context.Context) (result ImageListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List")
- defer func() {
- sc := -1
- if result.ilr.Response.Response != nil {
- sc = result.ilr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.ilr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure sending request")
- return
- }
-
- result.ilr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure responding to request")
- return
- }
- if result.ilr.hasNextLink() && result.ilr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ImagesClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ImagesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ImagesClient) ListResponder(resp *http.Response) (result ImageListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client ImagesClient) listNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) {
- req, err := lastResults.imageListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ImagesClient) ListComplete(ctx context.Context) (result ImageListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx)
- return
-}
-
-// ListByResourceGroup gets the list of images under a resource group.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ImageListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup")
- defer func() {
- sc := -1
- if result.ilr.Response.Response != nil {
- sc = result.ilr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listByResourceGroupNextResults
- req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.ilr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure sending request")
- return
- }
-
- result.ilr, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure responding to request")
- return
- }
- if result.ilr.hasNextLink() && result.ilr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
-func (client ImagesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
-// http.Response Body if it receives an error.
-func (client ImagesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
-// closes the http.Response Body.
-func (client ImagesClient) ListByResourceGroupResponder(resp *http.Response) (result ImageListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listByResourceGroupNextResults retrieves the next set of results, if any.
-func (client ImagesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) {
- req, err := lastResults.imageListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ImagesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ImageListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
- return
-}
-
-// Update update an image.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// imageName - the name of the image.
-// parameters - parameters supplied to the Update Image operation.
-func (client ImagesClient) Update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (result ImagesUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Update")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.UpdatePreparer(ctx, resourceGroupName, imageName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", nil, "Failure preparing request")
- return
- }
-
- result, err = client.UpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client ImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "imageName": autorest.Encode("path", imageName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client ImagesClient) UpdateResponder(resp *http.Response) (result Image, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/loganalytics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/loganalytics.go
deleted file mode 100644
index f6f8be60a..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/loganalytics.go
+++ /dev/null
@@ -1,206 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// LogAnalyticsClient is the compute Client
-type LogAnalyticsClient struct {
- BaseClient
-}
-
-// NewLogAnalyticsClient creates an instance of the LogAnalyticsClient client.
-func NewLogAnalyticsClient(subscriptionID string) LogAnalyticsClient {
- return NewLogAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewLogAnalyticsClientWithBaseURI creates an instance of the LogAnalyticsClient client using a custom endpoint. Use
-// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) LogAnalyticsClient {
- return LogAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// ExportRequestRateByInterval export logs that show Api requests made by this subscription in the given time window to
-// show throttling activities.
-// Parameters:
-// parameters - parameters supplied to the LogAnalytics getRequestRateByInterval Api.
-// location - the location upon which virtual-machine-sizes is queried.
-func (client LogAnalyticsClient) ExportRequestRateByInterval(ctx context.Context, parameters RequestRateByIntervalInput, location string) (result LogAnalyticsExportRequestRateByIntervalFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportRequestRateByInterval")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: location,
- Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.LogAnalyticsClient", "ExportRequestRateByInterval", err.Error())
- }
-
- req, err := client.ExportRequestRateByIntervalPreparer(ctx, parameters, location)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", nil, "Failure preparing request")
- return
- }
-
- result, err = client.ExportRequestRateByIntervalSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// ExportRequestRateByIntervalPreparer prepares the ExportRequestRateByInterval request.
-func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context.Context, parameters RequestRateByIntervalInput, location string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExportRequestRateByIntervalSender sends the ExportRequestRateByInterval request. The method will close the
-// http.Response Body if it receives an error.
-func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Request) (future LogAnalyticsExportRequestRateByIntervalFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// ExportRequestRateByIntervalResponder handles the response to the ExportRequestRateByInterval request. The method always
-// closes the http.Response Body.
-func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ExportThrottledRequests export logs that show total throttled Api requests for this subscription in the given time
-// window.
-// Parameters:
-// parameters - parameters supplied to the LogAnalytics getThrottledRequests Api.
-// location - the location upon which virtual-machine-sizes is queried.
-func (client LogAnalyticsClient) ExportThrottledRequests(ctx context.Context, parameters ThrottledRequestsInput, location string) (result LogAnalyticsExportThrottledRequestsFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportThrottledRequests")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: location,
- Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.LogAnalyticsClient", "ExportThrottledRequests", err.Error())
- }
-
- req, err := client.ExportThrottledRequestsPreparer(ctx, parameters, location)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", nil, "Failure preparing request")
- return
- }
-
- result, err = client.ExportThrottledRequestsSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// ExportThrottledRequestsPreparer prepares the ExportThrottledRequests request.
-func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Context, parameters ThrottledRequestsInput, location string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExportThrottledRequestsSender sends the ExportThrottledRequests request. The method will close the
-// http.Response Body if it receives an error.
-func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request) (future LogAnalyticsExportThrottledRequestsFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// ExportThrottledRequestsResponder handles the response to the ExportThrottledRequests request. The method always
-// closes the http.Response Body.
-func (client LogAnalyticsClient) ExportThrottledRequestsResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/models.go
deleted file mode 100644
index e2efc0545..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/models.go
+++ /dev/null
@@ -1,9510 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "encoding/json"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/to"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// The package's fully qualified name.
-const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute"
-
-// AccessURI a disk access SAS uri.
-type AccessURI struct {
- autorest.Response `json:"-"`
- // AccessURIOutput - Operation output data (raw JSON)
- *AccessURIOutput `json:"properties,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for AccessURI.
-func (au AccessURI) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if au.AccessURIOutput != nil {
- objectMap["properties"] = au.AccessURIOutput
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for AccessURI struct.
-func (au *AccessURI) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var accessURIOutput AccessURIOutput
- err = json.Unmarshal(*v, &accessURIOutput)
- if err != nil {
- return err
- }
- au.AccessURIOutput = &accessURIOutput
- }
- }
- }
-
- return nil
-}
-
-// AccessURIOutput azure properties, including output.
-type AccessURIOutput struct {
- // AccessURIRaw - Operation output data (raw JSON)
- *AccessURIRaw `json:"output,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for AccessURIOutput.
-func (auo AccessURIOutput) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if auo.AccessURIRaw != nil {
- objectMap["output"] = auo.AccessURIRaw
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for AccessURIOutput struct.
-func (auo *AccessURIOutput) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "output":
- if v != nil {
- var accessURIRaw AccessURIRaw
- err = json.Unmarshal(*v, &accessURIRaw)
- if err != nil {
- return err
- }
- auo.AccessURIRaw = &accessURIRaw
- }
- }
- }
-
- return nil
-}
-
-// AccessURIRaw this object gets 'bubbled up' through flattening.
-type AccessURIRaw struct {
- // AccessSAS - READ-ONLY; A SAS uri for accessing a disk.
- AccessSAS *string `json:"accessSAS,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for AccessURIRaw.
-func (aur AccessURIRaw) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// AdditionalUnattendContent specifies additional XML formatted information that can be included in the
-// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name,
-// and the pass in which the content is applied.
-type AdditionalUnattendContent struct {
- // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem'
- PassName PassNames `json:"passName,omitempty"`
- // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'MicrosoftWindowsShellSetup'
- ComponentName ComponentNames `json:"componentName,omitempty"`
- // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands'
- SettingName SettingNames `json:"settingName,omitempty"`
- // Content - Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted.
- Content *string `json:"content,omitempty"`
-}
-
-// APIEntityReference the API entity reference.
-type APIEntityReference struct {
- // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...
- ID *string `json:"id,omitempty"`
-}
-
-// APIError api error.
-type APIError struct {
- // Details - The Api error details
- Details *[]APIErrorBase `json:"details,omitempty"`
- // Innererror - The Api inner error
- Innererror *InnerError `json:"innererror,omitempty"`
- // Code - The error code.
- Code *string `json:"code,omitempty"`
- // Target - The target of the particular error.
- Target *string `json:"target,omitempty"`
- // Message - The error message.
- Message *string `json:"message,omitempty"`
-}
-
-// APIErrorBase api error base.
-type APIErrorBase struct {
- // Code - The error code.
- Code *string `json:"code,omitempty"`
- // Target - The target of the particular error.
- Target *string `json:"target,omitempty"`
- // Message - The error message.
- Message *string `json:"message,omitempty"`
-}
-
-// AutoOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade.
-type AutoOSUpgradePolicy struct {
- // DisableAutoRollback - Whether OS image rollback feature should be disabled. Default value is false.
- DisableAutoRollback *bool `json:"disableAutoRollback,omitempty"`
-}
-
-// AvailabilitySet specifies information about the availability set that the virtual machine should be
-// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to
-// maximize availability. For more information about availability sets, see [Manage the availability of
-// virtual
-// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
-//
For more information on Azure planned maintenance, see [Planned maintenance for virtual
-// machines in
-// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
-//
Currently, a VM can only be added to availability set at creation time. An existing VM cannot
-// be added to an availability set.
-type AvailabilitySet struct {
- autorest.Response `json:"-"`
- *AvailabilitySetProperties `json:"properties,omitempty"`
- // Sku - Sku of the availability set
- Sku *Sku `json:"sku,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for AvailabilitySet.
-func (as AvailabilitySet) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if as.AvailabilitySetProperties != nil {
- objectMap["properties"] = as.AvailabilitySetProperties
- }
- if as.Sku != nil {
- objectMap["sku"] = as.Sku
- }
- if as.Location != nil {
- objectMap["location"] = as.Location
- }
- if as.Tags != nil {
- objectMap["tags"] = as.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct.
-func (as *AvailabilitySet) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var availabilitySetProperties AvailabilitySetProperties
- err = json.Unmarshal(*v, &availabilitySetProperties)
- if err != nil {
- return err
- }
- as.AvailabilitySetProperties = &availabilitySetProperties
- }
- case "sku":
- if v != nil {
- var sku Sku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- as.Sku = &sku
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- as.ID = &ID
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- as.Name = &name
- }
- case "type":
- if v != nil {
- var typeVar string
- err = json.Unmarshal(*v, &typeVar)
- if err != nil {
- return err
- }
- as.Type = &typeVar
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- as.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- as.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// AvailabilitySetListResult the List Availability Set operation response.
-type AvailabilitySetListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of availability sets
- Value *[]AvailabilitySet `json:"value,omitempty"`
- // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values.
-type AvailabilitySetListResultIterator struct {
- i int
- page AvailabilitySetListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *AvailabilitySetListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter AvailabilitySetListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet {
- if !iter.page.NotDone() {
- return AvailabilitySet{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the AvailabilitySetListResultIterator type.
-func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator {
- return AvailabilitySetListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (aslr AvailabilitySetListResult) IsEmpty() bool {
- return aslr.Value == nil || len(*aslr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (aslr AvailabilitySetListResult) hasNextLink() bool {
- return aslr.NextLink != nil && len(*aslr.NextLink) != 0
-}
-
-// availabilitySetListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !aslr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(aslr.NextLink)))
-}
-
-// AvailabilitySetListResultPage contains a page of AvailabilitySet values.
-type AvailabilitySetListResultPage struct {
- fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)
- aslr AvailabilitySetListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.aslr)
- if err != nil {
- return err
- }
- page.aslr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *AvailabilitySetListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page AvailabilitySetListResultPage) NotDone() bool {
- return !page.aslr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult {
- return page.aslr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page AvailabilitySetListResultPage) Values() []AvailabilitySet {
- if page.aslr.IsEmpty() {
- return nil
- }
- return *page.aslr.Value
-}
-
-// Creates a new instance of the AvailabilitySetListResultPage type.
-func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage {
- return AvailabilitySetListResultPage{
- fn: getNextPage,
- aslr: cur,
- }
-}
-
-// AvailabilitySetProperties the instance view of a resource.
-type AvailabilitySetProperties struct {
- // PlatformUpdateDomainCount - Update Domain count.
- PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"`
- // PlatformFaultDomainCount - Fault Domain count.
- PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"`
- // VirtualMachines - A list of references to all virtual machines in the availability set.
- VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"`
- // Statuses - READ-ONLY; The resource status information.
- Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for AvailabilitySetProperties.
-func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if asp.PlatformUpdateDomainCount != nil {
- objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount
- }
- if asp.PlatformFaultDomainCount != nil {
- objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount
- }
- if asp.VirtualMachines != nil {
- objectMap["virtualMachines"] = asp.VirtualMachines
- }
- return json.Marshal(objectMap)
-}
-
-// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should
-// be assigned to. Only tags may be updated.
-type AvailabilitySetUpdate struct {
- *AvailabilitySetProperties `json:"properties,omitempty"`
- // Sku - Sku of the availability set
- Sku *Sku `json:"sku,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for AvailabilitySetUpdate.
-func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if asu.AvailabilitySetProperties != nil {
- objectMap["properties"] = asu.AvailabilitySetProperties
- }
- if asu.Sku != nil {
- objectMap["sku"] = asu.Sku
- }
- if asu.Tags != nil {
- objectMap["tags"] = asu.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct.
-func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var availabilitySetProperties AvailabilitySetProperties
- err = json.Unmarshal(*v, &availabilitySetProperties)
- if err != nil {
- return err
- }
- asu.AvailabilitySetProperties = &availabilitySetProperties
- }
- case "sku":
- if v != nil {
- var sku Sku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- asu.Sku = &sku
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- asu.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and
-// Screenshot to diagnose VM status.
You can easily view the output of your console log.
-// Azure also enables you to see a screenshot of the VM from the hypervisor.
-type BootDiagnostics struct {
- // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine.
- Enabled *bool `json:"enabled,omitempty"`
- // StorageURI - Uri of the storage account to use for placing the console output and screenshot.
- StorageURI *string `json:"storageUri,omitempty"`
-}
-
-// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics.
-type BootDiagnosticsInstanceView struct {
- // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI.
- ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"`
- // SerialConsoleLogBlobURI - READ-ONLY; The Linux serial console log blob Uri.
- SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView.
-func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// CreationData data used when creating a disk.
-type CreationData struct {
- // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy'
- CreateOption DiskCreateOption `json:"createOption,omitempty"`
- // StorageAccountID - If createOption is Import, the Azure Resource Manager identifier of the storage account containing the blob to import as a disk. Required only if the blob is in a different subscription
- StorageAccountID *string `json:"storageAccountId,omitempty"`
- // ImageReference - Disk source information.
- ImageReference *ImageDiskReference `json:"imageReference,omitempty"`
- // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk.
- SourceURI *string `json:"sourceUri,omitempty"`
- // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk.
- SourceResourceID *string `json:"sourceResourceId,omitempty"`
-}
-
-// DataDisk describes a data disk.
-type DataDisk struct {
- // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
- Lun *int32 `json:"lun,omitempty"`
- // Name - The disk name.
- Name *string `json:"name,omitempty"`
- // Vhd - The virtual hard disk.
- Vhd *VirtualHardDisk `json:"vhd,omitempty"`
- // Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
- Image *VirtualHardDisk `json:"image,omitempty"`
- // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite'
- Caching CachingTypes `json:"caching,omitempty"`
- // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk.
- WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"`
- // CreateOption - Specifies how the virtual machine should be created.
Possible values are:
**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.
**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach'
- CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
- // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
- DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
- // ManagedDisk - The managed disk parameters.
- ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"`
-}
-
-// DataDiskImage contains the data disk images information.
-type DataDiskImage struct {
- // Lun - READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
- Lun *int32 `json:"lun,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for DataDiskImage.
-func (ddi DataDiskImage) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// DiagnosticsProfile specifies the boot diagnostic settings state.
Minimum api-version:
-// 2015-06-15.
-type DiagnosticsProfile struct {
- // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.
You can easily view the output of your console log.
Azure also enables you to see a screenshot of the VM from the hypervisor.
- BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"`
-}
-
-// Disk disk resource.
-type Disk struct {
- autorest.Response `json:"-"`
- // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached.
- ManagedBy *string `json:"managedBy,omitempty"`
- Sku *DiskSku `json:"sku,omitempty"`
- // Zones - The Logical zone list for Disk.
- Zones *[]string `json:"zones,omitempty"`
- *DiskProperties `json:"properties,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for Disk.
-func (d Disk) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if d.Sku != nil {
- objectMap["sku"] = d.Sku
- }
- if d.Zones != nil {
- objectMap["zones"] = d.Zones
- }
- if d.DiskProperties != nil {
- objectMap["properties"] = d.DiskProperties
- }
- if d.Location != nil {
- objectMap["location"] = d.Location
- }
- if d.Tags != nil {
- objectMap["tags"] = d.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for Disk struct.
-func (d *Disk) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "managedBy":
- if v != nil {
- var managedBy string
- err = json.Unmarshal(*v, &managedBy)
- if err != nil {
- return err
- }
- d.ManagedBy = &managedBy
- }
- case "sku":
- if v != nil {
- var sku DiskSku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- d.Sku = &sku
- }
- case "zones":
- if v != nil {
- var zones []string
- err = json.Unmarshal(*v, &zones)
- if err != nil {
- return err
- }
- d.Zones = &zones
- }
- case "properties":
- if v != nil {
- var diskProperties DiskProperties
- err = json.Unmarshal(*v, &diskProperties)
- if err != nil {
- return err
- }
- d.DiskProperties = &diskProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- d.ID = &ID
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- d.Name = &name
- }
- case "type":
- if v != nil {
- var typeVar string
- err = json.Unmarshal(*v, &typeVar)
- if err != nil {
- return err
- }
- d.Type = &typeVar
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- d.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- d.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// DiskEncryptionSettings describes a Encryption Settings for a Disk
-type DiskEncryptionSettings struct {
- // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret.
- DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"`
- // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault.
- KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"`
- // Enabled - Specifies whether disk encryption should be enabled on the virtual machine.
- Enabled *bool `json:"enabled,omitempty"`
-}
-
-// DiskInstanceView the instance view of the disk.
-type DiskInstanceView struct {
- // Name - The disk name.
- Name *string `json:"name,omitempty"`
- // EncryptionSettings - Specifies the encryption settings for the OS Disk.
Minimum api-version: 2015-06-15
- EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"`
- // Statuses - The resource status information.
- Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
-}
-
-// DiskList the List Disks operation response.
-type DiskList struct {
- autorest.Response `json:"-"`
- // Value - A list of disks.
- Value *[]Disk `json:"value,omitempty"`
- // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// DiskListIterator provides access to a complete listing of Disk values.
-type DiskListIterator struct {
- i int
- page DiskListPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *DiskListIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter DiskListIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter DiskListIterator) Response() DiskList {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter DiskListIterator) Value() Disk {
- if !iter.page.NotDone() {
- return Disk{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the DiskListIterator type.
-func NewDiskListIterator(page DiskListPage) DiskListIterator {
- return DiskListIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (dl DiskList) IsEmpty() bool {
- return dl.Value == nil || len(*dl.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (dl DiskList) hasNextLink() bool {
- return dl.NextLink != nil && len(*dl.NextLink) != 0
-}
-
-// diskListPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) {
- if !dl.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(dl.NextLink)))
-}
-
-// DiskListPage contains a page of Disk values.
-type DiskListPage struct {
- fn func(context.Context, DiskList) (DiskList, error)
- dl DiskList
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.dl)
- if err != nil {
- return err
- }
- page.dl = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *DiskListPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page DiskListPage) NotDone() bool {
- return !page.dl.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page DiskListPage) Response() DiskList {
- return page.dl
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page DiskListPage) Values() []Disk {
- if page.dl.IsEmpty() {
- return nil
- }
- return *page.dl.Value
-}
-
-// Creates a new instance of the DiskListPage type.
-func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage {
- return DiskListPage{
- fn: getNextPage,
- dl: cur,
- }
-}
-
-// DiskProperties disk resource properties.
-type DiskProperties struct {
- // TimeCreated - READ-ONLY; The time when the disk was created.
- TimeCreated *date.Time `json:"timeCreated,omitempty"`
- // OsType - The Operating System type. Possible values include: 'Windows', 'Linux'
- OsType OperatingSystemTypes `json:"osType,omitempty"`
- // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created.
- CreationData *CreationData `json:"creationData,omitempty"`
- // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size.
- DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
- // EncryptionSettings - Encryption settings for disk or snapshot
- EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"`
- // ProvisioningState - READ-ONLY; The disk provisioning state.
- ProvisioningState *string `json:"provisioningState,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for DiskProperties.
-func (dp DiskProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if dp.OsType != "" {
- objectMap["osType"] = dp.OsType
- }
- if dp.CreationData != nil {
- objectMap["creationData"] = dp.CreationData
- }
- if dp.DiskSizeGB != nil {
- objectMap["diskSizeGB"] = dp.DiskSizeGB
- }
- if dp.EncryptionSettings != nil {
- objectMap["encryptionSettings"] = dp.EncryptionSettings
- }
- return json.Marshal(objectMap)
-}
-
-// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type DisksCreateOrUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(DisksClient) (Disk, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for DisksCreateOrUpdateFuture.Result.
-func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- d.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
- d, err = client.CreateOrUpdateResponder(d.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
-type DisksDeleteFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(DisksClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for DisksDeleteFuture.Result.
-func (future *DisksDeleteFuture) result(client DisksClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeleteResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type DisksGrantAccessFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(DisksClient) (AccessURI, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for DisksGrantAccessFuture.Result.
-func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- au.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent {
- au, err = client.GrantAccessResponder(au.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// DiskSku the disks and snapshots sku name. Can be Standard_LRS or Premium_LRS.
-type DiskSku struct {
- // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS'
- Name StorageAccountTypes `json:"name,omitempty"`
- // Tier - READ-ONLY; The sku tier.
- Tier *string `json:"tier,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for DiskSku.
-func (ds DiskSku) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if ds.Name != "" {
- objectMap["name"] = ds.Name
- }
- return json.Marshal(objectMap)
-}
-
-// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type DisksRevokeAccessFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(DisksClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for DisksRevokeAccessFuture.Result.
-func (future *DisksRevokeAccessFuture) result(client DisksClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.RevokeAccessResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
-type DisksUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(DisksClient) (Disk, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for DisksUpdateFuture.Result.
-func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- d.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
- d, err = client.UpdateResponder(d.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// DiskUpdate disk update resource.
-type DiskUpdate struct {
- *DiskUpdateProperties `json:"properties,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
- Sku *DiskSku `json:"sku,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for DiskUpdate.
-func (du DiskUpdate) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if du.DiskUpdateProperties != nil {
- objectMap["properties"] = du.DiskUpdateProperties
- }
- if du.Tags != nil {
- objectMap["tags"] = du.Tags
- }
- if du.Sku != nil {
- objectMap["sku"] = du.Sku
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct.
-func (du *DiskUpdate) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var diskUpdateProperties DiskUpdateProperties
- err = json.Unmarshal(*v, &diskUpdateProperties)
- if err != nil {
- return err
- }
- du.DiskUpdateProperties = &diskUpdateProperties
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- du.Tags = tags
- }
- case "sku":
- if v != nil {
- var sku DiskSku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- du.Sku = &sku
- }
- }
- }
-
- return nil
-}
-
-// DiskUpdateProperties disk resource update properties.
-type DiskUpdateProperties struct {
- // OsType - the Operating System type. Possible values include: 'Windows', 'Linux'
- OsType OperatingSystemTypes `json:"osType,omitempty"`
- // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size.
- DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
- // EncryptionSettings - Encryption settings for disk or snapshot
- EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"`
-}
-
-// EncryptionSettings encryption settings for disk or snapshot
-type EncryptionSettings struct {
- // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged.
- Enabled *bool `json:"enabled,omitempty"`
- // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key
- DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"`
- // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key
- KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"`
-}
-
-// GrantAccessData data used for requesting a SAS.
-type GrantAccessData struct {
- // Access - Possible values include: 'None', 'Read'
- Access AccessLevel `json:"access,omitempty"`
- // DurationInSeconds - Time duration in seconds until the SAS access expires.
- DurationInSeconds *int32 `json:"durationInSeconds,omitempty"`
-}
-
-// HardwareProfile specifies the hardware settings for the virtual machine.
-type HardwareProfile struct {
- // VMSize - Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
The available VM sizes depend on region and availability set. For a list of available sizes use these APIs:
[List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes)
[List all available virtual machine sizes in a region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list)
[List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). Possible values include: 'BasicA0', 'BasicA1', 'BasicA2', 'BasicA3', 'BasicA4', 'StandardA0', 'StandardA1', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2V2', 'StandardA4V2', 'StandardA8V2', 'StandardA2mV2', 'StandardA4mV2', 'StandardA8mV2', 'StandardB1s', 'StandardB1ms', 'StandardB2s', 'StandardB2ms', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD2V3', 'StandardD4V3', 'StandardD8V3', 'StandardD16V3', 'StandardD32V3', 'StandardD64V3', 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardD15V2', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardDS1V2', 'StandardDS2V2', 'StandardDS3V2', 'StandardDS4V2', 'StandardDS5V2', 'StandardDS11V2', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardDS134V2', 'StandardDS132V2', 'StandardDS148V2', 'StandardDS144V2', 'StandardE2V3', 'StandardE4V3', 'StandardE8V3', 'StandardE16V3', 'StandardE32V3', 'StandardE64V3', 'StandardE2sV3', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardE3216V3', 'StandardE328sV3', 'StandardE6432sV3', 'StandardE6416sV3', 'StandardF1', 'StandardF2', 'StandardF4', 'StandardF8', 'StandardF16', 'StandardF1s', 'StandardF2s', 'StandardF4s', 'StandardF8s', 'StandardF16s', 'StandardF2sV2', 'StandardF4sV2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardGS48', 'StandardGS44', 'StandardGS516', 'StandardGS58', 'StandardH8', 'StandardH16', 'StandardH8m', 'StandardH16m', 'StandardH16r', 'StandardH16mr', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s', 'StandardM64s', 'StandardM64ms', 'StandardM128s', 'StandardM128ms', 'StandardM6432ms', 'StandardM6416ms', 'StandardM12864ms', 'StandardM12832ms', 'StandardNC6', 'StandardNC12', 'StandardNC24', 'StandardNC24r', 'StandardNC6sV2', 'StandardNC12sV2', 'StandardNC24sV2', 'StandardNC24rsV2', 'StandardNC6sV3', 'StandardNC12sV3', 'StandardNC24sV3', 'StandardNC24rsV3', 'StandardND6s', 'StandardND12s', 'StandardND24s', 'StandardND24rs', 'StandardNV6', 'StandardNV12', 'StandardNV24'
- VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"`
-}
-
-// Image the source user image virtual hard disk. The virtual hard disk will be copied before being
-// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not
-// exist.
-type Image struct {
- autorest.Response `json:"-"`
- *ImageProperties `json:"properties,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for Image.
-func (i Image) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if i.ImageProperties != nil {
- objectMap["properties"] = i.ImageProperties
- }
- if i.Location != nil {
- objectMap["location"] = i.Location
- }
- if i.Tags != nil {
- objectMap["tags"] = i.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for Image struct.
-func (i *Image) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var imageProperties ImageProperties
- err = json.Unmarshal(*v, &imageProperties)
- if err != nil {
- return err
- }
- i.ImageProperties = &imageProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- i.ID = &ID
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- i.Name = &name
- }
- case "type":
- if v != nil {
- var typeVar string
- err = json.Unmarshal(*v, &typeVar)
- if err != nil {
- return err
- }
- i.Type = &typeVar
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- i.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- i.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// ImageDataDisk describes a data disk.
-type ImageDataDisk struct {
- // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
- Lun *int32 `json:"lun,omitempty"`
- // Snapshot - The snapshot.
- Snapshot *SubResource `json:"snapshot,omitempty"`
- // ManagedDisk - The managedDisk.
- ManagedDisk *SubResource `json:"managedDisk,omitempty"`
- // BlobURI - The Virtual Hard Disk.
- BlobURI *string `json:"blobUri,omitempty"`
- // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite'
- Caching CachingTypes `json:"caching,omitempty"`
- // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
- DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
- // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS'
- StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"`
-}
-
-// ImageDiskReference the source image used for creating the disk.
-type ImageDiskReference struct {
- // ID - A relative uri containing either a Platform Image Repository or user image reference.
- ID *string `json:"id,omitempty"`
- // Lun - If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null.
- Lun *int32 `json:"lun,omitempty"`
-}
-
-// ImageListResult the List Image operation response.
-type ImageListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of Images.
- Value *[]Image `json:"value,omitempty"`
- // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// ImageListResultIterator provides access to a complete listing of Image values.
-type ImageListResultIterator struct {
- i int
- page ImageListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *ImageListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ImageListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ImageListResultIterator) Response() ImageListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ImageListResultIterator) Value() Image {
- if !iter.page.NotDone() {
- return Image{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the ImageListResultIterator type.
-func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator {
- return ImageListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (ilr ImageListResult) IsEmpty() bool {
- return ilr.Value == nil || len(*ilr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (ilr ImageListResult) hasNextLink() bool {
- return ilr.NextLink != nil && len(*ilr.NextLink) != 0
-}
-
-// imageListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !ilr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(ilr.NextLink)))
-}
-
-// ImageListResultPage contains a page of Image values.
-type ImageListResultPage struct {
- fn func(context.Context, ImageListResult) (ImageListResult, error)
- ilr ImageListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.ilr)
- if err != nil {
- return err
- }
- page.ilr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *ImageListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ImageListResultPage) NotDone() bool {
- return !page.ilr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ImageListResultPage) Response() ImageListResult {
- return page.ilr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ImageListResultPage) Values() []Image {
- if page.ilr.IsEmpty() {
- return nil
- }
- return *page.ilr.Value
-}
-
-// Creates a new instance of the ImageListResultPage type.
-func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage {
- return ImageListResultPage{
- fn: getNextPage,
- ilr: cur,
- }
-}
-
-// ImageOSDisk describes an Operating System disk.
-type ImageOSDisk struct {
- // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.
Possible values are:
**Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
- OsType OperatingSystemTypes `json:"osType,omitempty"`
- // OsState - The OS State. Possible values include: 'Generalized', 'Specialized'
- OsState OperatingSystemStateTypes `json:"osState,omitempty"`
- // Snapshot - The snapshot.
- Snapshot *SubResource `json:"snapshot,omitempty"`
- // ManagedDisk - The managedDisk.
- ManagedDisk *SubResource `json:"managedDisk,omitempty"`
- // BlobURI - The Virtual Hard Disk.
- BlobURI *string `json:"blobUri,omitempty"`
- // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite'
- Caching CachingTypes `json:"caching,omitempty"`
- // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
- DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
- // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS'
- StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"`
-}
-
-// ImageProperties describes the properties of an Image.
-type ImageProperties struct {
- // SourceVirtualMachine - The source virtual machine from which Image is created.
- SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"`
- // StorageProfile - Specifies the storage settings for the virtual machine disks.
- StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state.
- ProvisioningState *string `json:"provisioningState,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ImageProperties.
-func (IP ImageProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if IP.SourceVirtualMachine != nil {
- objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine
- }
- if IP.StorageProfile != nil {
- objectMap["storageProfile"] = IP.StorageProfile
- }
- return json.Marshal(objectMap)
-}
-
-// ImageReference specifies information about the image to use. You can specify information about platform
-// images, marketplace images, or virtual machine images. This element is required when you want to use a
-// platform image, marketplace image, or virtual machine image, but is not used in other creation
-// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set.
-type ImageReference struct {
- // Publisher - The image publisher.
- Publisher *string `json:"publisher,omitempty"`
- // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine.
- Offer *string `json:"offer,omitempty"`
- // Sku - The image SKU.
- Sku *string `json:"sku,omitempty"`
- // Version - Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available.
- Version *string `json:"version,omitempty"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type ImagesCreateOrUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(ImagesClient) (Image, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for ImagesCreateOrUpdateFuture.Result.
-func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- i.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent {
- i, err = client.CreateOrUpdateResponder(i.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
-type ImagesDeleteFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(ImagesClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for ImagesDeleteFuture.Result.
-func (future *ImagesDeleteFuture) result(client ImagesClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeleteResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// ImageStorageProfile describes a storage profile.
-type ImageStorageProfile struct {
- // OsDisk - Specifies information about the operating system disk used by the virtual machine.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- OsDisk *ImageOSDisk `json:"osDisk,omitempty"`
- // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"`
- // ZoneResilient - Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS).
- ZoneResilient *bool `json:"zoneResilient,omitempty"`
-}
-
-// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
-type ImagesUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(ImagesClient) (Image, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for ImagesUpdateFuture.Result.
-func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- i.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent {
- i, err = client.UpdateResponder(i.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// ImageUpdate the source user image virtual hard disk. Only tags may be updated.
-type ImageUpdate struct {
- *ImageProperties `json:"properties,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for ImageUpdate.
-func (iu ImageUpdate) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if iu.ImageProperties != nil {
- objectMap["properties"] = iu.ImageProperties
- }
- if iu.Tags != nil {
- objectMap["tags"] = iu.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct.
-func (iu *ImageUpdate) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var imageProperties ImageProperties
- err = json.Unmarshal(*v, &imageProperties)
- if err != nil {
- return err
- }
- iu.ImageProperties = &imageProperties
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- iu.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// InnerError inner error details.
-type InnerError struct {
- // Exceptiontype - The exception type.
- Exceptiontype *string `json:"exceptiontype,omitempty"`
- // Errordetail - The internal error message or exception dump.
- Errordetail *string `json:"errordetail,omitempty"`
-}
-
-// InstanceViewStatus instance view status.
-type InstanceViewStatus struct {
- // Code - The status code.
- Code *string `json:"code,omitempty"`
- // Level - The level code. Possible values include: 'Info', 'Warning', 'Error'
- Level StatusLevelTypes `json:"level,omitempty"`
- // DisplayStatus - The short localizable label for the status.
- DisplayStatus *string `json:"displayStatus,omitempty"`
- // Message - The detailed status message, including for alerts and error messages.
- Message *string `json:"message,omitempty"`
- // Time - The time of the status.
- Time *date.Time `json:"time,omitempty"`
-}
-
-// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used
-// to unwrap the encryptionKey
-type KeyVaultAndKeyReference struct {
- // SourceVault - Resource id of the KeyVault containing the key or secret
- SourceVault *SourceVault `json:"sourceVault,omitempty"`
- // KeyURL - Url pointing to a key or secret in KeyVault
- KeyURL *string `json:"keyUrl,omitempty"`
-}
-
-// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key
-type KeyVaultAndSecretReference struct {
- // SourceVault - Resource id of the KeyVault containing the key or secret
- SourceVault *SourceVault `json:"sourceVault,omitempty"`
- // SecretURL - Url pointing to a key or secret in KeyVault
- SecretURL *string `json:"secretUrl,omitempty"`
-}
-
-// KeyVaultKeyReference describes a reference to Key Vault Key
-type KeyVaultKeyReference struct {
- // KeyURL - The URL referencing a key encryption key in Key Vault.
- KeyURL *string `json:"keyUrl,omitempty"`
- // SourceVault - The relative URL of the Key Vault containing the key.
- SourceVault *SubResource `json:"sourceVault,omitempty"`
-}
-
-// KeyVaultSecretReference describes a reference to Key Vault Secret
-type KeyVaultSecretReference struct {
- // SecretURL - The URL referencing a secret in a Key Vault.
- SecretURL *string `json:"secretUrl,omitempty"`
- // SourceVault - The relative URL of the Key Vault containing the secret.
- SourceVault *SubResource `json:"sourceVault,omitempty"`
-}
-
-// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.
For a
-// list of supported Linux distributions, see [Linux on Azure-Endorsed
-// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
-//
For running non-endorsed distributions, see [Information for Non-Endorsed
-// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
-type LinuxConfiguration struct {
- // DisablePasswordAuthentication - Specifies whether password authentication should be disabled.
- DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"`
- // SSH - Specifies the ssh key configuration for a Linux OS.
- SSH *SSHConfiguration `json:"ssh,omitempty"`
-}
-
-// ListUsagesResult the List Usages operation response.
-type ListUsagesResult struct {
- autorest.Response `json:"-"`
- // Value - The list of compute resource usages.
- Value *[]Usage `json:"value,omitempty"`
- // NextLink - The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// ListUsagesResultIterator provides access to a complete listing of Usage values.
-type ListUsagesResultIterator struct {
- i int
- page ListUsagesResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *ListUsagesResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ListUsagesResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ListUsagesResultIterator) Response() ListUsagesResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ListUsagesResultIterator) Value() Usage {
- if !iter.page.NotDone() {
- return Usage{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the ListUsagesResultIterator type.
-func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator {
- return ListUsagesResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (lur ListUsagesResult) IsEmpty() bool {
- return lur.Value == nil || len(*lur.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (lur ListUsagesResult) hasNextLink() bool {
- return lur.NextLink != nil && len(*lur.NextLink) != 0
-}
-
-// listUsagesResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) {
- if !lur.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(lur.NextLink)))
-}
-
-// ListUsagesResultPage contains a page of Usage values.
-type ListUsagesResultPage struct {
- fn func(context.Context, ListUsagesResult) (ListUsagesResult, error)
- lur ListUsagesResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.lur)
- if err != nil {
- return err
- }
- page.lur = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *ListUsagesResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ListUsagesResultPage) NotDone() bool {
- return !page.lur.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ListUsagesResultPage) Response() ListUsagesResult {
- return page.lur
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ListUsagesResultPage) Values() []Usage {
- if page.lur.IsEmpty() {
- return nil
- }
- return *page.lur.Value
-}
-
-// Creates a new instance of the ListUsagesResultPage type.
-func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage {
- return ListUsagesResultPage{
- fn: getNextPage,
- lur: cur,
- }
-}
-
-// ListVirtualMachineExtensionImage ...
-type ListVirtualMachineExtensionImage struct {
- autorest.Response `json:"-"`
- Value *[]VirtualMachineExtensionImage `json:"value,omitempty"`
-}
-
-// ListVirtualMachineImageResource ...
-type ListVirtualMachineImageResource struct {
- autorest.Response `json:"-"`
- Value *[]VirtualMachineImageResource `json:"value,omitempty"`
-}
-
-// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results
-// of a long-running operation.
-type LogAnalyticsExportRequestRateByIntervalFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result.
-func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- laor.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent {
- laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type LogAnalyticsExportThrottledRequestsFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result.
-func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- laor.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent {
- laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// LogAnalyticsInputBase api input base class for LogAnalytics Api.
-type LogAnalyticsInputBase struct {
- // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to.
- BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"`
- // FromTime - From time of the query
- FromTime *date.Time `json:"fromTime,omitempty"`
- // ToTime - To time of the query
- ToTime *date.Time `json:"toTime,omitempty"`
- // GroupByThrottlePolicy - Group query result by Throttle Policy applied.
- GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"`
- // GroupByOperationName - Group query result by Operation Name.
- GroupByOperationName *bool `json:"groupByOperationName,omitempty"`
- // GroupByResourceName - Group query result by Resource Name.
- GroupByResourceName *bool `json:"groupByResourceName,omitempty"`
-}
-
-// LogAnalyticsOperationResult logAnalytics operation status response
-type LogAnalyticsOperationResult struct {
- autorest.Response `json:"-"`
- // Properties - READ-ONLY; LogAnalyticsOutput
- Properties *LogAnalyticsOutput `json:"properties,omitempty"`
- // Name - READ-ONLY; Operation ID
- Name *string `json:"name,omitempty"`
- // Status - READ-ONLY; Operation status
- Status *string `json:"status,omitempty"`
- // StartTime - READ-ONLY; Start time of the operation
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - READ-ONLY; End time of the operation
- EndTime *date.Time `json:"endTime,omitempty"`
- // Error - READ-ONLY; Api error
- Error *APIError `json:"error,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult.
-func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// LogAnalyticsOutput logAnalytics output properties
-type LogAnalyticsOutput struct {
- // Output - READ-ONLY; Output file Uri path to blob container.
- Output *string `json:"output,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for LogAnalyticsOutput.
-func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// LongRunningOperationProperties compute-specific operation properties, including output
-type LongRunningOperationProperties struct {
- // Output - Operation output data (raw JSON)
- Output interface{} `json:"output,omitempty"`
-}
-
-// MaintenanceRedeployStatus maintenance Operation Status.
-type MaintenanceRedeployStatus struct {
- // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance.
- IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"`
- // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window.
- PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"`
- // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window.
- PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"`
- // MaintenanceWindowStartTime - Start Time for the Maintenance Window.
- MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"`
- // MaintenanceWindowEndTime - End Time for the Maintenance Window.
- MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"`
- // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted'
- LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"`
- // LastOperationMessage - Message returned for the last Maintenance Operation.
- LastOperationMessage *string `json:"lastOperationMessage,omitempty"`
-}
-
-// ManagedDiskParameters the parameters of a managed disk.
-type ManagedDiskParameters struct {
- // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS'
- StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// NetworkInterfaceReference describes a network interface reference.
-type NetworkInterfaceReference struct {
- *NetworkInterfaceReferenceProperties `json:"properties,omitempty"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for NetworkInterfaceReference.
-func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if nir.NetworkInterfaceReferenceProperties != nil {
- objectMap["properties"] = nir.NetworkInterfaceReferenceProperties
- }
- if nir.ID != nil {
- objectMap["id"] = nir.ID
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct.
-func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties
- err = json.Unmarshal(*v, &networkInterfaceReferenceProperties)
- if err != nil {
- return err
- }
- nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- nir.ID = &ID
- }
- }
- }
-
- return nil
-}
-
-// NetworkInterfaceReferenceProperties describes a network interface reference properties.
-type NetworkInterfaceReferenceProperties struct {
- // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface.
- Primary *bool `json:"primary,omitempty"`
-}
-
-// NetworkProfile specifies the network interfaces of the virtual machine.
-type NetworkProfile struct {
- // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine.
- NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"`
-}
-
-// OperationListResult the List Compute Operation operation response.
-type OperationListResult struct {
- autorest.Response `json:"-"`
- // Value - READ-ONLY; The list of compute operations
- Value *[]OperationValue `json:"value,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for OperationListResult.
-func (olr OperationListResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// OperationStatusResponse operation status response
-type OperationStatusResponse struct {
- autorest.Response `json:"-"`
- // Name - READ-ONLY; Operation ID
- Name *string `json:"name,omitempty"`
- // Status - READ-ONLY; Operation status
- Status *string `json:"status,omitempty"`
- // StartTime - READ-ONLY; Start time of the operation
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - READ-ONLY; End time of the operation
- EndTime *date.Time `json:"endTime,omitempty"`
- // Error - READ-ONLY; Api error
- Error *APIError `json:"error,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for OperationStatusResponse.
-func (osr OperationStatusResponse) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// OperationValue describes the properties of a Compute Operation value.
-type OperationValue struct {
- // Origin - READ-ONLY; The origin of the compute operation.
- Origin *string `json:"origin,omitempty"`
- // Name - READ-ONLY; The name of the compute operation.
- Name *string `json:"name,omitempty"`
- *OperationValueDisplay `json:"display,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for OperationValue.
-func (ov OperationValue) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if ov.OperationValueDisplay != nil {
- objectMap["display"] = ov.OperationValueDisplay
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for OperationValue struct.
-func (ov *OperationValue) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "origin":
- if v != nil {
- var origin string
- err = json.Unmarshal(*v, &origin)
- if err != nil {
- return err
- }
- ov.Origin = &origin
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- ov.Name = &name
- }
- case "display":
- if v != nil {
- var operationValueDisplay OperationValueDisplay
- err = json.Unmarshal(*v, &operationValueDisplay)
- if err != nil {
- return err
- }
- ov.OperationValueDisplay = &operationValueDisplay
- }
- }
- }
-
- return nil
-}
-
-// OperationValueDisplay describes the properties of a Compute Operation Value Display.
-type OperationValueDisplay struct {
- // Operation - READ-ONLY; The display name of the compute operation.
- Operation *string `json:"operation,omitempty"`
- // Resource - READ-ONLY; The display name of the resource the operation applies to.
- Resource *string `json:"resource,omitempty"`
- // Description - READ-ONLY; The description of the operation.
- Description *string `json:"description,omitempty"`
- // Provider - READ-ONLY; The resource provider for the operation.
- Provider *string `json:"provider,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for OperationValueDisplay.
-func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// OSDisk specifies information about the operating system disk used by the virtual machine.
For
-// more information about disks, see [About disks and VHDs for Azure virtual
-// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
-type OSDisk struct {
- // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.
Possible values are:
**Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
- OsType OperatingSystemTypes `json:"osType,omitempty"`
- // EncryptionSettings - Specifies the encryption settings for the OS Disk.
Minimum api-version: 2015-06-15
- EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"`
- // Name - The disk name.
- Name *string `json:"name,omitempty"`
- // Vhd - The virtual hard disk.
- Vhd *VirtualHardDisk `json:"vhd,omitempty"`
- // Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
- Image *VirtualHardDisk `json:"image,omitempty"`
- // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite'
- Caching CachingTypes `json:"caching,omitempty"`
- // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk.
- WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"`
- // CreateOption - Specifies how the virtual machine should be created.
Possible values are:
**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.
**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach'
- CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
- // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
- DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
- // ManagedDisk - The managed disk parameters.
- ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"`
-}
-
-// OSDiskImage contains the os disk image information.
-type OSDiskImage struct {
- // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux'
- OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"`
-}
-
-// OSProfile specifies the operating system settings for the virtual machine.
-type OSProfile struct {
- // ComputerName - Specifies the host OS name of the virtual machine.
This name cannot be updated after the VM is created.
**Max-length (Windows):** 15 characters
**Max-length (Linux):** 64 characters.
For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions).
- ComputerName *string `json:"computerName,omitempty"`
- // AdminUsername - Specifies the name of the administrator account.
**Windows-only restriction:** Cannot end in "."
**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".
**Minimum-length (Linux):** 1 character
**Max-length (Linux):** 64 characters
**Max-length (Windows):** 20 characters
- For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- AdminUsername *string `json:"adminUsername,omitempty"`
- // AdminPassword - Specifies the password of the administrator account.
**Minimum-length (Windows):** 8 characters
**Minimum-length (Linux):** 6 characters
**Max-length (Windows):** 123 characters
**Max-length (Linux):** 72 characters
**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\W_])
**Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"
For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password)
- AdminPassword *string `json:"adminPassword,omitempty"`
- // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.
For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- CustomData *string `json:"customData,omitempty"`
- // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine.
- WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"`
- // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine.
For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
- LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"`
- // Secrets - Specifies set of certificates that should be installed onto the virtual machine.
- Secrets *[]VaultSecretGroup `json:"secrets,omitempty"`
-}
-
-// Plan specifies information about the marketplace image used to create the virtual machine. This element
-// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable
-// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use
-// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and
-// then click **Save**.
-type Plan struct {
- // Name - The plan ID.
- Name *string `json:"name,omitempty"`
- // Publisher - The publisher ID.
- Publisher *string `json:"publisher,omitempty"`
- // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element.
- Product *string `json:"product,omitempty"`
- // PromotionCode - The promotion code.
- PromotionCode *string `json:"promotionCode,omitempty"`
-}
-
-// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
-type PurchasePlan struct {
- // Publisher - The publisher ID.
- Publisher *string `json:"publisher,omitempty"`
- // Name - The plan ID.
- Name *string `json:"name,omitempty"`
- // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element.
- Product *string `json:"product,omitempty"`
-}
-
-// RecoveryWalkResponse response after calling a manual recovery walk
-type RecoveryWalkResponse struct {
- autorest.Response `json:"-"`
- // WalkPerformed - READ-ONLY; Whether the recovery walk was performed
- WalkPerformed *bool `json:"walkPerformed,omitempty"`
- // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed
- NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for RecoveryWalkResponse.
-func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api.
-type RequestRateByIntervalInput struct {
- // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins'
- IntervalLength IntervalInMins `json:"intervalLength,omitempty"`
- // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to.
- BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"`
- // FromTime - From time of the query
- FromTime *date.Time `json:"fromTime,omitempty"`
- // ToTime - To time of the query
- ToTime *date.Time `json:"toTime,omitempty"`
- // GroupByThrottlePolicy - Group query result by Throttle Policy applied.
- GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"`
- // GroupByOperationName - Group query result by Operation Name.
- GroupByOperationName *bool `json:"groupByOperationName,omitempty"`
- // GroupByResourceName - Group query result by Resource Name.
- GroupByResourceName *bool `json:"groupByResourceName,omitempty"`
-}
-
-// Resource the Resource model definition.
-type Resource struct {
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for Resource.
-func (r Resource) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if r.Location != nil {
- objectMap["location"] = r.Location
- }
- if r.Tags != nil {
- objectMap["tags"] = r.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// ResourceSku describes an available Compute SKU.
-type ResourceSku struct {
- // ResourceType - READ-ONLY; The type of resource the SKU applies to.
- ResourceType *string `json:"resourceType,omitempty"`
- // Name - READ-ONLY; The name of SKU.
- Name *string `json:"name,omitempty"`
- // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.
Possible Values:
**Standard**
**Basic**
- Tier *string `json:"tier,omitempty"`
- // Size - READ-ONLY; The Size of the SKU.
- Size *string `json:"size,omitempty"`
- // Family - READ-ONLY; The Family of this particular SKU.
- Family *string `json:"family,omitempty"`
- // Kind - READ-ONLY; The Kind of resources that are supported in this SKU.
- Kind *string `json:"kind,omitempty"`
- // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set.
- Capacity *ResourceSkuCapacity `json:"capacity,omitempty"`
- // Locations - READ-ONLY; The set of locations that the SKU is available.
- Locations *[]string `json:"locations,omitempty"`
- // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available.
- LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"`
- // APIVersions - READ-ONLY; The api versions that support this SKU.
- APIVersions *[]string `json:"apiVersions,omitempty"`
- // Costs - READ-ONLY; Metadata for retrieving price info.
- Costs *[]ResourceSkuCosts `json:"costs,omitempty"`
- // Capabilities - READ-ONLY; A name value pair to describe the capability.
- Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"`
- // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.
- Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ResourceSku.
-func (rs ResourceSku) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// ResourceSkuCapabilities describes The SKU capabilities object.
-type ResourceSkuCapabilities struct {
- // Name - READ-ONLY; An invariant to describe the feature.
- Name *string `json:"name,omitempty"`
- // Value - READ-ONLY; An invariant if the feature is measured by quantity.
- Value *string `json:"value,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ResourceSkuCapabilities.
-func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// ResourceSkuCapacity describes scaling information of a SKU.
-type ResourceSkuCapacity struct {
- // Minimum - READ-ONLY; The minimum capacity.
- Minimum *int64 `json:"minimum,omitempty"`
- // Maximum - READ-ONLY; The maximum capacity that can be set.
- Maximum *int64 `json:"maximum,omitempty"`
- // Default - READ-ONLY; The default capacity.
- Default *int64 `json:"default,omitempty"`
- // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone'
- ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ResourceSkuCapacity.
-func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// ResourceSkuCosts describes metadata for retrieving price info.
-type ResourceSkuCosts struct {
- // MeterID - READ-ONLY; Used for querying price from commerce.
- MeterID *string `json:"meterID,omitempty"`
- // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost.
- Quantity *int64 `json:"quantity,omitempty"`
- // ExtendedUnit - READ-ONLY; An invariant to show the extended unit.
- ExtendedUnit *string `json:"extendedUnit,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ResourceSkuCosts.
-func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// ResourceSkuLocationInfo ...
-type ResourceSkuLocationInfo struct {
- // Location - READ-ONLY; Location of the SKU
- Location *string `json:"location,omitempty"`
- // Zones - READ-ONLY; List of availability zones where the SKU is supported.
- Zones *[]string `json:"zones,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo.
-func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// ResourceSkuRestrictionInfo ...
-type ResourceSkuRestrictionInfo struct {
- // Locations - READ-ONLY; Locations where the SKU is restricted
- Locations *[]string `json:"locations,omitempty"`
- // Zones - READ-ONLY; List of availability zones where the SKU is restricted.
- Zones *[]string `json:"zones,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo.
-func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// ResourceSkuRestrictions describes scaling information of a SKU.
-type ResourceSkuRestrictions struct {
- // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone'
- Type ResourceSkuRestrictionsType `json:"type,omitempty"`
- // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted.
- Values *[]string `json:"values,omitempty"`
- // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used.
- RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"`
- // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription'
- ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ResourceSkuRestrictions.
-func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// ResourceSkusResult the List Resource Skus operation response.
-type ResourceSkusResult struct {
- autorest.Response `json:"-"`
- // Value - The list of skus available for the subscription.
- Value *[]ResourceSku `json:"value,omitempty"`
- // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values.
-type ResourceSkusResultIterator struct {
- i int
- page ResourceSkusResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *ResourceSkusResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ResourceSkusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ResourceSkusResultIterator) Response() ResourceSkusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ResourceSkusResultIterator) Value() ResourceSku {
- if !iter.page.NotDone() {
- return ResourceSku{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the ResourceSkusResultIterator type.
-func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator {
- return ResourceSkusResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (rsr ResourceSkusResult) IsEmpty() bool {
- return rsr.Value == nil || len(*rsr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (rsr ResourceSkusResult) hasNextLink() bool {
- return rsr.NextLink != nil && len(*rsr.NextLink) != 0
-}
-
-// resourceSkusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) {
- if !rsr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(rsr.NextLink)))
-}
-
-// ResourceSkusResultPage contains a page of ResourceSku values.
-type ResourceSkusResultPage struct {
- fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)
- rsr ResourceSkusResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.rsr)
- if err != nil {
- return err
- }
- page.rsr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *ResourceSkusResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ResourceSkusResultPage) NotDone() bool {
- return !page.rsr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ResourceSkusResultPage) Response() ResourceSkusResult {
- return page.rsr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ResourceSkusResultPage) Values() []ResourceSku {
- if page.rsr.IsEmpty() {
- return nil
- }
- return *page.rsr.Value
-}
-
-// Creates a new instance of the ResourceSkusResultPage type.
-func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage {
- return ResourceSkusResultPage{
- fn: getNextPage,
- rsr: cur,
- }
-}
-
-// ResourceUpdate the Resource model definition.
-type ResourceUpdate struct {
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
- Sku *DiskSku `json:"sku,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ResourceUpdate.
-func (ru ResourceUpdate) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if ru.Tags != nil {
- objectMap["tags"] = ru.Tags
- }
- if ru.Sku != nil {
- objectMap["sku"] = ru.Sku
- }
- return json.Marshal(objectMap)
-}
-
-// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation.
-type RollbackStatusInfo struct {
- // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back.
- SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"`
- // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback.
- FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"`
- // RollbackError - READ-ONLY; Error details if OS rollback failed.
- RollbackError *APIError `json:"rollbackError,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for RollbackStatusInfo.
-func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade.
-type RollingUpgradePolicy struct {
- // MaxBatchInstancePercent - The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%.
- MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"`
- // MaxUnhealthyInstancePercent - The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%.
- MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"`
- // MaxUnhealthyUpgradedInstancePercent - The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%.
- MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"`
- // PauseTimeBetweenBatches - The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S).
- PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"`
-}
-
-// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade
-// state.
-type RollingUpgradeProgressInfo struct {
- // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded.
- SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"`
- // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully.
- FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"`
- // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded.
- InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"`
- // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded.
- PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo.
-func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// RollingUpgradeRunningStatus information about the current running state of the overall upgrade.
-type RollingUpgradeRunningStatus struct {
- // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingForward', 'Cancelled', 'Completed', 'Faulted'
- Code RollingUpgradeStatusCode `json:"code,omitempty"`
- // StartTime - READ-ONLY; Start time of the upgrade.
- StartTime *date.Time `json:"startTime,omitempty"`
- // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel'
- LastAction RollingUpgradeActionType `json:"lastAction,omitempty"`
- // LastActionTime - READ-ONLY; Last action time of the upgrade.
- LastActionTime *date.Time `json:"lastActionTime,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus.
-func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade.
-type RollingUpgradeStatusInfo struct {
- autorest.Response `json:"-"`
- *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo.
-func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if rusi.RollingUpgradeStatusInfoProperties != nil {
- objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties
- }
- if rusi.Location != nil {
- objectMap["location"] = rusi.Location
- }
- if rusi.Tags != nil {
- objectMap["tags"] = rusi.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct.
-func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties
- err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties)
- if err != nil {
- return err
- }
- rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- rusi.ID = &ID
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- rusi.Name = &name
- }
- case "type":
- if v != nil {
- var typeVar string
- err = json.Unmarshal(*v, &typeVar)
- if err != nil {
- return err
- }
- rusi.Type = &typeVar
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- rusi.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- rusi.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade.
-type RollingUpgradeStatusInfoProperties struct {
- // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade.
- Policy *RollingUpgradePolicy `json:"policy,omitempty"`
- // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade.
- RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"`
- // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state.
- Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"`
- // Error - READ-ONLY; Error details for this upgrade, if there are any.
- Error *APIError `json:"error,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties.
-func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// RunCommandDocument describes the properties of a Run Command.
-type RunCommandDocument struct {
- autorest.Response `json:"-"`
- // Script - The script to be executed.
- Script *[]string `json:"script,omitempty"`
- // Parameters - The parameters used by the script.
- Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"`
- // Schema - The VM run command schema.
- Schema *string `json:"$schema,omitempty"`
- // ID - The VM run command id.
- ID *string `json:"id,omitempty"`
- // OsType - The Operating System type. Possible values include: 'Windows', 'Linux'
- OsType OperatingSystemTypes `json:"osType,omitempty"`
- // Label - The VM run command label.
- Label *string `json:"label,omitempty"`
- // Description - The VM run command description.
- Description *string `json:"description,omitempty"`
-}
-
-// RunCommandDocumentBase describes the properties of a Run Command metadata.
-type RunCommandDocumentBase struct {
- // Schema - The VM run command schema.
- Schema *string `json:"$schema,omitempty"`
- // ID - The VM run command id.
- ID *string `json:"id,omitempty"`
- // OsType - The Operating System type. Possible values include: 'Windows', 'Linux'
- OsType OperatingSystemTypes `json:"osType,omitempty"`
- // Label - The VM run command label.
- Label *string `json:"label,omitempty"`
- // Description - The VM run command description.
- Description *string `json:"description,omitempty"`
-}
-
-// RunCommandInput capture Virtual Machine parameters.
-type RunCommandInput struct {
- // CommandID - The run command id.
- CommandID *string `json:"commandId,omitempty"`
- // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command.
- Script *[]string `json:"script,omitempty"`
- // Parameters - The run command parameters.
- Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"`
-}
-
-// RunCommandInputParameter describes the properties of a run command parameter.
-type RunCommandInputParameter struct {
- // Name - The run command parameter name.
- Name *string `json:"name,omitempty"`
- // Value - The run command parameter value.
- Value *string `json:"value,omitempty"`
-}
-
-// RunCommandListResult the List Virtual Machine operation response.
-type RunCommandListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of virtual machine run commands.
- Value *[]RunCommandDocumentBase `json:"value,omitempty"`
- // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values.
-type RunCommandListResultIterator struct {
- i int
- page RunCommandListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *RunCommandListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter RunCommandListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter RunCommandListResultIterator) Response() RunCommandListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase {
- if !iter.page.NotDone() {
- return RunCommandDocumentBase{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the RunCommandListResultIterator type.
-func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator {
- return RunCommandListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (rclr RunCommandListResult) IsEmpty() bool {
- return rclr.Value == nil || len(*rclr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (rclr RunCommandListResult) hasNextLink() bool {
- return rclr.NextLink != nil && len(*rclr.NextLink) != 0
-}
-
-// runCommandListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !rclr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(rclr.NextLink)))
-}
-
-// RunCommandListResultPage contains a page of RunCommandDocumentBase values.
-type RunCommandListResultPage struct {
- fn func(context.Context, RunCommandListResult) (RunCommandListResult, error)
- rclr RunCommandListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.rclr)
- if err != nil {
- return err
- }
- page.rclr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *RunCommandListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page RunCommandListResultPage) NotDone() bool {
- return !page.rclr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page RunCommandListResultPage) Response() RunCommandListResult {
- return page.rclr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page RunCommandListResultPage) Values() []RunCommandDocumentBase {
- if page.rclr.IsEmpty() {
- return nil
- }
- return *page.rclr.Value
-}
-
-// Creates a new instance of the RunCommandListResultPage type.
-func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage {
- return RunCommandListResultPage{
- fn: getNextPage,
- rclr: cur,
- }
-}
-
-// RunCommandParameterDefinition describes the properties of a run command parameter.
-type RunCommandParameterDefinition struct {
- // Name - The run command parameter name.
- Name *string `json:"name,omitempty"`
- // Type - The run command parameter type.
- Type *string `json:"type,omitempty"`
- // DefaultValue - The run command parameter default value.
- DefaultValue *string `json:"defaultValue,omitempty"`
- // Required - The run command parameter required.
- Required *bool `json:"required,omitempty"`
-}
-
-// RunCommandResult run command operation response.
-type RunCommandResult struct {
- autorest.Response `json:"-"`
- *RunCommandResultProperties `json:"properties,omitempty"`
- // Name - READ-ONLY; Operation ID
- Name *string `json:"name,omitempty"`
- // Status - READ-ONLY; Operation status
- Status *string `json:"status,omitempty"`
- // StartTime - READ-ONLY; Start time of the operation
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - READ-ONLY; End time of the operation
- EndTime *date.Time `json:"endTime,omitempty"`
- // Error - READ-ONLY; Api error
- Error *APIError `json:"error,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for RunCommandResult.
-func (rcr RunCommandResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if rcr.RunCommandResultProperties != nil {
- objectMap["properties"] = rcr.RunCommandResultProperties
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for RunCommandResult struct.
-func (rcr *RunCommandResult) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var runCommandResultProperties RunCommandResultProperties
- err = json.Unmarshal(*v, &runCommandResultProperties)
- if err != nil {
- return err
- }
- rcr.RunCommandResultProperties = &runCommandResultProperties
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- rcr.Name = &name
- }
- case "status":
- if v != nil {
- var status string
- err = json.Unmarshal(*v, &status)
- if err != nil {
- return err
- }
- rcr.Status = &status
- }
- case "startTime":
- if v != nil {
- var startTime date.Time
- err = json.Unmarshal(*v, &startTime)
- if err != nil {
- return err
- }
- rcr.StartTime = &startTime
- }
- case "endTime":
- if v != nil {
- var endTime date.Time
- err = json.Unmarshal(*v, &endTime)
- if err != nil {
- return err
- }
- rcr.EndTime = &endTime
- }
- case "error":
- if v != nil {
- var errorVar APIError
- err = json.Unmarshal(*v, &errorVar)
- if err != nil {
- return err
- }
- rcr.Error = &errorVar
- }
- }
- }
-
- return nil
-}
-
-// RunCommandResultProperties compute-specific operation properties, including output
-type RunCommandResultProperties struct {
- // Output - Operation output data (raw JSON)
- Output interface{} `json:"output,omitempty"`
-}
-
-// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware
-// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU
-// name.
-type Sku struct {
- // Name - The sku name.
- Name *string `json:"name,omitempty"`
- // Tier - Specifies the tier of virtual machines in a scale set.
Possible Values:
**Standard**
**Basic**
- Tier *string `json:"tier,omitempty"`
- // Capacity - Specifies the number of virtual machines in the scale set.
- Capacity *int64 `json:"capacity,omitempty"`
-}
-
-// Snapshot snapshot resource.
-type Snapshot struct {
- autorest.Response `json:"-"`
- // ManagedBy - READ-ONLY; Unused. Always Null.
- ManagedBy *string `json:"managedBy,omitempty"`
- Sku *DiskSku `json:"sku,omitempty"`
- *DiskProperties `json:"properties,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for Snapshot.
-func (s Snapshot) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if s.Sku != nil {
- objectMap["sku"] = s.Sku
- }
- if s.DiskProperties != nil {
- objectMap["properties"] = s.DiskProperties
- }
- if s.Location != nil {
- objectMap["location"] = s.Location
- }
- if s.Tags != nil {
- objectMap["tags"] = s.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for Snapshot struct.
-func (s *Snapshot) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "managedBy":
- if v != nil {
- var managedBy string
- err = json.Unmarshal(*v, &managedBy)
- if err != nil {
- return err
- }
- s.ManagedBy = &managedBy
- }
- case "sku":
- if v != nil {
- var sku DiskSku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- s.Sku = &sku
- }
- case "properties":
- if v != nil {
- var diskProperties DiskProperties
- err = json.Unmarshal(*v, &diskProperties)
- if err != nil {
- return err
- }
- s.DiskProperties = &diskProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- s.ID = &ID
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- s.Name = &name
- }
- case "type":
- if v != nil {
- var typeVar string
- err = json.Unmarshal(*v, &typeVar)
- if err != nil {
- return err
- }
- s.Type = &typeVar
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- s.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- s.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// SnapshotList the List Snapshots operation response.
-type SnapshotList struct {
- autorest.Response `json:"-"`
- // Value - A list of snapshots.
- Value *[]Snapshot `json:"value,omitempty"`
- // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// SnapshotListIterator provides access to a complete listing of Snapshot values.
-type SnapshotListIterator struct {
- i int
- page SnapshotListPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *SnapshotListIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter SnapshotListIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter SnapshotListIterator) Response() SnapshotList {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter SnapshotListIterator) Value() Snapshot {
- if !iter.page.NotDone() {
- return Snapshot{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the SnapshotListIterator type.
-func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator {
- return SnapshotListIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (sl SnapshotList) IsEmpty() bool {
- return sl.Value == nil || len(*sl.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (sl SnapshotList) hasNextLink() bool {
- return sl.NextLink != nil && len(*sl.NextLink) != 0
-}
-
-// snapshotListPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) {
- if !sl.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(sl.NextLink)))
-}
-
-// SnapshotListPage contains a page of Snapshot values.
-type SnapshotListPage struct {
- fn func(context.Context, SnapshotList) (SnapshotList, error)
- sl SnapshotList
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.sl)
- if err != nil {
- return err
- }
- page.sl = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *SnapshotListPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page SnapshotListPage) NotDone() bool {
- return !page.sl.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page SnapshotListPage) Response() SnapshotList {
- return page.sl
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page SnapshotListPage) Values() []Snapshot {
- if page.sl.IsEmpty() {
- return nil
- }
- return *page.sl.Value
-}
-
-// Creates a new instance of the SnapshotListPage type.
-func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage {
- return SnapshotListPage{
- fn: getNextPage,
- sl: cur,
- }
-}
-
-// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type SnapshotsCreateOrUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(SnapshotsClient) (Snapshot, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result.
-func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- s.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
- s, err = client.CreateOrUpdateResponder(s.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type SnapshotsDeleteFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(SnapshotsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for SnapshotsDeleteFuture.Result.
-func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeleteResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type SnapshotsGrantAccessFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(SnapshotsClient) (AccessURI, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for SnapshotsGrantAccessFuture.Result.
-func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- au.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent {
- au, err = client.GrantAccessResponder(au.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type SnapshotsRevokeAccessFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(SnapshotsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for SnapshotsRevokeAccessFuture.Result.
-func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.RevokeAccessResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type SnapshotsUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(SnapshotsClient) (Snapshot, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for SnapshotsUpdateFuture.Result.
-func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- s.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
- s, err = client.UpdateResponder(s.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// SnapshotUpdate snapshot update resource.
-type SnapshotUpdate struct {
- *DiskUpdateProperties `json:"properties,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
- Sku *DiskSku `json:"sku,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for SnapshotUpdate.
-func (su SnapshotUpdate) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if su.DiskUpdateProperties != nil {
- objectMap["properties"] = su.DiskUpdateProperties
- }
- if su.Tags != nil {
- objectMap["tags"] = su.Tags
- }
- if su.Sku != nil {
- objectMap["sku"] = su.Sku
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct.
-func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var diskUpdateProperties DiskUpdateProperties
- err = json.Unmarshal(*v, &diskUpdateProperties)
- if err != nil {
- return err
- }
- su.DiskUpdateProperties = &diskUpdateProperties
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- su.Tags = tags
- }
- case "sku":
- if v != nil {
- var sku DiskSku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- su.Sku = &sku
- }
- }
- }
-
- return nil
-}
-
-// SourceVault the vault id is an Azure Resource Manager Resource id in the form
-// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}
-type SourceVault struct {
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// SSHConfiguration SSH configuration for Linux based VMs running on Azure
-type SSHConfiguration struct {
- // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs.
- PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"`
-}
-
-// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where
-// the public key is placed.
-type SSHPublicKey struct {
- // Path - Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys
- Path *string `json:"path,omitempty"`
- // KeyData - SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format.
For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
- KeyData *string `json:"keyData,omitempty"`
-}
-
-// StorageProfile specifies the storage settings for the virtual machine disks.
-type StorageProfile struct {
- // ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations.
- ImageReference *ImageReference `json:"imageReference,omitempty"`
- // OsDisk - Specifies information about the operating system disk used by the virtual machine.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- OsDisk *OSDisk `json:"osDisk,omitempty"`
- // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- DataDisks *[]DataDisk `json:"dataDisks,omitempty"`
-}
-
-// SubResource ...
-type SubResource struct {
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// SubResourceReadOnly ...
-type SubResourceReadOnly struct {
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for SubResourceReadOnly.
-func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api.
-type ThrottledRequestsInput struct {
- // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to.
- BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"`
- // FromTime - From time of the query
- FromTime *date.Time `json:"fromTime,omitempty"`
- // ToTime - To time of the query
- ToTime *date.Time `json:"toTime,omitempty"`
- // GroupByThrottlePolicy - Group query result by Throttle Policy applied.
- GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"`
- // GroupByOperationName - Group query result by Operation Name.
- GroupByOperationName *bool `json:"groupByOperationName,omitempty"`
- // GroupByResourceName - Group query result by Resource Name.
- GroupByResourceName *bool `json:"groupByResourceName,omitempty"`
-}
-
-// UpdateResource the Update Resource model definition.
-type UpdateResource struct {
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for UpdateResource.
-func (ur UpdateResource) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if ur.Tags != nil {
- objectMap["tags"] = ur.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response.
-type UpgradeOperationHistoricalStatusInfo struct {
- // Properties - READ-ONLY; Information about the properties of the upgrade operation.
- Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - READ-ONLY; Resource location
- Location *string `json:"location,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo.
-func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale
-// Set.
-type UpgradeOperationHistoricalStatusInfoProperties struct {
- // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation.
- RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"`
- // Progress - READ-ONLY; Counts of the VMs in each state.
- Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"`
- // Error - READ-ONLY; Error Details for this upgrade if there are any.
- Error *APIError `json:"error,omitempty"`
- // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'Unknown', 'User', 'Platform'
- StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"`
- // TargetImageReference - READ-ONLY; Image Reference details
- TargetImageReference *ImageReference `json:"targetImageReference,omitempty"`
- // RollbackInfo - READ-ONLY; Information about OS rollback if performed
- RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties.
-func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade.
-type UpgradeOperationHistoryStatus struct {
- // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted'
- Code UpgradeState `json:"code,omitempty"`
- // StartTime - READ-ONLY; Start time of the upgrade.
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - READ-ONLY; End time of the upgrade.
- EndTime *date.Time `json:"endTime,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus.
-func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling.
-type UpgradePolicy struct {
- // Mode - Specifies the mode of an upgrade to virtual machines in the scale set.
Possible values are:
**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.
**Automatic** - All virtual machines in the scale set are automatically updated at the same time. Possible values include: 'Automatic', 'Manual', 'Rolling'
- Mode UpgradeMode `json:"mode,omitempty"`
- // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade.
- RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"`
- // AutomaticOSUpgrade - Whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the image becomes available.
- AutomaticOSUpgrade *bool `json:"automaticOSUpgrade,omitempty"`
- // AutoOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade.
- AutoOSUpgradePolicy *AutoOSUpgradePolicy `json:"autoOSUpgradePolicy,omitempty"`
-}
-
-// Usage describes Compute Resource Usage.
-type Usage struct {
- // Unit - An enum describing the unit of usage measurement.
- Unit *string `json:"unit,omitempty"`
- // CurrentValue - The current usage of the resource.
- CurrentValue *int32 `json:"currentValue,omitempty"`
- // Limit - The maximum permitted usage of the resource.
- Limit *int64 `json:"limit,omitempty"`
- // Name - The name of the type of usage.
- Name *UsageName `json:"name,omitempty"`
-}
-
-// UsageName the Usage Names.
-type UsageName struct {
- // Value - The name of the resource.
- Value *string `json:"value,omitempty"`
- // LocalizedValue - The localized name of the resource.
- LocalizedValue *string `json:"localizedValue,omitempty"`
-}
-
-// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate
-// should reside on the VM.
-type VaultCertificate struct {
- // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:
{
"data":"",
"dataType":"pfx",
"password":""
}
- CertificateURL *string `json:"certificateUrl,omitempty"`
- // CertificateStore - For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account.
For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted.
- CertificateStore *string `json:"certificateStore,omitempty"`
-}
-
-// VaultSecretGroup describes a set of certificates which are all in the same Key Vault.
-type VaultSecretGroup struct {
- // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates.
- SourceVault *SubResource `json:"sourceVault,omitempty"`
- // VaultCertificates - The list of key vault references in SourceVault which contain certificates.
- VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"`
-}
-
-// VirtualHardDisk describes the uri of a disk.
-type VirtualHardDisk struct {
- // URI - Specifies the virtual hard disk's uri.
- URI *string `json:"uri,omitempty"`
-}
-
-// VirtualMachine describes a Virtual Machine.
-type VirtualMachine struct {
- autorest.Response `json:"-"`
- // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
- Plan *Plan `json:"plan,omitempty"`
- *VirtualMachineProperties `json:"properties,omitempty"`
- // Resources - READ-ONLY; The virtual machine child extension resources.
- Resources *[]VirtualMachineExtension `json:"resources,omitempty"`
- // Identity - The identity of the virtual machine, if configured.
- Identity *VirtualMachineIdentity `json:"identity,omitempty"`
- // Zones - The virtual machine zones.
- Zones *[]string `json:"zones,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachine.
-func (VM VirtualMachine) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if VM.Plan != nil {
- objectMap["plan"] = VM.Plan
- }
- if VM.VirtualMachineProperties != nil {
- objectMap["properties"] = VM.VirtualMachineProperties
- }
- if VM.Identity != nil {
- objectMap["identity"] = VM.Identity
- }
- if VM.Zones != nil {
- objectMap["zones"] = VM.Zones
- }
- if VM.Location != nil {
- objectMap["location"] = VM.Location
- }
- if VM.Tags != nil {
- objectMap["tags"] = VM.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct.
-func (VM *VirtualMachine) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "plan":
- if v != nil {
- var plan Plan
- err = json.Unmarshal(*v, &plan)
- if err != nil {
- return err
- }
- VM.Plan = &plan
- }
- case "properties":
- if v != nil {
- var virtualMachineProperties VirtualMachineProperties
- err = json.Unmarshal(*v, &virtualMachineProperties)
- if err != nil {
- return err
- }
- VM.VirtualMachineProperties = &virtualMachineProperties
- }
- case "resources":
- if v != nil {
- var resources []VirtualMachineExtension
- err = json.Unmarshal(*v, &resources)
- if err != nil {
- return err
- }
- VM.Resources = &resources
- }
- case "identity":
- if v != nil {
- var identity VirtualMachineIdentity
- err = json.Unmarshal(*v, &identity)
- if err != nil {
- return err
- }
- VM.Identity = &identity
- }
- case "zones":
- if v != nil {
- var zones []string
- err = json.Unmarshal(*v, &zones)
- if err != nil {
- return err
- }
- VM.Zones = &zones
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- VM.ID = &ID
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- VM.Name = &name
- }
- case "type":
- if v != nil {
- var typeVar string
- err = json.Unmarshal(*v, &typeVar)
- if err != nil {
- return err
- }
- VM.Type = &typeVar
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- VM.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- VM.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine.
-type VirtualMachineAgentInstanceView struct {
- // VMAgentVersion - The VM Agent full version.
- VMAgentVersion *string `json:"vmAgentVersion,omitempty"`
- // ExtensionHandlers - The virtual machine extension handler instance view.
- ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"`
- // Statuses - The resource status information.
- Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
-}
-
-// VirtualMachineCaptureParameters capture Virtual Machine parameters.
-type VirtualMachineCaptureParameters struct {
- // VhdPrefix - The captured virtual hard disk's name prefix.
- VhdPrefix *string `json:"vhdPrefix,omitempty"`
- // DestinationContainerName - The destination container name.
- DestinationContainerName *string `json:"destinationContainerName,omitempty"`
- // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict.
- OverwriteVhds *bool `json:"overwriteVhds,omitempty"`
-}
-
-// VirtualMachineCaptureResult resource Id.
-type VirtualMachineCaptureResult struct {
- autorest.Response `json:"-"`
- *VirtualMachineCaptureResultProperties `json:"properties,omitempty"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult.
-func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmcr.VirtualMachineCaptureResultProperties != nil {
- objectMap["properties"] = vmcr.VirtualMachineCaptureResultProperties
- }
- if vmcr.ID != nil {
- objectMap["id"] = vmcr.ID
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineCaptureResult struct.
-func (vmcr *VirtualMachineCaptureResult) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var virtualMachineCaptureResultProperties VirtualMachineCaptureResultProperties
- err = json.Unmarshal(*v, &virtualMachineCaptureResultProperties)
- if err != nil {
- return err
- }
- vmcr.VirtualMachineCaptureResultProperties = &virtualMachineCaptureResultProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- vmcr.ID = &ID
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineCaptureResultProperties compute-specific operation properties, including output
-type VirtualMachineCaptureResultProperties struct {
- // Output - Operation output data (raw JSON)
- Output interface{} `json:"output,omitempty"`
-}
-
-// VirtualMachineExtension describes a Virtual Machine Extension.
-type VirtualMachineExtension struct {
- autorest.Response `json:"-"`
- *VirtualMachineExtensionProperties `json:"properties,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineExtension.
-func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vme.VirtualMachineExtensionProperties != nil {
- objectMap["properties"] = vme.VirtualMachineExtensionProperties
- }
- if vme.Location != nil {
- objectMap["location"] = vme.Location
- }
- if vme.Tags != nil {
- objectMap["tags"] = vme.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct.
-func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var virtualMachineExtensionProperties VirtualMachineExtensionProperties
- err = json.Unmarshal(*v, &virtualMachineExtensionProperties)
- if err != nil {
- return err
- }
- vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- vme.ID = &ID
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vme.Name = &name
- }
- case "type":
- if v != nil {
- var typeVar string
- err = json.Unmarshal(*v, &typeVar)
- if err != nil {
- return err
- }
- vme.Type = &typeVar
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- vme.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- vme.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler.
-type VirtualMachineExtensionHandlerInstanceView struct {
- // Type - Specifies the type of the extension; an example is "CustomScriptExtension".
- Type *string `json:"type,omitempty"`
- // TypeHandlerVersion - Specifies the version of the script handler.
- TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"`
- // Status - The extension handler status.
- Status *InstanceViewStatus `json:"status,omitempty"`
-}
-
-// VirtualMachineExtensionImage describes a Virtual Machine Extension Image.
-type VirtualMachineExtensionImage struct {
- autorest.Response `json:"-"`
- *VirtualMachineExtensionImageProperties `json:"properties,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage.
-func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmei.VirtualMachineExtensionImageProperties != nil {
- objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties
- }
- if vmei.Location != nil {
- objectMap["location"] = vmei.Location
- }
- if vmei.Tags != nil {
- objectMap["tags"] = vmei.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct.
-func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties
- err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties)
- if err != nil {
- return err
- }
- vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- vmei.ID = &ID
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vmei.Name = &name
- }
- case "type":
- if v != nil {
- var typeVar string
- err = json.Unmarshal(*v, &typeVar)
- if err != nil {
- return err
- }
- vmei.Type = &typeVar
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- vmei.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- vmei.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image.
-type VirtualMachineExtensionImageProperties struct {
- // OperatingSystem - The operating system this extension supports.
- OperatingSystem *string `json:"operatingSystem,omitempty"`
- // ComputeRole - The type of role (IaaS or PaaS) this extension supports.
- ComputeRole *string `json:"computeRole,omitempty"`
- // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema.
- HandlerSchema *string `json:"handlerSchema,omitempty"`
- // VMScaleSetEnabled - Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the extension is only enabled for CRP VMs but not VMSS.
- VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"`
- // SupportsMultipleExtensions - Whether the handler can support multiple extensions.
- SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"`
-}
-
-// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension.
-type VirtualMachineExtensionInstanceView struct {
- // Name - The virtual machine extension name.
- Name *string `json:"name,omitempty"`
- // Type - Specifies the type of the extension; an example is "CustomScriptExtension".
- Type *string `json:"type,omitempty"`
- // TypeHandlerVersion - Specifies the version of the script handler.
- TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"`
- // Substatuses - The resource status information.
- Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"`
- // Statuses - The resource status information.
- Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
-}
-
-// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension.
-type VirtualMachineExtensionProperties struct {
- // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed.
- ForceUpdateTag *string `json:"forceUpdateTag,omitempty"`
- // Publisher - The name of the extension handler publisher.
- Publisher *string `json:"publisher,omitempty"`
- // Type - Specifies the type of the extension; an example is "CustomScriptExtension".
- Type *string `json:"type,omitempty"`
- // TypeHandlerVersion - Specifies the version of the script handler.
- TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"`
- // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.
- AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"`
- // Settings - Json formatted public settings for the extension.
- Settings interface{} `json:"settings,omitempty"`
- // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
- ProtectedSettings interface{} `json:"protectedSettings,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response.
- ProvisioningState *string `json:"provisioningState,omitempty"`
- // InstanceView - The virtual machine extension instance view.
- InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties.
-func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmep.ForceUpdateTag != nil {
- objectMap["forceUpdateTag"] = vmep.ForceUpdateTag
- }
- if vmep.Publisher != nil {
- objectMap["publisher"] = vmep.Publisher
- }
- if vmep.Type != nil {
- objectMap["type"] = vmep.Type
- }
- if vmep.TypeHandlerVersion != nil {
- objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion
- }
- if vmep.AutoUpgradeMinorVersion != nil {
- objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion
- }
- if vmep.Settings != nil {
- objectMap["settings"] = vmep.Settings
- }
- if vmep.ProtectedSettings != nil {
- objectMap["protectedSettings"] = vmep.ProtectedSettings
- }
- if vmep.InstanceView != nil {
- objectMap["instanceView"] = vmep.InstanceView
- }
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of
-// a long-running operation.
-type VirtualMachineExtensionsCreateOrUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result.
-func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- vme.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent {
- vme, err = client.CreateOrUpdateResponder(vme.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineExtensionsDeleteFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineExtensionsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result.
-func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeleteResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineExtensionsListResult the List Extension operation response
-type VirtualMachineExtensionsListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of extensions
- Value *[]VirtualMachineExtension `json:"value,omitempty"`
-}
-
-// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineExtensionsUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result.
-func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- vme.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent {
- vme, err = client.UpdateResponder(vme.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineExtensionUpdate describes a Virtual Machine Extension.
-type VirtualMachineExtensionUpdate struct {
- *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate.
-func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmeu.VirtualMachineExtensionUpdateProperties != nil {
- objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties
- }
- if vmeu.Tags != nil {
- objectMap["tags"] = vmeu.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct.
-func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties
- err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties)
- if err != nil {
- return err
- }
- vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- vmeu.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension.
-type VirtualMachineExtensionUpdateProperties struct {
- // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed.
- ForceUpdateTag *string `json:"forceUpdateTag,omitempty"`
- // Publisher - The name of the extension handler publisher.
- Publisher *string `json:"publisher,omitempty"`
- // Type - Specifies the type of the extension; an example is "CustomScriptExtension".
- Type *string `json:"type,omitempty"`
- // TypeHandlerVersion - Specifies the version of the script handler.
- TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"`
- // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.
- AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"`
- // Settings - Json formatted public settings for the extension.
- Settings interface{} `json:"settings,omitempty"`
- // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
- ProtectedSettings interface{} `json:"protectedSettings,omitempty"`
-}
-
-// VirtualMachineHealthStatus the health status of the VM.
-type VirtualMachineHealthStatus struct {
- // Status - READ-ONLY; The health status information for the VM.
- Status *InstanceViewStatus `json:"status,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus.
-func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineIdentity identity for the virtual machine.
-type VirtualMachineIdentity struct {
- // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity.
- PrincipalID *string `json:"principalId,omitempty"`
- // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity.
- TenantID *string `json:"tenantId,omitempty"`
- // Type - The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone'
- Type ResourceIdentityType `json:"type,omitempty"`
- // IdentityIds - The list of user identities associated with the Virtual Machine. The user identity references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
- IdentityIds *[]string `json:"identityIds,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineIdentity.
-func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmi.Type != "" {
- objectMap["type"] = vmi.Type
- }
- if vmi.IdentityIds != nil {
- objectMap["identityIds"] = vmi.IdentityIds
- }
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineImage describes a Virtual Machine Image.
-type VirtualMachineImage struct {
- autorest.Response `json:"-"`
- *VirtualMachineImageProperties `json:"properties,omitempty"`
- // Name - The name of the resource.
- Name *string `json:"name,omitempty"`
- // Location - The supported Azure location of the resource.
- Location *string `json:"location,omitempty"`
- // Tags - Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md).
- Tags map[string]*string `json:"tags"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineImage.
-func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmi.VirtualMachineImageProperties != nil {
- objectMap["properties"] = vmi.VirtualMachineImageProperties
- }
- if vmi.Name != nil {
- objectMap["name"] = vmi.Name
- }
- if vmi.Location != nil {
- objectMap["location"] = vmi.Location
- }
- if vmi.Tags != nil {
- objectMap["tags"] = vmi.Tags
- }
- if vmi.ID != nil {
- objectMap["id"] = vmi.ID
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct.
-func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "properties":
- if v != nil {
- var virtualMachineImageProperties VirtualMachineImageProperties
- err = json.Unmarshal(*v, &virtualMachineImageProperties)
- if err != nil {
- return err
- }
- vmi.VirtualMachineImageProperties = &virtualMachineImageProperties
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vmi.Name = &name
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- vmi.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- vmi.Tags = tags
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- vmi.ID = &ID
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineImageProperties describes the properties of a Virtual Machine Image.
-type VirtualMachineImageProperties struct {
- Plan *PurchasePlan `json:"plan,omitempty"`
- OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"`
- DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"`
-}
-
-// VirtualMachineImageResource virtual machine image resource information.
-type VirtualMachineImageResource struct {
- // Name - The name of the resource.
- Name *string `json:"name,omitempty"`
- // Location - The supported Azure location of the resource.
- Location *string `json:"location,omitempty"`
- // Tags - Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md).
- Tags map[string]*string `json:"tags"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineImageResource.
-func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmir.Name != nil {
- objectMap["name"] = vmir.Name
- }
- if vmir.Location != nil {
- objectMap["location"] = vmir.Location
- }
- if vmir.Tags != nil {
- objectMap["tags"] = vmir.Tags
- }
- if vmir.ID != nil {
- objectMap["id"] = vmir.ID
- }
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineInstanceView the instance view of a virtual machine.
-type VirtualMachineInstanceView struct {
- autorest.Response `json:"-"`
- // PlatformUpdateDomain - Specifies the update domain of the virtual machine.
- PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"`
- // PlatformFaultDomain - Specifies the fault domain of the virtual machine.
- PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"`
- // ComputerName - The computer name assigned to the virtual machine.
- ComputerName *string `json:"computerName,omitempty"`
- // OsName - The Operating System running on the virtual machine.
- OsName *string `json:"osName,omitempty"`
- // OsVersion - The version of Operating System running on the virtual machine.
- OsVersion *string `json:"osVersion,omitempty"`
- // RdpThumbPrint - The Remote desktop certificate thumbprint.
- RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"`
- // VMAgent - The VM Agent running on the virtual machine.
- VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"`
- // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine.
- MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"`
- // Disks - The virtual machine disk information.
- Disks *[]DiskInstanceView `json:"disks,omitempty"`
- // Extensions - The extensions information.
- Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"`
- // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.
You can easily view the output of your console log.
Azure also enables you to see a screenshot of the VM from the hypervisor.
- BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"`
- // Statuses - The resource status information.
- Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
-}
-
-// VirtualMachineListResult the List Virtual Machine operation response.
-type VirtualMachineListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of virtual machines.
- Value *[]VirtualMachine `json:"value,omitempty"`
- // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values.
-type VirtualMachineListResultIterator struct {
- i int
- page VirtualMachineListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *VirtualMachineListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter VirtualMachineListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter VirtualMachineListResultIterator) Value() VirtualMachine {
- if !iter.page.NotDone() {
- return VirtualMachine{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the VirtualMachineListResultIterator type.
-func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator {
- return VirtualMachineListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (vmlr VirtualMachineListResult) IsEmpty() bool {
- return vmlr.Value == nil || len(*vmlr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (vmlr VirtualMachineListResult) hasNextLink() bool {
- return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0
-}
-
-// virtualMachineListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !vmlr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(vmlr.NextLink)))
-}
-
-// VirtualMachineListResultPage contains a page of VirtualMachine values.
-type VirtualMachineListResultPage struct {
- fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)
- vmlr VirtualMachineListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.vmlr)
- if err != nil {
- return err
- }
- page.vmlr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *VirtualMachineListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page VirtualMachineListResultPage) NotDone() bool {
- return !page.vmlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page VirtualMachineListResultPage) Response() VirtualMachineListResult {
- return page.vmlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page VirtualMachineListResultPage) Values() []VirtualMachine {
- if page.vmlr.IsEmpty() {
- return nil
- }
- return *page.vmlr.Value
-}
-
-// Creates a new instance of the VirtualMachineListResultPage type.
-func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage {
- return VirtualMachineListResultPage{
- fn: getNextPage,
- vmlr: cur,
- }
-}
-
-// VirtualMachineProperties describes the properties of a Virtual Machine.
-type VirtualMachineProperties struct {
- // HardwareProfile - Specifies the hardware settings for the virtual machine.
- HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"`
- // StorageProfile - Specifies the storage settings for the virtual machine disks.
- StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
- // OsProfile - Specifies the operating system settings for the virtual machine.
- OsProfile *OSProfile `json:"osProfile,omitempty"`
- // NetworkProfile - Specifies the network interfaces of the virtual machine.
- NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"`
- // DiagnosticsProfile - Specifies the boot diagnostic settings state.
Minimum api-version: 2015-06-15.
- DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"`
- // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set.
- AvailabilitySet *SubResource `json:"availabilitySet,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response.
- ProvisioningState *string `json:"provisioningState,omitempty"`
- // InstanceView - READ-ONLY; The virtual machine instance view.
- InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"`
- // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.
Possible values are:
Windows_Client
Windows_Server
If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.
For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
Minimum api-version: 2015-06-15
- LicenseType *string `json:"licenseType,omitempty"`
- // VMID - READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands.
- VMID *string `json:"vmId,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineProperties.
-func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmp.HardwareProfile != nil {
- objectMap["hardwareProfile"] = vmp.HardwareProfile
- }
- if vmp.StorageProfile != nil {
- objectMap["storageProfile"] = vmp.StorageProfile
- }
- if vmp.OsProfile != nil {
- objectMap["osProfile"] = vmp.OsProfile
- }
- if vmp.NetworkProfile != nil {
- objectMap["networkProfile"] = vmp.NetworkProfile
- }
- if vmp.DiagnosticsProfile != nil {
- objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile
- }
- if vmp.AvailabilitySet != nil {
- objectMap["availabilitySet"] = vmp.AvailabilitySet
- }
- if vmp.LicenseType != nil {
- objectMap["licenseType"] = vmp.LicenseType
- }
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineScaleSet describes a Virtual Machine Scale Set.
-type VirtualMachineScaleSet struct {
- autorest.Response `json:"-"`
- // Sku - The virtual machine scale set sku.
- Sku *Sku `json:"sku,omitempty"`
- // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
- Plan *Plan `json:"plan,omitempty"`
- *VirtualMachineScaleSetProperties `json:"properties,omitempty"`
- // Identity - The identity of the virtual machine scale set, if configured.
- Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"`
- // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set.
- Zones *[]string `json:"zones,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSet.
-func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmss.Sku != nil {
- objectMap["sku"] = vmss.Sku
- }
- if vmss.Plan != nil {
- objectMap["plan"] = vmss.Plan
- }
- if vmss.VirtualMachineScaleSetProperties != nil {
- objectMap["properties"] = vmss.VirtualMachineScaleSetProperties
- }
- if vmss.Identity != nil {
- objectMap["identity"] = vmss.Identity
- }
- if vmss.Zones != nil {
- objectMap["zones"] = vmss.Zones
- }
- if vmss.Location != nil {
- objectMap["location"] = vmss.Location
- }
- if vmss.Tags != nil {
- objectMap["tags"] = vmss.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct.
-func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "sku":
- if v != nil {
- var sku Sku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- vmss.Sku = &sku
- }
- case "plan":
- if v != nil {
- var plan Plan
- err = json.Unmarshal(*v, &plan)
- if err != nil {
- return err
- }
- vmss.Plan = &plan
- }
- case "properties":
- if v != nil {
- var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties
- err = json.Unmarshal(*v, &virtualMachineScaleSetProperties)
- if err != nil {
- return err
- }
- vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties
- }
- case "identity":
- if v != nil {
- var identity VirtualMachineScaleSetIdentity
- err = json.Unmarshal(*v, &identity)
- if err != nil {
- return err
- }
- vmss.Identity = &identity
- }
- case "zones":
- if v != nil {
- var zones []string
- err = json.Unmarshal(*v, &zones)
- if err != nil {
- return err
- }
- vmss.Zones = &zones
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- vmss.ID = &ID
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vmss.Name = &name
- }
- case "type":
- if v != nil {
- var typeVar string
- err = json.Unmarshal(*v, &typeVar)
- if err != nil {
- return err
- }
- vmss.Type = &typeVar
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- vmss.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- vmss.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk.
-type VirtualMachineScaleSetDataDisk struct {
- // Name - The disk name.
- Name *string `json:"name,omitempty"`
- // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
- Lun *int32 `json:"lun,omitempty"`
- // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite'
- Caching CachingTypes `json:"caching,omitempty"`
- // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk.
- WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"`
- // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach'
- CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
- // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
- DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
- // ManagedDisk - The managed disk parameters.
- ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"`
-}
-
-// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension.
-type VirtualMachineScaleSetExtension struct {
- autorest.Response `json:"-"`
- // Name - The name of the extension.
- Name *string `json:"name,omitempty"`
- *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension.
-func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmsse.Name != nil {
- objectMap["name"] = vmsse.Name
- }
- if vmsse.VirtualMachineScaleSetExtensionProperties != nil {
- objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct.
-func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vmsse.Name = &name
- }
- case "properties":
- if v != nil {
- var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties
- err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties)
- if err != nil {
- return err
- }
- vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- vmsse.ID = &ID
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response.
-type VirtualMachineScaleSetExtensionListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of VM scale set extensions.
- Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"`
- // NextLink - The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale set extensions.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of
-// VirtualMachineScaleSetExtension values.
-type VirtualMachineScaleSetExtensionListResultIterator struct {
- i int
- page VirtualMachineScaleSetExtensionListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension {
- if !iter.page.NotDone() {
- return VirtualMachineScaleSetExtension{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type.
-func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator {
- return VirtualMachineScaleSetExtensionListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool {
- return vmsselr.Value == nil || len(*vmsselr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool {
- return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0
-}
-
-// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !vmsselr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(vmsselr.NextLink)))
-}
-
-// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values.
-type VirtualMachineScaleSetExtensionListResultPage struct {
- fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)
- vmsselr VirtualMachineScaleSetExtensionListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.vmsselr)
- if err != nil {
- return err
- }
- page.vmsselr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool {
- return !page.vmsselr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult {
- return page.vmsselr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension {
- if page.vmsselr.IsEmpty() {
- return nil
- }
- return *page.vmsselr.Value
-}
-
-// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type.
-func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage {
- return VirtualMachineScaleSetExtensionListResultPage{
- fn: getNextPage,
- vmsselr: cur,
- }
-}
-
-// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile.
-type VirtualMachineScaleSetExtensionProfile struct {
- // Extensions - The virtual machine scale set child extension resources.
- Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"`
-}
-
-// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set
-// Extension.
-type VirtualMachineScaleSetExtensionProperties struct {
- // ForceUpdateTag - If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed.
- ForceUpdateTag *string `json:"forceUpdateTag,omitempty"`
- // Publisher - The name of the extension handler publisher.
- Publisher *string `json:"publisher,omitempty"`
- // Type - Specifies the type of the extension; an example is "CustomScriptExtension".
- Type *string `json:"type,omitempty"`
- // TypeHandlerVersion - Specifies the version of the script handler.
- TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"`
- // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.
- AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"`
- // Settings - Json formatted public settings for the extension.
- Settings interface{} `json:"settings,omitempty"`
- // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
- ProtectedSettings interface{} `json:"protectedSettings,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response.
- ProvisioningState *string `json:"provisioningState,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties.
-func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssep.ForceUpdateTag != nil {
- objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag
- }
- if vmssep.Publisher != nil {
- objectMap["publisher"] = vmssep.Publisher
- }
- if vmssep.Type != nil {
- objectMap["type"] = vmssep.Type
- }
- if vmssep.TypeHandlerVersion != nil {
- objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion
- }
- if vmssep.AutoUpgradeMinorVersion != nil {
- objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion
- }
- if vmssep.Settings != nil {
- objectMap["settings"] = vmssep.Settings
- }
- if vmssep.ProtectedSettings != nil {
- objectMap["protectedSettings"] = vmssep.ProtectedSettings
- }
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
-// results of a long-running operation.
-type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result.
-func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- vmsse.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent {
- vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of
-// a long-running operation.
-type VirtualMachineScaleSetExtensionsDeleteFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetExtensionsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result.
-func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeleteResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetIdentity identity for the virtual machine scale set.
-type VirtualMachineScaleSetIdentity struct {
- // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity.
- PrincipalID *string `json:"principalId,omitempty"`
- // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity.
- TenantID *string `json:"tenantId,omitempty"`
- // Type - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone'
- Type ResourceIdentityType `json:"type,omitempty"`
- // IdentityIds - The list of user identities associated with the virtual machine scale set. The user identity references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/identities/{identityName}'.
- IdentityIds *[]string `json:"identityIds,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity.
-func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssi.Type != "" {
- objectMap["type"] = vmssi.Type
- }
- if vmssi.IdentityIds != nil {
- objectMap["identityIds"] = vmssi.IdentityIds
- }
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set.
-type VirtualMachineScaleSetInstanceView struct {
- autorest.Response `json:"-"`
- // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set.
- VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"`
- // Extensions - READ-ONLY; The extensions information.
- Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"`
- // Statuses - The resource status information.
- Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView.
-func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssiv.Statuses != nil {
- objectMap["statuses"] = vmssiv.Statuses
- }
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of
-// a virtual machine scale set.
-type VirtualMachineScaleSetInstanceViewStatusesSummary struct {
- // StatusesSummary - READ-ONLY; The extensions information.
- StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary.
-func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP
-// configuration.
-type VirtualMachineScaleSetIPConfiguration struct {
- // Name - The IP configuration name.
- Name *string `json:"name,omitempty"`
- *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration.
-func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssic.Name != nil {
- objectMap["name"] = vmssic.Name
- }
- if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil {
- objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties
- }
- if vmssic.ID != nil {
- objectMap["id"] = vmssic.ID
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct.
-func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vmssic.Name = &name
- }
- case "properties":
- if v != nil {
- var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties
- err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties)
- if err != nil {
- return err
- }
- vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- vmssic.ID = &ID
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's
-// IP configuration properties.
-type VirtualMachineScaleSetIPConfigurationProperties struct {
- // Subnet - Specifies the identifier of the subnet.
- Subnet *APIEntityReference `json:"subnet,omitempty"`
- // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface.
- Primary *bool `json:"primary,omitempty"`
- // PublicIPAddressConfiguration - The publicIPAddressConfiguration.
- PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"`
- // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'
- PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"`
- // ApplicationGatewayBackendAddressPools - Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway.
- ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"`
- // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer.
- LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"`
- // LoadBalancerInboundNatPools - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer
- LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"`
-}
-
-// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History
-// operation response.
-type VirtualMachineScaleSetListOSUpgradeHistory struct {
- autorest.Response `json:"-"`
- // Value - The list of OS upgrades performed on the virtual machine scale set.
- Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"`
- // NextLink - The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of
-// UpgradeOperationHistoricalStatusInfo values.
-type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct {
- i int
- page VirtualMachineScaleSetListOSUpgradeHistoryPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo {
- if !iter.page.NotDone() {
- return UpgradeOperationHistoricalStatusInfo{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type.
-func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator {
- return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool {
- return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool {
- return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0
-}
-
-// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) {
- if !vmsslouh.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(vmsslouh.NextLink)))
-}
-
-// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo
-// values.
-type VirtualMachineScaleSetListOSUpgradeHistoryPage struct {
- fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)
- vmsslouh VirtualMachineScaleSetListOSUpgradeHistory
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.vmsslouh)
- if err != nil {
- return err
- }
- page.vmsslouh = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool {
- return !page.vmsslouh.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory {
- return page.vmsslouh
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo {
- if page.vmsslouh.IsEmpty() {
- return nil
- }
- return *page.vmsslouh.Value
-}
-
-// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type.
-func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage {
- return VirtualMachineScaleSetListOSUpgradeHistoryPage{
- fn: getNextPage,
- vmsslouh: cur,
- }
-}
-
-// VirtualMachineScaleSetListResult the List Virtual Machine operation response.
-type VirtualMachineScaleSetListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of virtual machine scale sets.
- Value *[]VirtualMachineScaleSet `json:"value,omitempty"`
- // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet
-// values.
-type VirtualMachineScaleSetListResultIterator struct {
- i int
- page VirtualMachineScaleSetListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *VirtualMachineScaleSetListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet {
- if !iter.page.NotDone() {
- return VirtualMachineScaleSet{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the VirtualMachineScaleSetListResultIterator type.
-func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator {
- return VirtualMachineScaleSetListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool {
- return vmsslr.Value == nil || len(*vmsslr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool {
- return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0
-}
-
-// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !vmsslr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(vmsslr.NextLink)))
-}
-
-// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values.
-type VirtualMachineScaleSetListResultPage struct {
- fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)
- vmsslr VirtualMachineScaleSetListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.vmsslr)
- if err != nil {
- return err
- }
- page.vmsslr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *VirtualMachineScaleSetListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page VirtualMachineScaleSetListResultPage) NotDone() bool {
- return !page.vmsslr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult {
- return page.vmsslr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet {
- if page.vmsslr.IsEmpty() {
- return nil
- }
- return *page.vmsslr.Value
-}
-
-// Creates a new instance of the VirtualMachineScaleSetListResultPage type.
-func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage {
- return VirtualMachineScaleSetListResultPage{
- fn: getNextPage,
- vmsslr: cur,
- }
-}
-
-// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response.
-type VirtualMachineScaleSetListSkusResult struct {
- autorest.Response `json:"-"`
- // Value - The list of skus available for the virtual machine scale set.
- Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"`
- // NextLink - The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS Skus.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of
-// VirtualMachineScaleSetSku values.
-type VirtualMachineScaleSetListSkusResultIterator struct {
- i int
- page VirtualMachineScaleSetListSkusResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku {
- if !iter.page.NotDone() {
- return VirtualMachineScaleSetSku{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type.
-func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator {
- return VirtualMachineScaleSetListSkusResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool {
- return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool {
- return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0
-}
-
-// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) {
- if !vmsslsr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(vmsslsr.NextLink)))
-}
-
-// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values.
-type VirtualMachineScaleSetListSkusResultPage struct {
- fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)
- vmsslsr VirtualMachineScaleSetListSkusResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.vmsslsr)
- if err != nil {
- return err
- }
- page.vmsslsr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *VirtualMachineScaleSetListSkusResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool {
- return !page.vmsslsr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult {
- return page.vmsslsr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku {
- if page.vmsslsr.IsEmpty() {
- return nil
- }
- return *page.vmsslsr.Value
-}
-
-// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type.
-func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage {
- return VirtualMachineScaleSetListSkusResultPage{
- fn: getNextPage,
- vmsslsr: cur,
- }
-}
-
-// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response.
-type VirtualMachineScaleSetListWithLinkResult struct {
- autorest.Response `json:"-"`
- // Value - The list of virtual machine scale sets.
- Value *[]VirtualMachineScaleSet `json:"value,omitempty"`
- // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual Machine Scale Sets.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of
-// VirtualMachineScaleSet values.
-type VirtualMachineScaleSetListWithLinkResultIterator struct {
- i int
- page VirtualMachineScaleSetListWithLinkResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet {
- if !iter.page.NotDone() {
- return VirtualMachineScaleSet{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type.
-func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator {
- return VirtualMachineScaleSetListWithLinkResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool {
- return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool {
- return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0
-}
-
-// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) {
- if !vmsslwlr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(vmsslwlr.NextLink)))
-}
-
-// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values.
-type VirtualMachineScaleSetListWithLinkResultPage struct {
- fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)
- vmsslwlr VirtualMachineScaleSetListWithLinkResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.vmsslwlr)
- if err != nil {
- return err
- }
- page.vmsslwlr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool {
- return !page.vmsslwlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult {
- return page.vmsslwlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet {
- if page.vmsslwlr.IsEmpty() {
- return nil
- }
- return *page.vmsslwlr.Value
-}
-
-// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type.
-func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage {
- return VirtualMachineScaleSetListWithLinkResultPage{
- fn: getNextPage,
- vmsslwlr: cur,
- }
-}
-
-// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk.
-type VirtualMachineScaleSetManagedDiskParameters struct {
- // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS'
- StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"`
-}
-
-// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's
-// network configurations.
-type VirtualMachineScaleSetNetworkConfiguration struct {
- // Name - The network configuration name.
- Name *string `json:"name,omitempty"`
- *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration.
-func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssnc.Name != nil {
- objectMap["name"] = vmssnc.Name
- }
- if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil {
- objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties
- }
- if vmssnc.ID != nil {
- objectMap["id"] = vmssnc.ID
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct.
-func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vmssnc.Name = &name
- }
- case "properties":
- if v != nil {
- var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties
- err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties)
- if err != nil {
- return err
- }
- vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- vmssnc.ID = &ID
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network
-// configuration's DNS settings.
-type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct {
- // DNSServers - List of DNS servers IP addresses
- DNSServers *[]string `json:"dnsServers,omitempty"`
-}
-
-// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network
-// profile's IP configuration.
-type VirtualMachineScaleSetNetworkConfigurationProperties struct {
- // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface.
- Primary *bool `json:"primary,omitempty"`
- // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled.
- EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"`
- // NetworkSecurityGroup - The network security group.
- NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"`
- // DNSSettings - The dns settings to be applied on the network interfaces.
- DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"`
- // IPConfigurations - Specifies the IP configurations of the network interface.
- IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"`
- // EnableIPForwarding - Whether IP forwarding enabled on this NIC.
- EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"`
-}
-
-// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile.
-type VirtualMachineScaleSetNetworkProfile struct {
- // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'.
- HealthProbe *APIEntityReference `json:"healthProbe,omitempty"`
- // NetworkInterfaceConfigurations - The list of network configurations.
- NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"`
-}
-
-// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk.
-type VirtualMachineScaleSetOSDisk struct {
- // Name - The disk name.
- Name *string `json:"name,omitempty"`
- // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite'
- Caching CachingTypes `json:"caching,omitempty"`
- // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk.
- WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"`
- // CreateOption - Specifies how the virtual machines in the scale set should be created.
The only allowed value is: **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach'
- CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
- // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.
Possible values are:
**Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
- OsType OperatingSystemTypes `json:"osType,omitempty"`
- // Image - Specifies information about the unmanaged user image to base the scale set on.
- Image *VirtualHardDisk `json:"image,omitempty"`
- // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set.
- VhdContainers *[]string `json:"vhdContainers,omitempty"`
- // ManagedDisk - The managed disk parameters.
- ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"`
-}
-
-// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile.
-type VirtualMachineScaleSetOSProfile struct {
- // ComputerNamePrefix - Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long.
- ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"`
- // AdminUsername - Specifies the name of the administrator account.
**Windows-only restriction:** Cannot end in "."
**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".
**Minimum-length (Linux):** 1 character
**Max-length (Linux):** 64 characters
**Max-length (Windows):** 20 characters
- For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- AdminUsername *string `json:"adminUsername,omitempty"`
- // AdminPassword - Specifies the password of the administrator account.
**Minimum-length (Windows):** 8 characters
**Minimum-length (Linux):** 6 characters
**Max-length (Windows):** 123 characters
**Max-length (Linux):** 72 characters
**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\W_])
**Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"
For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password)
- AdminPassword *string `json:"adminPassword,omitempty"`
- // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.
For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
- CustomData *string `json:"customData,omitempty"`
- // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine.
- WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"`
- // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine.
For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
- LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"`
- // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set.
- Secrets *[]VaultSecretGroup `json:"secrets,omitempty"`
-}
-
-// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set.
-type VirtualMachineScaleSetProperties struct {
- // UpgradePolicy - The upgrade policy.
- UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"`
- // VirtualMachineProfile - The virtual machine profile.
- VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response.
- ProvisioningState *string `json:"provisioningState,omitempty"`
- // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned.
- Overprovision *bool `json:"overprovision,omitempty"`
- // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set.
- UniqueID *string `json:"uniqueId,omitempty"`
- // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines.
- SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"`
- // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage.
- ZoneBalance *bool `json:"zoneBalance,omitempty"`
- // PlatformFaultDomainCount - Fault Domain count for each placement group.
- PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties.
-func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssp.UpgradePolicy != nil {
- objectMap["upgradePolicy"] = vmssp.UpgradePolicy
- }
- if vmssp.VirtualMachineProfile != nil {
- objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile
- }
- if vmssp.Overprovision != nil {
- objectMap["overprovision"] = vmssp.Overprovision
- }
- if vmssp.SinglePlacementGroup != nil {
- objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup
- }
- if vmssp.ZoneBalance != nil {
- objectMap["zoneBalance"] = vmssp.ZoneBalance
- }
- if vmssp.PlatformFaultDomainCount != nil {
- objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount
- }
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP
-// Configuration's PublicIPAddress configuration
-type VirtualMachineScaleSetPublicIPAddressConfiguration struct {
- // Name - The publicIP address configuration name.
- Name *string `json:"name,omitempty"`
- *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration.
-func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmsspiac.Name != nil {
- objectMap["name"] = vmsspiac.Name
- }
- if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil {
- objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct.
-func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vmsspiac.Name = &name
- }
- case "properties":
- if v != nil {
- var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties
- err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties)
- if err != nil {
- return err
- }
- vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets
-// network configuration's DNS settings.
-type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct {
- // DomainNameLabel - The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created
- DomainNameLabel *string `json:"domainNameLabel,omitempty"`
-}
-
-// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP
-// Configuration's PublicIPAddress configuration
-type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct {
- // IdleTimeoutInMinutes - The idle timeout of the public IP address.
- IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
- // DNSSettings - The dns settings to be applied on the publicIP addresses .
- DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"`
-}
-
-// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the
-// results of a long-running operation.
-type VirtualMachineScaleSetRollingUpgradesCancelFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetRollingUpgradesClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result.
-func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.CancelResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving
-// the results of a long-running operation.
-type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetRollingUpgradesClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result.
-func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.StartOSUpgradeResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of
-// a long-running operation.
-type VirtualMachineScaleSetsCreateOrUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result.
-func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- vmss.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent {
- vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetsDeallocateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result.
-func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeallocateResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetsDeleteFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result.
-func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeleteResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of
-// a long-running operation.
-type VirtualMachineScaleSetsDeleteInstancesFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result.
-func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeleteInstancesResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetSku describes an available virtual machine scale set sku.
-type VirtualMachineScaleSetSku struct {
- // ResourceType - READ-ONLY; The type of resource the sku applies to.
- ResourceType *string `json:"resourceType,omitempty"`
- // Sku - READ-ONLY; The Sku.
- Sku *Sku `json:"sku,omitempty"`
- // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set.
- Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku.
-func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku.
-type VirtualMachineScaleSetSkuCapacity struct {
- // Minimum - READ-ONLY; The minimum capacity.
- Minimum *int64 `json:"minimum,omitempty"`
- // Maximum - READ-ONLY; The maximum capacity that can be set.
- Maximum *int64 `json:"maximum,omitempty"`
- // DefaultCapacity - READ-ONLY; The default capacity.
- DefaultCapacity *int64 `json:"defaultCapacity,omitempty"`
- // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone'
- ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity.
-func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results
-// of a long-running operation.
-type VirtualMachineScaleSetsPerformMaintenanceFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result.
-func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.PerformMaintenanceResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetsPowerOffFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result.
-func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.PowerOffResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetsRedeployFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result.
-func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.RedeployResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetsReimageAllFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result.
-func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.ReimageAllResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetsReimageFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result.
-func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.ReimageResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetsRestartFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result.
-func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.RestartResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetsStartFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result.
-func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.StartResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile.
-type VirtualMachineScaleSetStorageProfile struct {
- // ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations.
- ImageReference *ImageReference `json:"imageReference,omitempty"`
- // OsDisk - Specifies information about the operating system disk used by the virtual machines in the scale set.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"`
- // DataDisks - Specifies the parameters that are used to add data disks to the virtual machines in the scale set.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"`
-}
-
-// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetsUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result.
-func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- vmss.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent {
- vmss, err = client.UpdateResponder(vmss.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of
-// a long-running operation.
-type VirtualMachineScaleSetsUpdateInstancesFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result.
-func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.UpdateInstancesResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set.
-type VirtualMachineScaleSetUpdate struct {
- // Sku - The virtual machine scale set sku.
- Sku *Sku `json:"sku,omitempty"`
- // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images.
- Plan *Plan `json:"plan,omitempty"`
- *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"`
- // Identity - The identity of the virtual machine scale set, if configured.
- Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate.
-func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssu.Sku != nil {
- objectMap["sku"] = vmssu.Sku
- }
- if vmssu.Plan != nil {
- objectMap["plan"] = vmssu.Plan
- }
- if vmssu.VirtualMachineScaleSetUpdateProperties != nil {
- objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties
- }
- if vmssu.Identity != nil {
- objectMap["identity"] = vmssu.Identity
- }
- if vmssu.Tags != nil {
- objectMap["tags"] = vmssu.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct.
-func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "sku":
- if v != nil {
- var sku Sku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- vmssu.Sku = &sku
- }
- case "plan":
- if v != nil {
- var plan Plan
- err = json.Unmarshal(*v, &plan)
- if err != nil {
- return err
- }
- vmssu.Plan = &plan
- }
- case "properties":
- if v != nil {
- var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties
- err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties)
- if err != nil {
- return err
- }
- vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties
- }
- case "identity":
- if v != nil {
- var identity VirtualMachineScaleSetIdentity
- err = json.Unmarshal(*v, &identity)
- if err != nil {
- return err
- }
- vmssu.Identity = &identity
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- vmssu.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP
-// configuration.
-type VirtualMachineScaleSetUpdateIPConfiguration struct {
- // Name - The IP configuration name.
- Name *string `json:"name,omitempty"`
- *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration.
-func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssuic.Name != nil {
- objectMap["name"] = vmssuic.Name
- }
- if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil {
- objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties
- }
- if vmssuic.ID != nil {
- objectMap["id"] = vmssuic.ID
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct.
-func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vmssuic.Name = &name
- }
- case "properties":
- if v != nil {
- var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties
- err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties)
- if err != nil {
- return err
- }
- vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- vmssuic.ID = &ID
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network
-// profile's IP configuration properties. NOTE: The subnet of a scale set may be modified as long as the
-// original subnet and the new subnet are in the same virtual network.
-type VirtualMachineScaleSetUpdateIPConfigurationProperties struct {
- // Subnet - The subnet.
- Subnet *APIEntityReference `json:"subnet,omitempty"`
- // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration.
- Primary *bool `json:"primary,omitempty"`
- // PublicIPAddressConfiguration - The publicIPAddressConfiguration.
- PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"`
- // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'
- PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"`
- // ApplicationGatewayBackendAddressPools - The application gateway backend address pools.
- ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"`
- // LoadBalancerBackendAddressPools - The load balancer backend address pools.
- LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"`
- // LoadBalancerInboundNatPools - The load balancer inbound nat pools.
- LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"`
-}
-
-// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's
-// network configurations.
-type VirtualMachineScaleSetUpdateNetworkConfiguration struct {
- // Name - The network configuration name.
- Name *string `json:"name,omitempty"`
- *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration.
-func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssunc.Name != nil {
- objectMap["name"] = vmssunc.Name
- }
- if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil {
- objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties
- }
- if vmssunc.ID != nil {
- objectMap["id"] = vmssunc.ID
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct.
-func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vmssunc.Name = &name
- }
- case "properties":
- if v != nil {
- var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties
- err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties)
- if err != nil {
- return err
- }
- vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- vmssunc.ID = &ID
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set
-// updatable network profile's IP configuration.Use this object for updating network profile's IP
-// Configuration.
-type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct {
- // Primary - Whether this is a primary NIC on a virtual machine.
- Primary *bool `json:"primary,omitempty"`
- // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled.
- EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"`
- // NetworkSecurityGroup - The network security group.
- NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"`
- // DNSSettings - The dns settings to be applied on the network interfaces.
- DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"`
- // IPConfigurations - The virtual machine scale set IP Configuration.
- IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"`
- // EnableIPForwarding - Whether IP forwarding enabled on this NIC.
- EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"`
-}
-
-// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile.
-type VirtualMachineScaleSetUpdateNetworkProfile struct {
- // NetworkInterfaceConfigurations - The list of network configurations.
- NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"`
-}
-
-// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update
-// Object. This should be used for Updating VMSS OS Disk.
-type VirtualMachineScaleSetUpdateOSDisk struct {
- // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite'
- Caching CachingTypes `json:"caching,omitempty"`
- // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk.
- WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"`
- // Image - The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist.
- Image *VirtualHardDisk `json:"image,omitempty"`
- // VhdContainers - The list of virtual hard disk container uris.
- VhdContainers *[]string `json:"vhdContainers,omitempty"`
- // ManagedDisk - The managed disk parameters.
- ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"`
-}
-
-// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile.
-type VirtualMachineScaleSetUpdateOSProfile struct {
- // CustomData - A base-64 encoded string of custom data.
- CustomData *string `json:"customData,omitempty"`
- // WindowsConfiguration - The Windows Configuration of the OS profile.
- WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"`
- // LinuxConfiguration - The Linux Configuration of the OS profile.
- LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"`
- // Secrets - The List of certificates for addition to the VM.
- Secrets *[]VaultSecretGroup `json:"secrets,omitempty"`
-}
-
-// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set.
-type VirtualMachineScaleSetUpdateProperties struct {
- // UpgradePolicy - The upgrade policy.
- UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"`
- // VirtualMachineProfile - The virtual machine profile.
- VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"`
- // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned.
- Overprovision *bool `json:"overprovision,omitempty"`
- // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true.
- SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"`
-}
-
-// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP
-// Configuration's PublicIPAddress configuration
-type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct {
- // Name - The publicIP address configuration name.
- Name *string `json:"name,omitempty"`
- *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.
-func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssupiac.Name != nil {
- objectMap["name"] = vmssupiac.Name
- }
- if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil {
- objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct.
-func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vmssupiac.Name = &name
- }
- case "properties":
- if v != nil {
- var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties
- err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties)
- if err != nil {
- return err
- }
- vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale
-// set IP Configuration's PublicIPAddress configuration
-type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct {
- // IdleTimeoutInMinutes - The idle timeout of the public IP address.
- IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
- // DNSSettings - The dns settings to be applied on the publicIP addresses .
- DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"`
-}
-
-// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile.
-type VirtualMachineScaleSetUpdateStorageProfile struct {
- // ImageReference - The image reference.
- ImageReference *ImageReference `json:"imageReference,omitempty"`
- // OsDisk - The OS disk.
- OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"`
- // DataDisks - The data disks.
- DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"`
-}
-
-// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile.
-type VirtualMachineScaleSetUpdateVMProfile struct {
- // OsProfile - The virtual machine scale set OS profile.
- OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"`
- // StorageProfile - The virtual machine scale set storage profile.
- StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"`
- // NetworkProfile - The virtual machine scale set network profile.
- NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"`
- // DiagnosticsProfile - The virtual machine scale set diagnostics profile.
- DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"`
- // ExtensionProfile - The virtual machine scale set extension profile.
- ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"`
- // LicenseType - The license type, which is for bring your own license scenario.
- LicenseType *string `json:"licenseType,omitempty"`
-}
-
-// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine.
-type VirtualMachineScaleSetVM struct {
- autorest.Response `json:"-"`
- // InstanceID - READ-ONLY; The virtual machine instance ID.
- InstanceID *string `json:"instanceId,omitempty"`
- // Sku - READ-ONLY; The virtual machine SKU.
- Sku *Sku `json:"sku,omitempty"`
- *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"`
- // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
- Plan *Plan `json:"plan,omitempty"`
- // Resources - READ-ONLY; The virtual machine child extension resources.
- Resources *[]VirtualMachineExtension `json:"resources,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM.
-func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssv.VirtualMachineScaleSetVMProperties != nil {
- objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties
- }
- if vmssv.Plan != nil {
- objectMap["plan"] = vmssv.Plan
- }
- if vmssv.Location != nil {
- objectMap["location"] = vmssv.Location
- }
- if vmssv.Tags != nil {
- objectMap["tags"] = vmssv.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct.
-func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "instanceId":
- if v != nil {
- var instanceID string
- err = json.Unmarshal(*v, &instanceID)
- if err != nil {
- return err
- }
- vmssv.InstanceID = &instanceID
- }
- case "sku":
- if v != nil {
- var sku Sku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- vmssv.Sku = &sku
- }
- case "properties":
- if v != nil {
- var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties
- err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties)
- if err != nil {
- return err
- }
- vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties
- }
- case "plan":
- if v != nil {
- var plan Plan
- err = json.Unmarshal(*v, &plan)
- if err != nil {
- return err
- }
- vmssv.Plan = &plan
- }
- case "resources":
- if v != nil {
- var resources []VirtualMachineExtension
- err = json.Unmarshal(*v, &resources)
- if err != nil {
- return err
- }
- vmssv.Resources = &resources
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- vmssv.ID = &ID
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- vmssv.Name = &name
- }
- case "type":
- if v != nil {
- var typeVar string
- err = json.Unmarshal(*v, &typeVar)
- if err != nil {
- return err
- }
- vmssv.Type = &typeVar
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- vmssv.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- vmssv.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine
-// scale set.
-type VirtualMachineScaleSetVMExtensionsSummary struct {
- // Name - READ-ONLY; The extension name.
- Name *string `json:"name,omitempty"`
- // StatusesSummary - READ-ONLY; The extensions information.
- StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary.
-func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale
-// set.
-type VirtualMachineScaleSetVMInstanceIDs struct {
- // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set.
- InstanceIds *[]string `json:"instanceIds,omitempty"`
-}
-
-// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM
-// scale set.
-type VirtualMachineScaleSetVMInstanceRequiredIDs struct {
- // InstanceIds - The virtual machine scale set instance ids.
- InstanceIds *[]string `json:"instanceIds,omitempty"`
-}
-
-// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM.
-type VirtualMachineScaleSetVMInstanceView struct {
- autorest.Response `json:"-"`
- // PlatformUpdateDomain - The Update Domain count.
- PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"`
- // PlatformFaultDomain - The Fault Domain count.
- PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"`
- // RdpThumbPrint - The Remote desktop certificate thumbprint.
- RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"`
- // VMAgent - The VM Agent running on the virtual machine.
- VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"`
- // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine.
- MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"`
- // Disks - The disks information.
- Disks *[]DiskInstanceView `json:"disks,omitempty"`
- // Extensions - The extensions information.
- Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"`
- // VMHealth - READ-ONLY; The health status for the VM.
- VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"`
- // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.
You can easily view the output of your console log.
Azure also enables you to see a screenshot of the VM from the hypervisor.
- BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"`
- // Statuses - The resource status information.
- Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
- // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId.
- PlacementGroupID *string `json:"placementGroupId,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView.
-func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssviv.PlatformUpdateDomain != nil {
- objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain
- }
- if vmssviv.PlatformFaultDomain != nil {
- objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain
- }
- if vmssviv.RdpThumbPrint != nil {
- objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint
- }
- if vmssviv.VMAgent != nil {
- objectMap["vmAgent"] = vmssviv.VMAgent
- }
- if vmssviv.MaintenanceRedeployStatus != nil {
- objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus
- }
- if vmssviv.Disks != nil {
- objectMap["disks"] = vmssviv.Disks
- }
- if vmssviv.Extensions != nil {
- objectMap["extensions"] = vmssviv.Extensions
- }
- if vmssviv.BootDiagnostics != nil {
- objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics
- }
- if vmssviv.Statuses != nil {
- objectMap["statuses"] = vmssviv.Statuses
- }
- if vmssviv.PlacementGroupID != nil {
- objectMap["placementGroupId"] = vmssviv.PlacementGroupID
- }
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response.
-type VirtualMachineScaleSetVMListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of virtual machine scale sets VMs.
- Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"`
- // NextLink - The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS VMs
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of
-// VirtualMachineScaleSetVM values.
-type VirtualMachineScaleSetVMListResultIterator struct {
- i int
- page VirtualMachineScaleSetVMListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM {
- if !iter.page.NotDone() {
- return VirtualMachineScaleSetVM{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type.
-func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator {
- return VirtualMachineScaleSetVMListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool {
- return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool {
- return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0
-}
-
-// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !vmssvlr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(vmssvlr.NextLink)))
-}
-
-// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values.
-type VirtualMachineScaleSetVMListResultPage struct {
- fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)
- vmssvlr VirtualMachineScaleSetVMListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.vmssvlr)
- if err != nil {
- return err
- }
- page.vmssvlr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *VirtualMachineScaleSetVMListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool {
- return !page.vmssvlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult {
- return page.vmssvlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM {
- if page.vmssvlr.IsEmpty() {
- return nil
- }
- return *page.vmssvlr.Value
-}
-
-// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type.
-func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage {
- return VirtualMachineScaleSetVMListResultPage{
- fn: getNextPage,
- vmssvlr: cur,
- }
-}
-
-// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile.
-type VirtualMachineScaleSetVMProfile struct {
- // OsProfile - Specifies the operating system settings for the virtual machines in the scale set.
- OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"`
- // StorageProfile - Specifies the storage settings for the virtual machine disks.
- StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"`
- // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set.
- NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"`
- // DiagnosticsProfile - Specifies the boot diagnostic settings state.
Minimum api-version: 2015-06-15.
- DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"`
- // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set.
- ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"`
- // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.
Possible values are:
Windows_Client
Windows_Server
If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.
For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
Minimum api-version: 2015-06-15
- LicenseType *string `json:"licenseType,omitempty"`
- // Priority - Specifies the priority for the virtual machines in the scale set.
Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low'
- Priority VirtualMachinePriorityTypes `json:"priority,omitempty"`
- // EvictionPolicy - Specifies the eviction policy for virtual machines in a low priority scale set.
Minimum api-version: 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete'
- EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"`
-}
-
-// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual
-// machine.
-type VirtualMachineScaleSetVMProperties struct {
- // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine.
- LatestModelApplied *bool `json:"latestModelApplied,omitempty"`
- // VMID - READ-ONLY; Azure VM unique ID.
- VMID *string `json:"vmId,omitempty"`
- // InstanceView - READ-ONLY; The virtual machine instance view.
- InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"`
- // HardwareProfile - Specifies the hardware settings for the virtual machine.
- HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"`
- // StorageProfile - Specifies the storage settings for the virtual machine disks.
- StorageProfile *StorageProfile `json:"storageProfile,omitempty"`
- // OsProfile - Specifies the operating system settings for the virtual machine.
- OsProfile *OSProfile `json:"osProfile,omitempty"`
- // NetworkProfile - Specifies the network interfaces of the virtual machine.
- NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"`
- // DiagnosticsProfile - Specifies the boot diagnostic settings state.
Minimum api-version: 2015-06-15.
- DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"`
- // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set.
- AvailabilitySet *SubResource `json:"availabilitySet,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response.
- ProvisioningState *string `json:"provisioningState,omitempty"`
- // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.
Possible values are:
Windows_Client
Windows_Server
If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.
For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
Minimum api-version: 2015-06-15
- LicenseType *string `json:"licenseType,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties.
-func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmssvp.HardwareProfile != nil {
- objectMap["hardwareProfile"] = vmssvp.HardwareProfile
- }
- if vmssvp.StorageProfile != nil {
- objectMap["storageProfile"] = vmssvp.StorageProfile
- }
- if vmssvp.OsProfile != nil {
- objectMap["osProfile"] = vmssvp.OsProfile
- }
- if vmssvp.NetworkProfile != nil {
- objectMap["networkProfile"] = vmssvp.NetworkProfile
- }
- if vmssvp.DiagnosticsProfile != nil {
- objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile
- }
- if vmssvp.AvailabilitySet != nil {
- objectMap["availabilitySet"] = vmssvp.AvailabilitySet
- }
- if vmssvp.LicenseType != nil {
- objectMap["licenseType"] = vmssvp.LicenseType
- }
- return json.Marshal(objectMap)
-}
-
-// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetVMsDeallocateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result.
-func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeallocateResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetVMsDeleteFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result.
-func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeleteResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the
-// results of a long-running operation.
-type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result.
-func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.PerformMaintenanceResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetVMsPowerOffFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result.
-func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.PowerOffResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetVMsRedeployFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result.
-func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.RedeployResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetVMsReimageAllFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result.
-func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.ReimageAllResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetVMsReimageFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result.
-func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.ReimageResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetVMsRestartFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result.
-func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.RestartResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetVMsStartFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetVMsClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result.
-func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.StartResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachineScaleSetVMsUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result.
-func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- vmssv.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent {
- vmssv, err = client.UpdateResponder(vmssv.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type VirtualMachinesCaptureFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesCaptureFuture.Result.
-func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- vmcr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent {
- vmcr, err = client.CaptureResponder(vmcr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachinesConvertToManagedDisksFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result.
-func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.ConvertToManagedDisksResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachinesCreateOrUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (VirtualMachine, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result.
-func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- VM.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent {
- VM, err = client.CreateOrUpdateResponder(VM.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachinesDeallocateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesDeallocateFuture.Result.
-func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeallocateResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type VirtualMachinesDeleteFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesDeleteFuture.Result.
-func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeleteResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineSize describes the properties of a VM size.
-type VirtualMachineSize struct {
- // Name - The name of the virtual machine size.
- Name *string `json:"name,omitempty"`
- // NumberOfCores - The number of cores supported by the virtual machine size.
- NumberOfCores *int32 `json:"numberOfCores,omitempty"`
- // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size.
- OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"`
- // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size.
- ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"`
- // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size.
- MemoryInMB *int32 `json:"memoryInMB,omitempty"`
- // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size.
- MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"`
-}
-
-// VirtualMachineSizeListResult the List Virtual Machine operation response.
-type VirtualMachineSizeListResult struct {
- autorest.Response `json:"-"`
- // Value - The list of virtual machine sizes.
- Value *[]VirtualMachineSize `json:"value,omitempty"`
-}
-
-// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachinesPerformMaintenanceFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result.
-func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.PerformMaintenanceResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type VirtualMachinesPowerOffFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesPowerOffFuture.Result.
-func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.PowerOffResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type VirtualMachinesRedeployFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesRedeployFuture.Result.
-func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.RedeployResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type VirtualMachinesRestartFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesRestartFuture.Result.
-func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.RestartResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type VirtualMachinesRunCommandFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (RunCommandResult, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesRunCommandFuture.Result.
-func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- rcr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent {
- rcr, err = client.RunCommandResponder(rcr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type VirtualMachinesStartFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (OperationStatusResponse, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesStartFuture.Result.
-func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (osr OperationStatusResponse, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- osr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.StartResponder(osr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", osr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view
-// status summary.
-type VirtualMachineStatusCodeCount struct {
- // Code - READ-ONLY; The instance view status code.
- Code *string `json:"code,omitempty"`
- // Count - READ-ONLY; The number of instances having a particular status code.
- Count *int32 `json:"count,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount.
-func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type VirtualMachinesUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(VirtualMachinesClient) (VirtualMachine, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for VirtualMachinesUpdateFuture.Result.
-func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- VM.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent {
- VM, err = client.UpdateResponder(VM.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// VirtualMachineUpdate describes a Virtual Machine Update.
-type VirtualMachineUpdate struct {
- // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
- Plan *Plan `json:"plan,omitempty"`
- *VirtualMachineProperties `json:"properties,omitempty"`
- // Identity - The identity of the virtual machine, if configured.
- Identity *VirtualMachineIdentity `json:"identity,omitempty"`
- // Zones - The virtual machine zones.
- Zones *[]string `json:"zones,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for VirtualMachineUpdate.
-func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if vmu.Plan != nil {
- objectMap["plan"] = vmu.Plan
- }
- if vmu.VirtualMachineProperties != nil {
- objectMap["properties"] = vmu.VirtualMachineProperties
- }
- if vmu.Identity != nil {
- objectMap["identity"] = vmu.Identity
- }
- if vmu.Zones != nil {
- objectMap["zones"] = vmu.Zones
- }
- if vmu.Tags != nil {
- objectMap["tags"] = vmu.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct.
-func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "plan":
- if v != nil {
- var plan Plan
- err = json.Unmarshal(*v, &plan)
- if err != nil {
- return err
- }
- vmu.Plan = &plan
- }
- case "properties":
- if v != nil {
- var virtualMachineProperties VirtualMachineProperties
- err = json.Unmarshal(*v, &virtualMachineProperties)
- if err != nil {
- return err
- }
- vmu.VirtualMachineProperties = &virtualMachineProperties
- }
- case "identity":
- if v != nil {
- var identity VirtualMachineIdentity
- err = json.Unmarshal(*v, &identity)
- if err != nil {
- return err
- }
- vmu.Identity = &identity
- }
- case "zones":
- if v != nil {
- var zones []string
- err = json.Unmarshal(*v, &zones)
- if err != nil {
- return err
- }
- vmu.Zones = &zones
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- vmu.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// WindowsConfiguration specifies Windows operating system settings on the virtual machine.
-type WindowsConfiguration struct {
- // ProvisionVMAgent - Indicates whether virtual machine agent should be provisioned on the virtual machine.
When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later.
- ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"`
- // EnableAutomaticUpdates - Indicates whether virtual machine is enabled for automatic updates.
- EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"`
- // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time"
- TimeZone *string `json:"timeZone,omitempty"`
- // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup.
- AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"`
- // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell.
- WinRM *WinRMConfiguration `json:"winRM,omitempty"`
-}
-
-// WinRMConfiguration describes Windows Remote Management configuration of the VM
-type WinRMConfiguration struct {
- // Listeners - The list of Windows Remote Management listeners
- Listeners *[]WinRMListener `json:"listeners,omitempty"`
-}
-
-// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener
-type WinRMListener struct {
- // Protocol - Specifies the protocol of listener.
Possible values are:
**http**
**https**. Possible values include: 'HTTP', 'HTTPS'
- Protocol ProtocolTypes `json:"protocol,omitempty"`
- // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:
{
"data":"",
"dataType":"pfx",
"password":""
}
- CertificateURL *string `json:"certificateUrl,omitempty"`
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/operations.go
deleted file mode 100644
index bce5752d8..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/operations.go
+++ /dev/null
@@ -1,98 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// OperationsClient is the compute Client
-type OperationsClient struct {
- BaseClient
-}
-
-// NewOperationsClient creates an instance of the OperationsClient client.
-func NewOperationsClient(subscriptionID string) OperationsClient {
- return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this
-// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
- return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// List gets a list of compute operations.
-func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/providers/Microsoft.Compute/operations"),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/resourceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/resourceskus.go
deleted file mode 100644
index f42e100fc..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/resourceskus.go
+++ /dev/null
@@ -1,144 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// ResourceSkusClient is the compute Client
-type ResourceSkusClient struct {
- BaseClient
-}
-
-// NewResourceSkusClient creates an instance of the ResourceSkusClient client.
-func NewResourceSkusClient(subscriptionID string) ResourceSkusClient {
- return NewResourceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewResourceSkusClientWithBaseURI creates an instance of the ResourceSkusClient client using a custom endpoint. Use
-// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient {
- return ResourceSkusClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// List gets the list of Microsoft.Compute SKUs available for your Subscription.
-func (client ResourceSkusClient) List(ctx context.Context) (result ResourceSkusResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List")
- defer func() {
- sc := -1
- if result.rsr.Response.Response != nil {
- sc = result.rsr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.rsr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure sending request")
- return
- }
-
- result.rsr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request")
- return
- }
- if result.rsr.hasNextLink() && result.rsr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ResourceSkusClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-09-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ResourceSkusClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client ResourceSkusClient) listNextResults(ctx context.Context, lastResults ResourceSkusResult) (result ResourceSkusResult, err error) {
- req, err := lastResults.resourceSkusResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ResourceSkusClient) ListComplete(ctx context.Context) (result ResourceSkusResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx)
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/snapshots.go
deleted file mode 100644
index c83583c73..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/snapshots.go
+++ /dev/null
@@ -1,775 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// SnapshotsClient is the compute Client
-type SnapshotsClient struct {
- BaseClient
-}
-
-// NewSnapshotsClient creates an instance of the SnapshotsClient client.
-func NewSnapshotsClient(subscriptionID string) SnapshotsClient {
- return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this
-// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient {
- return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdate creates or updates a snapshot.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
-// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
-// snapshot - snapshot object supplied in the body of the Put disk operation.
-func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (result SnapshotsCreateOrUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: snapshot,
- Constraints: []validation.Constraint{{Target: "snapshot.DiskProperties", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
- {Target: "snapshot.DiskProperties.EncryptionSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("compute.SnapshotsClient", "CreateOrUpdate", err.Error())
- }
-
- req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateOrUpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "snapshotName": autorest.Encode("path", snapshotName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- snapshot.ManagedBy = nil
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
- autorest.WithJSON(snapshot),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future SnapshotsCreateOrUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes a snapshot.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
-// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
-func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeletePreparer(ctx, resourceGroupName, snapshotName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "snapshotName": autorest.Encode("path", snapshotName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get gets information about a snapshot.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
-// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
-func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string) (result Snapshot, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, resourceGroupName, snapshotName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "snapshotName": autorest.Encode("path", snapshotName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GrantAccess grants access to a snapshot.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
-// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
-// grantAccessData - access data object supplied in the body of the get snapshot access operation.
-func (client SnapshotsClient) GrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (result SnapshotsGrantAccessFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.GrantAccess")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: grantAccessData,
- Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.SnapshotsClient", "GrantAccess", err.Error())
- }
-
- req, err := client.GrantAccessPreparer(ctx, resourceGroupName, snapshotName, grantAccessData)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", nil, "Failure preparing request")
- return
- }
-
- result, err = client.GrantAccessSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// GrantAccessPreparer prepares the GrantAccess request.
-func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "snapshotName": autorest.Encode("path", snapshotName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", pathParameters),
- autorest.WithJSON(grantAccessData),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GrantAccessSender sends the GrantAccess request. The method will close the
-// http.Response Body if it receives an error.
-func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future SnapshotsGrantAccessFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// GrantAccessResponder handles the response to the GrantAccess request. The method always
-// closes the http.Response Body.
-func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists snapshots under a subscription.
-func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List")
- defer func() {
- sc := -1
- if result.sl.Response.Response != nil {
- sc = result.sl.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.sl.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure sending request")
- return
- }
-
- result.sl, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request")
- return
- }
- if result.sl.hasNextLink() && result.sl.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client SnapshotsClient) listNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) {
- req, err := lastResults.snapshotListPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client SnapshotsClient) ListComplete(ctx context.Context) (result SnapshotListIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx)
- return
-}
-
-// ListByResourceGroup lists snapshots under a resource group.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SnapshotListPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup")
- defer func() {
- sc := -1
- if result.sl.Response.Response != nil {
- sc = result.sl.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listByResourceGroupNextResults
- req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.sl.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request")
- return
- }
-
- result.sl, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request")
- return
- }
- if result.sl.hasNextLink() && result.sl.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
-func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
-// http.Response Body if it receives an error.
-func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
-// closes the http.Response Body.
-func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listByResourceGroupNextResults retrieves the next set of results, if any.
-func (client SnapshotsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) {
- req, err := lastResults.snapshotListPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
-func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SnapshotListIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
- return
-}
-
-// RevokeAccess revokes access to a snapshot.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
-// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
-func (client SnapshotsClient) RevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsRevokeAccessFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.RevokeAccess")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, snapshotName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", nil, "Failure preparing request")
- return
- }
-
- result, err = client.RevokeAccessSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// RevokeAccessPreparer prepares the RevokeAccess request.
-func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "snapshotName": autorest.Encode("path", snapshotName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RevokeAccessSender sends the RevokeAccess request. The method will close the
-// http.Response Body if it receives an error.
-func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future SnapshotsRevokeAccessFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// RevokeAccessResponder handles the response to the RevokeAccess request. The method always
-// closes the http.Response Body.
-func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Update updates (patches) a snapshot.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
-// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
-// snapshot - snapshot object supplied in the body of the Patch snapshot operation.
-func (client SnapshotsClient) Update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (result SnapshotsUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.UpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", nil, "Failure preparing request")
- return
- }
-
- result, err = client.UpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "snapshotName": autorest.Encode("path", snapshotName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-03-30"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
- autorest.WithJSON(snapshot),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/usage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/usage.go
deleted file mode 100644
index fcea30ff0..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/usage.go
+++ /dev/null
@@ -1,155 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// UsageClient is the compute Client
-type UsageClient struct {
- BaseClient
-}
-
-// NewUsageClient creates an instance of the UsageClient client.
-func NewUsageClient(subscriptionID string) UsageClient {
- return NewUsageClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewUsageClientWithBaseURI creates an instance of the UsageClient client using a custom endpoint. Use this when
-// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient {
- return UsageClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// List gets, for the specified location, the current compute resource usage information as well as the limits for
-// compute resources under the subscription.
-// Parameters:
-// location - the location for which resource usage is queried.
-func (client UsageClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List")
- defer func() {
- sc := -1
- if result.lur.Response.Response != nil {
- sc = result.lur.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: location,
- Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.UsageClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, location)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.lur.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure sending request")
- return
- }
-
- result.lur, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request")
- return
- }
- if result.lur.hasNextLink() && result.lur.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client UsageClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client UsageClient) listNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) {
- req, err := lastResults.listUsagesResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client UsageClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx, location)
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/version.go
deleted file mode 100644
index b0c30dd7f..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/version.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package compute
-
-import "github.com/Azure/azure-sdk-for-go/version"
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return "Azure-SDK-For-Go/" + Version() + " compute/2017-12-01"
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return version.Number
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensionimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensionimages.go
deleted file mode 100644
index 8f2c40541..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensionimages.go
+++ /dev/null
@@ -1,270 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// VirtualMachineExtensionImagesClient is the compute Client
-type VirtualMachineExtensionImagesClient struct {
- BaseClient
-}
-
-// NewVirtualMachineExtensionImagesClient creates an instance of the VirtualMachineExtensionImagesClient client.
-func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient {
- return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the VirtualMachineExtensionImagesClient
-// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI
-// (sovereign clouds, Azure stack).
-func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient {
- return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets a virtual machine extension image.
-// Parameters:
-// location - the name of a supported Azure region.
-func (client VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, location, publisherName, typeParameter, version)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, typeParameter string, version string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "publisherName": autorest.Encode("path", publisherName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "type": autorest.Encode("path", typeParameter),
- "version": autorest.Encode("path", version),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineExtensionImagesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Response) (result VirtualMachineExtensionImage, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListTypes gets a list of virtual machine extension image types.
-// Parameters:
-// location - the name of a supported Azure region.
-func (client VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListTypes")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListTypesPreparer(ctx, location, publisherName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListTypesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListTypesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListTypesPreparer prepares the ListTypes request.
-func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "publisherName": autorest.Encode("path", publisherName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListTypesSender sends the ListTypes request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListTypesResponder handles the response to the ListTypes request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListVersions gets a list of virtual machine extension image versions.
-// Parameters:
-// location - the name of a supported Azure region.
-// filter - the filter to apply on the operation.
-func (client VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListVersions")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListVersionsPreparer(ctx, location, publisherName, typeParameter, filter, top, orderby)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListVersionsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListVersionsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListVersionsPreparer prepares the ListVersions request.
-func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "publisherName": autorest.Encode("path", publisherName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "type": autorest.Encode("path", typeParameter),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if top != nil {
- queryParameters["$top"] = autorest.Encode("query", *top)
- }
- if len(orderby) > 0 {
- queryParameters["$orderby"] = autorest.Encode("query", orderby)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListVersionsSender sends the ListVersions request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListVersionsResponder handles the response to the ListVersions request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensions.go
deleted file mode 100644
index 46513073f..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensions.go
+++ /dev/null
@@ -1,363 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// VirtualMachineExtensionsClient is the compute Client
-type VirtualMachineExtensionsClient struct {
- BaseClient
-}
-
-// NewVirtualMachineExtensionsClient creates an instance of the VirtualMachineExtensionsClient client.
-func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient {
- return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the VirtualMachineExtensionsClient client using
-// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign
-// clouds, Azure stack).
-func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient {
- return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdate the operation to create or update the extension.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine where the extension should be created or updated.
-// VMExtensionName - the name of the virtual machine extension.
-// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation.
-func (client VirtualMachineExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineExtensionsCreateOrUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateOrUpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmExtensionName": autorest.Encode("path", VMExtensionName),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
- autorest.WithJSON(extensionParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineExtensionsCreateOrUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete the operation to delete the extension.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine where the extension should be deleted.
-// VMExtensionName - the name of the virtual machine extension.
-func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (result VirtualMachineExtensionsDeleteFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Delete")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, VMExtensionName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmExtensionName": autorest.Encode("path", VMExtensionName),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineExtensionsDeleteFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get the operation to get the extension.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine containing the extension.
-// VMExtensionName - the name of the virtual machine extension.
-// expand - the expand expression to apply on the operation.
-func (client VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, resourceGroupName, VMName, VMExtensionName, expand)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client VirtualMachineExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmExtensionName": autorest.Encode("path", VMExtensionName),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Update the operation to update the extension.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine where the extension should be updated.
-// VMExtensionName - the name of the virtual machine extension.
-// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation.
-func (client VirtualMachineExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineExtensionsUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Update")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", nil, "Failure preparing request")
- return
- }
-
- result, err = client.UpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmExtensionName": autorest.Encode("path", VMExtensionName),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
- autorest.WithJSON(extensionParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineExtensionsUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineimages.go
deleted file mode 100644
index e1c4694fd..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineimages.go
+++ /dev/null
@@ -1,432 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// VirtualMachineImagesClient is the compute Client
-type VirtualMachineImagesClient struct {
- BaseClient
-}
-
-// NewVirtualMachineImagesClient creates an instance of the VirtualMachineImagesClient client.
-func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient {
- return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewVirtualMachineImagesClientWithBaseURI creates an instance of the VirtualMachineImagesClient client using a custom
-// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
-// stack).
-func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient {
- return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets a virtual machine image.
-// Parameters:
-// location - the name of a supported Azure region.
-// publisherName - a valid image publisher.
-// offer - a valid image publisher offer.
-// skus - a valid image SKU.
-// version - a valid image SKU version.
-func (client VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, location, publisherName, offer, skus, version)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "offer": autorest.Encode("path", offer),
- "publisherName": autorest.Encode("path", publisherName),
- "skus": autorest.Encode("path", skus),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "version": autorest.Encode("path", version),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU.
-// Parameters:
-// location - the name of a supported Azure region.
-// publisherName - a valid image publisher.
-// offer - a valid image publisher offer.
-// skus - a valid image SKU.
-// expand - the expand expression to apply on the operation.
-func (client VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.List")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListPreparer(ctx, location, publisherName, offer, skus, expand, top, orderby)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "offer": autorest.Encode("path", offer),
- "publisherName": autorest.Encode("path", publisherName),
- "skus": autorest.Encode("path", skus),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if top != nil {
- queryParameters["$top"] = autorest.Encode("query", *top)
- }
- if len(orderby) > 0 {
- queryParameters["$orderby"] = autorest.Encode("query", orderby)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListOffers gets a list of virtual machine image offers for the specified location and publisher.
-// Parameters:
-// location - the name of a supported Azure region.
-// publisherName - a valid image publisher.
-func (client VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string) (result ListVirtualMachineImageResource, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListOffers")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListOffersPreparer(ctx, location, publisherName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListOffersSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListOffersResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListOffersPreparer prepares the ListOffers request.
-func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "publisherName": autorest.Encode("path", publisherName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListOffersSender sends the ListOffers request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListOffersResponder handles the response to the ListOffers request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListPublishers gets a list of virtual machine image publishers for the specified Azure location.
-// Parameters:
-// location - the name of a supported Azure region.
-func (client VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string) (result ListVirtualMachineImageResource, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListPublishers")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListPublishersPreparer(ctx, location)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListPublishersSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListPublishersResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListPublishersPreparer prepares the ListPublishers request.
-func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Context, location string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListPublishersSender sends the ListPublishers request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListPublishersResponder handles the response to the ListPublishers request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer.
-// Parameters:
-// location - the name of a supported Azure region.
-// publisherName - a valid image publisher.
-// offer - a valid image publisher offer.
-func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListSkus")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListSkusPreparer(ctx, location, publisherName, offer)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSkusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListSkusPreparer prepares the ListSkus request.
-func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, location string, publisherName string, offer string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "offer": autorest.Encode("path", offer),
- "publisherName": autorest.Encode("path", publisherName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSkusSender sends the ListSkus request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListSkusResponder handles the response to the ListSkus request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineruncommands.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineruncommands.go
deleted file mode 100644
index f43d0b669..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineruncommands.go
+++ /dev/null
@@ -1,237 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// VirtualMachineRunCommandsClient is the compute Client
-type VirtualMachineRunCommandsClient struct {
- BaseClient
-}
-
-// NewVirtualMachineRunCommandsClient creates an instance of the VirtualMachineRunCommandsClient client.
-func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient {
- return NewVirtualMachineRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewVirtualMachineRunCommandsClientWithBaseURI creates an instance of the VirtualMachineRunCommandsClient client
-// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign
-// clouds, Azure stack).
-func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient {
- return VirtualMachineRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets specific run command for a subscription in a location.
-// Parameters:
-// location - the location upon which run commands is queried.
-// commandID - the command id.
-func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string) (result RunCommandDocument, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: location,
- Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "Get", err.Error())
- }
-
- req, err := client.GetPreparer(ctx, location, commandID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, location string, commandID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "commandId": autorest.Encode("path", commandID),
- "location": autorest.Encode("path", location),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all available run commands for a subscription in a location.
-// Parameters:
-// location - the location upon which run commands is queried.
-func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location string) (result RunCommandListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List")
- defer func() {
- sc := -1
- if result.rclr.Response.Response != nil {
- sc = result.rclr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: location,
- Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, location)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.rclr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure sending request")
- return
- }
-
- result.rclr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request")
- return
- }
- if result.rclr.hasNextLink() && result.rclr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client VirtualMachineRunCommandsClient) listNextResults(ctx context.Context, lastResults RunCommandListResult) (result RunCommandListResult, err error) {
- req, err := lastResults.runCommandListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client VirtualMachineRunCommandsClient) ListComplete(ctx context.Context, location string) (result RunCommandListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx, location)
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachines.go
deleted file mode 100644
index 7bc279175..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachines.go
+++ /dev/null
@@ -1,1773 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// VirtualMachinesClient is the compute Client
-type VirtualMachinesClient struct {
- BaseClient
-}
-
-// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient client.
-func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient {
- return NewVirtualMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewVirtualMachinesClientWithBaseURI creates an instance of the VirtualMachinesClient client using a custom endpoint.
-// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient {
- return VirtualMachinesClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Capture captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create
-// similar VMs.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-// parameters - parameters supplied to the Capture Virtual Machine operation.
-func (client VirtualMachinesClient) Capture(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (result VirtualMachinesCaptureFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Capture")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.VhdPrefix", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "parameters.DestinationContainerName", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "parameters.OverwriteVhds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.VirtualMachinesClient", "Capture", err.Error())
- }
-
- req, err := client.CapturePreparer(ctx, resourceGroupName, VMName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CaptureSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CapturePreparer prepares the Capture request.
-func (client VirtualMachinesClient) CapturePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CaptureSender sends the Capture request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future VirtualMachinesCaptureFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CaptureResponder handles the response to the Capture request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (result VirtualMachineCaptureResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ConvertToManagedDisks converts virtual machine disks from blob-based to managed disks. Virtual machine must be
-// stop-deallocated before invoking this operation.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-func (client VirtualMachinesClient) ConvertToManagedDisks(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesConvertToManagedDisksFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ConvertToManagedDisks")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ConvertToManagedDisksPreparer(ctx, resourceGroupName, VMName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", nil, "Failure preparing request")
- return
- }
-
- result, err = client.ConvertToManagedDisksSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// ConvertToManagedDisksPreparer prepares the ConvertToManagedDisks request.
-func (client VirtualMachinesClient) ConvertToManagedDisksPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ConvertToManagedDisksSender sends the ConvertToManagedDisks request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Request) (future VirtualMachinesConvertToManagedDisksFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// ConvertToManagedDisksResponder handles the response to the ConvertToManagedDisks request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateOrUpdate the operation to create or update a virtual machine.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-// parameters - parameters supplied to the Create Virtual Machine operation.
-func (client VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (result VirtualMachinesCreateOrUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineProperties", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("compute.VirtualMachinesClient", "CreateOrUpdate", err.Error())
- }
-
- req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateOrUpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- parameters.Resources = nil
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachinesCreateOrUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Deallocate shuts down the virtual machine and releases the compute resources. You are not billed for the compute
-// resources that this virtual machine uses.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-func (client VirtualMachinesClient) Deallocate(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesDeallocateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Deallocate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeallocateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeallocatePreparer prepares the Deallocate request.
-func (client VirtualMachinesClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeallocateSender sends the Deallocate request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future VirtualMachinesDeallocateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeallocateResponder handles the response to the Deallocate request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete the operation to delete a virtual machine.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesDeleteFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Delete")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeletePreparer(ctx, resourceGroupName, VMName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) DeleteSender(req *http.Request) (future VirtualMachinesDeleteFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Generalize sets the state of the virtual machine to generalized.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-func (client VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, VMName string) (result OperationStatusResponse, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Generalize")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GeneralizePreparer(ctx, resourceGroupName, VMName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GeneralizeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure sending request")
- return
- }
-
- result, err = client.GeneralizeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GeneralizePreparer prepares the Generalize request.
-func (client VirtualMachinesClient) GeneralizePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GeneralizeSender sends the Generalize request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) GeneralizeSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GeneralizeResponder handles the response to the Generalize request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get retrieves information about the model view or the instance view of a virtual machine.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-// expand - the expand expression to apply on the operation.
-func (client VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (result VirtualMachine, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, resourceGroupName, VMName, expand)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(string(expand)) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetExtensions the operation to get all extensions of a Virtual Machine.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine containing the extension.
-// expand - the expand expression to apply on the operation.
-func (client VirtualMachinesClient) GetExtensions(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineExtensionsListResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.GetExtensions")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetExtensionsPreparer(ctx, resourceGroupName, VMName, expand)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "GetExtensions", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetExtensionsSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "GetExtensions", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetExtensionsResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "GetExtensions", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetExtensionsPreparer prepares the GetExtensions request.
-func (client VirtualMachinesClient) GetExtensionsPreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetExtensionsSender sends the GetExtensions request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) GetExtensionsSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetExtensionsResponder handles the response to the GetExtensions request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) GetExtensionsResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// InstanceView retrieves information about the run-time state of a virtual machine.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-func (client VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineInstanceView, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.InstanceView")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.InstanceViewPreparer(ctx, resourceGroupName, VMName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.InstanceViewSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure sending request")
- return
- }
-
- result, err = client.InstanceViewResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// InstanceViewPreparer prepares the InstanceView request.
-func (client VirtualMachinesClient) InstanceViewPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// InstanceViewSender sends the InstanceView request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) InstanceViewSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// InstanceViewResponder handles the response to the InstanceView request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) InstanceViewResponder(resp *http.Response) (result VirtualMachineInstanceView, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to
-// get the next page of virtual machines.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List")
- defer func() {
- sc := -1
- if result.vmlr.Response.Response != nil {
- sc = result.vmlr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, resourceGroupName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.vmlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure sending request")
- return
- }
-
- result.vmlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to request")
- return
- }
- if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client VirtualMachinesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result VirtualMachineListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client VirtualMachinesClient) listNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) {
- req, err := lastResults.virtualMachineListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client VirtualMachinesClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualMachineListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx, resourceGroupName)
- return
-}
-
-// ListAll lists all of the virtual machines in the specified subscription. Use the nextLink property in the response
-// to get the next page of virtual machines.
-func (client VirtualMachinesClient) ListAll(ctx context.Context) (result VirtualMachineListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll")
- defer func() {
- sc := -1
- if result.vmlr.Response.Response != nil {
- sc = result.vmlr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listAllNextResults
- req, err := client.ListAllPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListAllSender(req)
- if err != nil {
- result.vmlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure sending request")
- return
- }
-
- result.vmlr, err = client.ListAllResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to request")
- return
- }
- if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListAllPreparer prepares the ListAll request.
-func (client VirtualMachinesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListAllSender sends the ListAll request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListAllResponder handles the response to the ListAll request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) ListAllResponder(resp *http.Response) (result VirtualMachineListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listAllNextResults retrieves the next set of results, if any.
-func (client VirtualMachinesClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) {
- req, err := lastResults.virtualMachineListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListAllSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListAllResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListAllComplete enumerates all values, automatically crossing page boundaries as required.
-func (client VirtualMachinesClient) ListAllComplete(ctx context.Context) (result VirtualMachineListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListAll(ctx)
- return
-}
-
-// ListAvailableSizes lists all available virtual machine sizes to which the specified virtual machine can be resized.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-func (client VirtualMachinesClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineSizeListResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAvailableSizes")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, VMName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListAvailableSizesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListAvailableSizesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListAvailableSizesPreparer prepares the ListAvailableSizes request.
-func (client VirtualMachinesClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListByLocation gets all the virtual machines under the specified subscription for the specified location.
-// Parameters:
-// location - the location for which virtual machines under the subscription are queried.
-func (client VirtualMachinesClient) ListByLocation(ctx context.Context, location string) (result VirtualMachineListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation")
- defer func() {
- sc := -1
- if result.vmlr.Response.Response != nil {
- sc = result.vmlr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: location,
- Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.VirtualMachinesClient", "ListByLocation", err.Error())
- }
-
- result.fn = client.listByLocationNextResults
- req, err := client.ListByLocationPreparer(ctx, location)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListByLocationSender(req)
- if err != nil {
- result.vmlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure sending request")
- return
- }
-
- result.vmlr, err = client.ListByLocationResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure responding to request")
- return
- }
- if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListByLocationPreparer prepares the ListByLocation request.
-func (client VirtualMachinesClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListByLocationSender sends the ListByLocation request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) ListByLocationSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListByLocationResponder handles the response to the ListByLocation request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listByLocationNextResults retrieves the next set of results, if any.
-func (client VirtualMachinesClient) listByLocationNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) {
- req, err := lastResults.virtualMachineListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListByLocationSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListByLocationResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required.
-func (client VirtualMachinesClient) ListByLocationComplete(ctx context.Context, location string) (result VirtualMachineListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListByLocation(ctx, location)
- return
-}
-
-// PerformMaintenance the operation to perform maintenance on a virtual machine.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-func (client VirtualMachinesClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesPerformMaintenanceFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PerformMaintenance")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", nil, "Failure preparing request")
- return
- }
-
- result, err = client.PerformMaintenanceSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// PerformMaintenancePreparer prepares the PerformMaintenance request.
-func (client VirtualMachinesClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachinesPerformMaintenanceFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// PowerOff the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same
-// provisioned resources. You are still charged for this virtual machine.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesPowerOffFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PowerOff")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", nil, "Failure preparing request")
- return
- }
-
- result, err = client.PowerOffSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// PowerOffPreparer prepares the PowerOff request.
-func (client VirtualMachinesClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PowerOffSender sends the PowerOff request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future VirtualMachinesPowerOffFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// PowerOffResponder handles the response to the PowerOff request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Redeploy shuts down the virtual machine, moves it to a new node, and powers it back on.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-func (client VirtualMachinesClient) Redeploy(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRedeployFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Redeploy")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.RedeployPreparer(ctx, resourceGroupName, VMName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", nil, "Failure preparing request")
- return
- }
-
- result, err = client.RedeploySender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// RedeployPreparer prepares the Redeploy request.
-func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RedeploySender sends the Redeploy request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future VirtualMachinesRedeployFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// RedeployResponder handles the response to the Redeploy request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Restart the operation to restart a virtual machine.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-func (client VirtualMachinesClient) Restart(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRestartFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Restart")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.RestartPreparer(ctx, resourceGroupName, VMName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", nil, "Failure preparing request")
- return
- }
-
- result, err = client.RestartSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// RestartPreparer prepares the Restart request.
-func (client VirtualMachinesClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RestartSender sends the Restart request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) RestartSender(req *http.Request) (future VirtualMachinesRestartFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// RestartResponder handles the response to the Restart request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// RunCommand run command on the VM.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-// parameters - parameters supplied to the Run command operation.
-func (client VirtualMachinesClient) RunCommand(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (result VirtualMachinesRunCommandFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.RunCommand")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.CommandID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.VirtualMachinesClient", "RunCommand", err.Error())
- }
-
- req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", nil, "Failure preparing request")
- return
- }
-
- result, err = client.RunCommandSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// RunCommandPreparer prepares the RunCommand request.
-func (client VirtualMachinesClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RunCommandSender sends the RunCommand request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future VirtualMachinesRunCommandFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// RunCommandResponder handles the response to the RunCommand request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Start the operation to start a virtual machine.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-func (client VirtualMachinesClient) Start(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesStartFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Start")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.StartPreparer(ctx, resourceGroupName, VMName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", nil, "Failure preparing request")
- return
- }
-
- result, err = client.StartSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// StartPreparer prepares the Start request.
-func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// StartSender sends the Start request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) StartSender(req *http.Request) (future VirtualMachinesStartFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// StartResponder handles the response to the Start request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Update the operation to update a virtual machine.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMName - the name of the virtual machine.
-// parameters - parameters supplied to the Update Virtual Machine operation.
-func (client VirtualMachinesClient) Update(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineUpdate) (result VirtualMachinesUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Update")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", nil, "Failure preparing request")
- return
- }
-
- result, err = client.UpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client VirtualMachinesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineUpdate) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmName": autorest.Encode("path", VMName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachinesClient) UpdateSender(req *http.Request) (future VirtualMachinesUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client VirtualMachinesClient) UpdateResponder(resp *http.Response) (result VirtualMachine, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetextensions.go
deleted file mode 100644
index 1867892ac..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetextensions.go
+++ /dev/null
@@ -1,397 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// VirtualMachineScaleSetExtensionsClient is the compute Client
-type VirtualMachineScaleSetExtensionsClient struct {
- BaseClient
-}
-
-// NewVirtualMachineScaleSetExtensionsClient creates an instance of the VirtualMachineScaleSetExtensionsClient client.
-func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient {
- return NewVirtualMachineScaleSetExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewVirtualMachineScaleSetExtensionsClientWithBaseURI creates an instance of the
-// VirtualMachineScaleSetExtensionsClient client using a custom endpoint. Use this when interacting with an Azure
-// cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient {
- return VirtualMachineScaleSetExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdate the operation to create or update an extension.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set where the extension should be create or updated.
-// vmssExtensionName - the name of the VM scale set extension.
-// extensionParameters - parameters supplied to the Create VM scale set Extension operation.
-func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (result VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateOrUpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- "vmssExtensionName": autorest.Encode("path", vmssExtensionName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters),
- autorest.WithJSON(extensionParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete the operation to delete the extension.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set where the extension should be deleted.
-// vmssExtensionName - the name of the VM scale set extension.
-func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (result VirtualMachineScaleSetExtensionsDeleteFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Delete")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- "vmssExtensionName": autorest.Encode("path", vmssExtensionName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetExtensionsDeleteFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get the operation to get the extension.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set containing the extension.
-// vmssExtensionName - the name of the VM scale set extension.
-// expand - the expand expression to apply on the operation.
-func (client VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (result VirtualMachineScaleSetExtension, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, expand)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- "vmssExtensionName": autorest.Encode("path", vmssExtensionName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of all extensions in a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set containing the extension.
-func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List")
- defer func() {
- sc := -1
- if result.vmsselr.Response.Response != nil {
- sc = result.vmsselr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.vmsselr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure sending request")
- return
- }
-
- result.vmsselr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request")
- return
- }
- if result.vmsselr.hasNextLink() && result.vmsselr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client VirtualMachineScaleSetExtensionsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetExtensionListResult) (result VirtualMachineScaleSetExtensionListResult, err error) {
- req, err := lastResults.virtualMachineScaleSetExtensionListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client VirtualMachineScaleSetExtensionsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx, resourceGroupName, VMScaleSetName)
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetrollingupgrades.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetrollingupgrades.go
deleted file mode 100644
index 534dc2e20..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetrollingupgrades.go
+++ /dev/null
@@ -1,268 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// VirtualMachineScaleSetRollingUpgradesClient is the compute Client
-type VirtualMachineScaleSetRollingUpgradesClient struct {
- BaseClient
-}
-
-// NewVirtualMachineScaleSetRollingUpgradesClient creates an instance of the
-// VirtualMachineScaleSetRollingUpgradesClient client.
-func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient {
- return NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI creates an instance of the
-// VirtualMachineScaleSetRollingUpgradesClient client using a custom endpoint. Use this when interacting with an Azure
-// cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient {
- return VirtualMachineScaleSetRollingUpgradesClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Cancel cancels the current virtual machine scale set rolling upgrade.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.Cancel")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.CancelPreparer(ctx, resourceGroupName, VMScaleSetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CancelSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CancelPreparer prepares the Cancel request.
-func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CancelSender sends the Cancel request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CancelResponder handles the response to the Cancel request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetLatest gets the status of the latest virtual machine scale set rolling upgrade.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result RollingUpgradeStatusInfo, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.GetLatest")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetLatestPreparer(ctx, resourceGroupName, VMScaleSetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetLatestSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetLatestResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetLatestPreparer prepares the GetLatest request.
-func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetLatestSender sends the GetLatest request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetLatestResponder handles the response to the GetLatest request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(resp *http.Response) (result RollingUpgradeStatusInfo, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// StartOSUpgrade starts a rolling upgrade to move all virtual machine scale set instances to the latest available
-// Platform Image OS version. Instances which are already running the latest available OS version are not affected.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartOSUpgrade")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.StartOSUpgradePreparer(ctx, resourceGroupName, VMScaleSetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", nil, "Failure preparing request")
- return
- }
-
- result, err = client.StartOSUpgradeSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// StartOSUpgradePreparer prepares the StartOSUpgrade request.
-func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// StartOSUpgradeSender sends the StartOSUpgrade request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// StartOSUpgradeResponder handles the response to the StartOSUpgrade request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesets.go
deleted file mode 100644
index ea8302b14..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesets.go
+++ /dev/null
@@ -1,1860 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// VirtualMachineScaleSetsClient is the compute Client
-type VirtualMachineScaleSetsClient struct {
- BaseClient
-}
-
-// NewVirtualMachineScaleSetsClient creates an instance of the VirtualMachineScaleSetsClient client.
-func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient {
- return NewVirtualMachineScaleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewVirtualMachineScaleSetsClientWithBaseURI creates an instance of the VirtualMachineScaleSetsClient client using a
-// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds,
-// Azure stack).
-func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient {
- return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdate create or update a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set to create or update.
-// parameters - the scale set object.
-func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (result VirtualMachineScaleSetsCreateOrUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
- {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil},
- }},
- {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
- {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil},
- }},
- {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
- {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", err.Error())
- }
-
- req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateOrUpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetsCreateOrUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Deallocate deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the
-// compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
-func (client VirtualMachineScaleSetsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsDeallocateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Deallocate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeallocateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeallocatePreparer prepares the Deallocate request.
-func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if VMInstanceIDs != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(VMInstanceIDs))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeallocateSender sends the Deallocate request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetsDeallocateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeallocateResponder handles the response to the Deallocate request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-func (client VirtualMachineScaleSetsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetsDeleteFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Delete")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client VirtualMachineScaleSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetsDeleteFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// DeleteInstances deletes virtual machines in a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
-func (client VirtualMachineScaleSetsClient) DeleteInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsDeleteInstancesFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.DeleteInstances")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: VMInstanceIDs,
- Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "DeleteInstances", err.Error())
- }
-
- req, err := client.DeleteInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteInstancesSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeleteInstancesPreparer prepares the DeleteInstances request.
-func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete", pathParameters),
- autorest.WithJSON(VMInstanceIDs),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteInstancesSender sends the DeleteInstances request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Request) (future VirtualMachineScaleSetsDeleteInstancesFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteInstancesResponder handles the response to the DeleteInstances request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ForceRecoveryServiceFabricPlatformUpdateDomainWalk manual platform update domain walk to update virtual machines in
-// a service fabric virtual machine scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// platformUpdateDomain - the platform update domain for which a manual recovery walk is requested
-func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (result RecoveryWalkResponse, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx, resourceGroupName, VMScaleSetName, platformUpdateDomain)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure sending request")
- return
- }
-
- result, err = client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer prepares the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request.
-func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- "platformUpdateDomain": autorest.Encode("query", platformUpdateDomain),
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender sends the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder handles the response to the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp *http.Response) (result RecoveryWalkResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get display information about a virtual machine scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-func (client VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSet, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client VirtualMachineScaleSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetInstanceView gets the status of a VM scale set instance.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-func (client VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetInstanceView")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetInstanceViewSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetInstanceViewResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetInstanceViewPreparer prepares the GetInstanceView request.
-func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetInstanceViewSender sends the GetInstanceView request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetInstanceView, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetOSUpgradeHistory gets list of OS upgrades on a VM scale set instance.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistory(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory")
- defer func() {
- sc := -1
- if result.vmsslouh.Response.Response != nil {
- sc = result.vmsslouh.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.getOSUpgradeHistoryNextResults
- req, err := client.GetOSUpgradeHistoryPreparer(ctx, resourceGroupName, VMScaleSetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetOSUpgradeHistorySender(req)
- if err != nil {
- result.vmsslouh.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure sending request")
- return
- }
-
- result.vmsslouh, err = client.GetOSUpgradeHistoryResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure responding to request")
- return
- }
- if result.vmsslouh.hasNextLink() && result.vmsslouh.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// GetOSUpgradeHistoryPreparer prepares the GetOSUpgradeHistory request.
-func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetOSUpgradeHistorySender sends the GetOSUpgradeHistory request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistorySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetOSUpgradeHistoryResponder handles the response to the GetOSUpgradeHistory request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryResponder(resp *http.Response) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// getOSUpgradeHistoryNextResults retrieves the next set of results, if any.
-func (client VirtualMachineScaleSetsClient) getOSUpgradeHistoryNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListOSUpgradeHistory) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) {
- req, err := lastResults.virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.GetOSUpgradeHistorySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure sending next results request")
- }
- result, err = client.GetOSUpgradeHistoryResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// GetOSUpgradeHistoryComplete enumerates all values, automatically crossing page boundaries as required.
-func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.GetOSUpgradeHistory(ctx, resourceGroupName, VMScaleSetName)
- return
-}
-
-// List gets a list of all VM scale sets under a resource group.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-func (client VirtualMachineScaleSetsClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List")
- defer func() {
- sc := -1
- if result.vmsslr.Response.Response != nil {
- sc = result.vmsslr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, resourceGroupName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.vmsslr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure sending request")
- return
- }
-
- result.vmsslr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to request")
- return
- }
- if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client VirtualMachineScaleSetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client VirtualMachineScaleSetsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) {
- req, err := lastResults.virtualMachineScaleSetListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client VirtualMachineScaleSetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx, resourceGroupName)
- return
-}
-
-// ListAll gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use
-// nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all
-// the VM Scale Sets.
-func (client VirtualMachineScaleSetsClient) ListAll(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll")
- defer func() {
- sc := -1
- if result.vmsslwlr.Response.Response != nil {
- sc = result.vmsslwlr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listAllNextResults
- req, err := client.ListAllPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListAllSender(req)
- if err != nil {
- result.vmsslwlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure sending request")
- return
- }
-
- result.vmsslwlr, err = client.ListAllResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to request")
- return
- }
- if result.vmsslwlr.hasNextLink() && result.vmsslwlr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListAllPreparer prepares the ListAll request.
-func (client VirtualMachineScaleSetsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListAllSender sends the ListAll request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) ListAllSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListAllResponder handles the response to the ListAll request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) ListAllResponder(resp *http.Response) (result VirtualMachineScaleSetListWithLinkResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listAllNextResults retrieves the next set of results, if any.
-func (client VirtualMachineScaleSetsClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListWithLinkResult) (result VirtualMachineScaleSetListWithLinkResult, err error) {
- req, err := lastResults.virtualMachineScaleSetListWithLinkResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListAllSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListAllResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListAllComplete enumerates all values, automatically crossing page boundaries as required.
-func (client VirtualMachineScaleSetsClient) ListAllComplete(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListAll(ctx)
- return
-}
-
-// ListSkus gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed
-// for each SKU.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-func (client VirtualMachineScaleSetsClient) ListSkus(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus")
- defer func() {
- sc := -1
- if result.vmsslsr.Response.Response != nil {
- sc = result.vmsslsr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listSkusNextResults
- req, err := client.ListSkusPreparer(ctx, resourceGroupName, VMScaleSetName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSkusSender(req)
- if err != nil {
- result.vmsslsr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure sending request")
- return
- }
-
- result.vmsslsr, err = client.ListSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to request")
- return
- }
- if result.vmsslsr.hasNextLink() && result.vmsslsr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListSkusPreparer prepares the ListSkus request.
-func (client VirtualMachineScaleSetsClient) ListSkusPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSkusSender sends the ListSkus request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) ListSkusSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListSkusResponder handles the response to the ListSkus request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) ListSkusResponder(resp *http.Response) (result VirtualMachineScaleSetListSkusResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listSkusNextResults retrieves the next set of results, if any.
-func (client VirtualMachineScaleSetsClient) listSkusNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListSkusResult) (result VirtualMachineScaleSetListSkusResult, err error) {
- req, err := lastResults.virtualMachineScaleSetListSkusResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSkusSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListSkusResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListSkusComplete enumerates all values, automatically crossing page boundaries as required.
-func (client VirtualMachineScaleSetsClient) ListSkusComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListSkus(ctx, resourceGroupName, VMScaleSetName)
- return
-}
-
-// PerformMaintenance perform maintenance on one or more virtual machines in a VM scale set. Operation on instances
-// which are not eligible for perform maintenance will be failed. Please refer to best practices for more details:
-// https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
-func (client VirtualMachineScaleSetsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPerformMaintenanceFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PerformMaintenance")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", nil, "Failure preparing request")
- return
- }
-
- result, err = client.PerformMaintenanceSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// PerformMaintenancePreparer prepares the PerformMaintenance request.
-func (client VirtualMachineScaleSetsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if VMInstanceIDs != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(VMInstanceIDs))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetsPerformMaintenanceFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// PowerOff power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and
-// you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
-func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPowerOffFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PowerOff")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", nil, "Failure preparing request")
- return
- }
-
- result, err = client.PowerOffSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// PowerOffPreparer prepares the PowerOff request.
-func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if VMInstanceIDs != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(VMInstanceIDs))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PowerOffSender sends the PowerOff request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetsPowerOffFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// PowerOffResponder handles the response to the PowerOff request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Redeploy shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers
-// them back on.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
-func (client VirtualMachineScaleSetsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRedeployFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Redeploy")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", nil, "Failure preparing request")
- return
- }
-
- result, err = client.RedeploySender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// RedeployPreparer prepares the Redeploy request.
-func (client VirtualMachineScaleSetsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if VMInstanceIDs != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(VMInstanceIDs))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RedeploySender sends the Redeploy request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetsRedeployFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// RedeployResponder handles the response to the Redeploy request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Reimage reimages (upgrade the operating system) one or more virtual machines in a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
-func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsReimageFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Reimage")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure preparing request")
- return
- }
-
- result, err = client.ReimageSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// ReimagePreparer prepares the Reimage request.
-func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if VMInstanceIDs != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(VMInstanceIDs))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReimageSender sends the Reimage request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetsReimageFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// ReimageResponder handles the response to the Reimage request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ReimageAll reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation
-// is only supported for managed disks.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
-func (client VirtualMachineScaleSetsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsReimageAllFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ReimageAll")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", nil, "Failure preparing request")
- return
- }
-
- result, err = client.ReimageAllSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// ReimageAllPreparer prepares the ReimageAll request.
-func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if VMInstanceIDs != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(VMInstanceIDs))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReimageAllSender sends the ReimageAll request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetsReimageAllFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// ReimageAllResponder handles the response to the ReimageAll request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Restart restarts one or more virtual machines in a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
-func (client VirtualMachineScaleSetsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRestartFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Restart")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", nil, "Failure preparing request")
- return
- }
-
- result, err = client.RestartSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// RestartPreparer prepares the Restart request.
-func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if VMInstanceIDs != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(VMInstanceIDs))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RestartSender sends the Restart request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetsRestartFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// RestartResponder handles the response to the Restart request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Start starts one or more virtual machines in a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
-func (client VirtualMachineScaleSetsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsStartFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Start")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", nil, "Failure preparing request")
- return
- }
-
- result, err = client.StartSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// StartPreparer prepares the Start request.
-func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- if VMInstanceIDs != nil {
- preparer = autorest.DecoratePreparer(preparer,
- autorest.WithJSON(VMInstanceIDs))
- }
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// StartSender sends the Start request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetsStartFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// StartResponder handles the response to the Start request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Update update a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set to create or update.
-// parameters - the scale set object.
-func (client VirtualMachineScaleSetsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (result VirtualMachineScaleSetsUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Update")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", nil, "Failure preparing request")
- return
- }
-
- result, err = client.UpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetsUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateInstances upgrades one or more virtual machines to the latest SKU set in the VM scale set model.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
-func (client VirtualMachineScaleSetsClient) UpdateInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsUpdateInstancesFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.UpdateInstances")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: VMInstanceIDs,
- Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "UpdateInstances", err.Error())
- }
-
- req, err := client.UpdateInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", nil, "Failure preparing request")
- return
- }
-
- result, err = client.UpdateInstancesSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// UpdateInstancesPreparer prepares the UpdateInstances request.
-func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", pathParameters),
- autorest.WithJSON(VMInstanceIDs),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateInstancesSender sends the UpdateInstances request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Request) (future VirtualMachineScaleSetsUpdateInstancesFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// UpdateInstancesResponder handles the response to the UpdateInstances request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetsClient) UpdateInstancesResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetvms.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetvms.go
deleted file mode 100644
index 0a2d64b45..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetvms.go
+++ /dev/null
@@ -1,1162 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// VirtualMachineScaleSetVMsClient is the compute Client
-type VirtualMachineScaleSetVMsClient struct {
- BaseClient
-}
-
-// NewVirtualMachineScaleSetVMsClient creates an instance of the VirtualMachineScaleSetVMsClient client.
-func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient {
- return NewVirtualMachineScaleSetVMsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the VirtualMachineScaleSetVMsClient client
-// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign
-// clouds, Azure stack).
-func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient {
- return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Deallocate deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the
-// compute resources it uses. You are not billed for the compute resources of this virtual machine once it is
-// deallocated.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// instanceID - the instance ID of the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeallocateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Deallocate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeallocateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeallocatePreparer prepares the Deallocate request.
-func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeallocateSender sends the Deallocate request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetVMsDeallocateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeallocateResponder handles the response to the Deallocate request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes a virtual machine from a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// instanceID - the instance ID of the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeleteFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Delete")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client VirtualMachineScaleSetVMsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMsDeleteFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get gets a virtual machine from a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// instanceID - the instance ID of the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVM, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetInstanceView gets the status of a virtual machine from a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// instanceID - the instance ID of the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.GetInstanceView")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetInstanceViewSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetInstanceViewResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetInstanceViewPreparer prepares the GetInstanceView request.
-func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetInstanceViewSender sends the GetInstanceView request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetVMInstanceView, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets a list of all virtual machines in a VM scale sets.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// virtualMachineScaleSetName - the name of the VM scale set.
-// filter - the filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code,
-// 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'.
-// selectParameter - the list parameters. Allowed values are 'instanceView', 'instanceView/statuses'.
-// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'.
-func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List")
- defer func() {
- sc := -1
- if result.vmssvlr.Response.Response != nil {
- sc = result.vmssvlr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.vmssvlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure sending request")
- return
- }
-
- result.vmssvlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to request")
- return
- }
- if result.vmssvlr.hasNextLink() && result.vmssvlr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client VirtualMachineScaleSetVMsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(selectParameter) > 0 {
- queryParameters["$select"] = autorest.Encode("query", selectParameter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client VirtualMachineScaleSetVMsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetVMListResult) (result VirtualMachineScaleSetVMListResult, err error) {
- req, err := lastResults.virtualMachineScaleSetVMListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client VirtualMachineScaleSetVMsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand)
- return
-}
-
-// PerformMaintenance performs maintenance on a virtual machine in a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// instanceID - the instance ID of the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PerformMaintenance")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", nil, "Failure preparing request")
- return
- }
-
- result, err = client.PerformMaintenanceSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// PerformMaintenancePreparer prepares the PerformMaintenance request.
-func (client VirtualMachineScaleSetVMsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// PowerOff power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are
-// getting charged for the resources. Instead, use deallocate to release resources and avoid charges.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// instanceID - the instance ID of the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsPowerOffFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PowerOff")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", nil, "Failure preparing request")
- return
- }
-
- result, err = client.PowerOffSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// PowerOffPreparer prepares the PowerOff request.
-func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// PowerOffSender sends the PowerOff request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetVMsPowerOffFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// PowerOffResponder handles the response to the PowerOff request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Redeploy shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back
-// on.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// instanceID - the instance ID of the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRedeployFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Redeploy")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", nil, "Failure preparing request")
- return
- }
-
- result, err = client.RedeploySender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// RedeployPreparer prepares the Redeploy request.
-func (client VirtualMachineScaleSetVMsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RedeploySender sends the Redeploy request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetVMsRedeployFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// RedeployResponder handles the response to the Redeploy request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) RedeployResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Reimage reimages (upgrade the operating system) a specific virtual machine in a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// instanceID - the instance ID of the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Reimage")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", nil, "Failure preparing request")
- return
- }
-
- result, err = client.ReimageSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// ReimagePreparer prepares the Reimage request.
-func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReimageSender sends the Reimage request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// ReimageResponder handles the response to the Reimage request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ReimageAll allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This
-// operation is only supported for managed disks.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// instanceID - the instance ID of the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageAllFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.ReimageAll")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", nil, "Failure preparing request")
- return
- }
-
- result, err = client.ReimageAllSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// ReimageAllPreparer prepares the ReimageAll request.
-func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ReimageAllSender sends the ReimageAll request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageAllFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// ReimageAllResponder handles the response to the ReimageAll request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Restart restarts a virtual machine in a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// instanceID - the instance ID of the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRestartFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Restart")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", nil, "Failure preparing request")
- return
- }
-
- result, err = client.RestartSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// RestartPreparer prepares the Restart request.
-func (client VirtualMachineScaleSetVMsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RestartSender sends the Restart request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetVMsRestartFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// RestartResponder handles the response to the Restart request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Start starts a virtual machine in a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set.
-// instanceID - the instance ID of the virtual machine.
-func (client VirtualMachineScaleSetVMsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsStartFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Start")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", nil, "Failure preparing request")
- return
- }
-
- result, err = client.StartSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// StartPreparer prepares the Start request.
-func (client VirtualMachineScaleSetVMsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// StartSender sends the Start request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetVMsStartFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// StartResponder handles the response to the Start request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) StartResponder(resp *http.Response) (result OperationStatusResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Update updates a virtual machine of a VM scale set.
-// Parameters:
-// resourceGroupName - the name of the resource group.
-// VMScaleSetName - the name of the VM scale set where the extension should be create or updated.
-// instanceID - the instance ID of the virtual machine.
-// parameters - parameters supplied to the Update Virtual Machine Scale Sets VM operation.
-func (client VirtualMachineScaleSetVMsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (result VirtualMachineScaleSetVMsUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Update")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
- }},
- {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
- }},
- }},
- }},
- }},
- }}}}}); err != nil {
- return result, validation.NewError("compute.VirtualMachineScaleSetVMsClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", nil, "Failure preparing request")
- return
- }
-
- result, err = client.UpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "instanceId": autorest.Encode("path", instanceID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- parameters.InstanceID = nil
- parameters.Sku = nil
- parameters.Resources = nil
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMsUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineScaleSetVMsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinesizes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinesizes.go
deleted file mode 100644
index 584832081..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinesizes.go
+++ /dev/null
@@ -1,113 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// VirtualMachineSizesClient is the compute Client
-type VirtualMachineSizesClient struct {
- BaseClient
-}
-
-// NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client.
-func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient {
- return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient client using a custom
-// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
-// stack).
-func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient {
- return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// List lists all available virtual machine sizes for a subscription in a location.
-// Parameters:
-// location - the location upon which virtual-machine-sizes is queried.
-func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSizesClient.List")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: location,
- Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("compute.VirtualMachineSizesClient", "List", err.Error())
- }
-
- req, err := client.ListPreparer(ctx, location)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "location": autorest.Encode("path", location),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-12-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/CHANGELOG.md
deleted file mode 100644
index 52911e4cc..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/CHANGELOG.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# Change History
-
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/_meta.json
deleted file mode 100644
index d93378dba..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/_meta.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
- "readme": "/_/azure-rest-api-specs/specification/resources/resource-manager/readme.md",
- "tag": "package-resources-2018-05",
- "use": "@microsoft.azure/autorest.go@2.1.187",
- "repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
- "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-resources-2018-05 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/resources/resource-manager/readme.md",
- "additional_properties": {
- "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION"
- }
-}
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/client.go
deleted file mode 100644
index d7360b529..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/client.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details.
-//
-// Package resources implements the Azure ARM Resources service API version 2018-05-01.
-//
-// Provides operations for working with resources and resource groups.
-package resources
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "github.com/Azure/go-autorest/autorest"
-)
-
-const (
- // DefaultBaseURI is the default URI used for the service Resources
- DefaultBaseURI = "https://management.azure.com"
-)
-
-// BaseClient is the base client for Resources.
-type BaseClient struct {
- autorest.Client
- BaseURI string
- SubscriptionID string
-}
-
-// New creates an instance of the BaseClient client.
-func New(subscriptionID string) BaseClient {
- return NewWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with
-// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return BaseClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- SubscriptionID: subscriptionID,
- }
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deploymentoperations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deploymentoperations.go
deleted file mode 100644
index e836486da..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deploymentoperations.go
+++ /dev/null
@@ -1,469 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// DeploymentOperationsClient is the provides operations for working with resources and resource groups.
-type DeploymentOperationsClient struct {
- BaseClient
-}
-
-// NewDeploymentOperationsClient creates an instance of the DeploymentOperationsClient client.
-func NewDeploymentOperationsClient(subscriptionID string) DeploymentOperationsClient {
- return NewDeploymentOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewDeploymentOperationsClientWithBaseURI creates an instance of the DeploymentOperationsClient client using a custom
-// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
-// stack).
-func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentOperationsClient {
- return DeploymentOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets a deployments operation.
-// Parameters:
-// resourceGroupName - the name of the resource group. The name is case insensitive.
-// deploymentName - the name of the deployment.
-// operationID - the ID of the operation to get.
-func (client DeploymentOperationsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string, operationID string) (result DeploymentOperation, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}},
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentOperationsClient", "Get", err.Error())
- }
-
- req, err := client.GetPreparer(ctx, resourceGroupName, deploymentName, operationID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client DeploymentOperationsClient) GetPreparer(ctx context.Context, resourceGroupName string, deploymentName string, operationID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "operationId": autorest.Encode("path", operationID),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentOperationsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client DeploymentOperationsClient) GetResponder(resp *http.Response) (result DeploymentOperation, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAtSubscriptionScope gets a deployments operation.
-// Parameters:
-// deploymentName - the name of the deployment.
-// operationID - the ID of the operation to get.
-func (client DeploymentOperationsClient) GetAtSubscriptionScope(ctx context.Context, deploymentName string, operationID string) (result DeploymentOperation, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsClient.GetAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentOperationsClient", "GetAtSubscriptionScope", err.Error())
- }
-
- req, err := client.GetAtSubscriptionScopePreparer(ctx, deploymentName, operationID)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "GetAtSubscriptionScope", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAtSubscriptionScopeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "GetAtSubscriptionScope", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAtSubscriptionScopeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "GetAtSubscriptionScope", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetAtSubscriptionScopePreparer prepares the GetAtSubscriptionScope request.
-func (client DeploymentOperationsClient) GetAtSubscriptionScopePreparer(ctx context.Context, deploymentName string, operationID string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "operationId": autorest.Encode("path", operationID),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAtSubscriptionScopeSender sends the GetAtSubscriptionScope request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentOperationsClient) GetAtSubscriptionScopeSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetAtSubscriptionScopeResponder handles the response to the GetAtSubscriptionScope request. The method always
-// closes the http.Response Body.
-func (client DeploymentOperationsClient) GetAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentOperation, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets all deployments operations for a deployment.
-// Parameters:
-// resourceGroupName - the name of the resource group. The name is case insensitive.
-// deploymentName - the name of the deployment with the operation to get.
-// top - the number of results to return.
-func (client DeploymentOperationsClient) List(ctx context.Context, resourceGroupName string, deploymentName string, top *int32) (result DeploymentOperationsListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsClient.List")
- defer func() {
- sc := -1
- if result.dolr.Response.Response != nil {
- sc = result.dolr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}},
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentOperationsClient", "List", err.Error())
- }
-
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, resourceGroupName, deploymentName, top)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.dolr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", resp, "Failure sending request")
- return
- }
-
- result.dolr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", resp, "Failure responding to request")
- return
- }
- if result.dolr.hasNextLink() && result.dolr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client DeploymentOperationsClient) ListPreparer(ctx context.Context, resourceGroupName string, deploymentName string, top *int32) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = autorest.Encode("query", *top)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentOperationsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client DeploymentOperationsClient) ListResponder(resp *http.Response) (result DeploymentOperationsListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client DeploymentOperationsClient) listNextResults(ctx context.Context, lastResults DeploymentOperationsListResult) (result DeploymentOperationsListResult, err error) {
- req, err := lastResults.deploymentOperationsListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client DeploymentOperationsClient) ListComplete(ctx context.Context, resourceGroupName string, deploymentName string, top *int32) (result DeploymentOperationsListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx, resourceGroupName, deploymentName, top)
- return
-}
-
-// ListAtSubscriptionScope gets all deployments operations for a deployment.
-// Parameters:
-// deploymentName - the name of the deployment with the operation to get.
-// top - the number of results to return.
-func (client DeploymentOperationsClient) ListAtSubscriptionScope(ctx context.Context, deploymentName string, top *int32) (result DeploymentOperationsListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsClient.ListAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.dolr.Response.Response != nil {
- sc = result.dolr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentOperationsClient", "ListAtSubscriptionScope", err.Error())
- }
-
- result.fn = client.listAtSubscriptionScopeNextResults
- req, err := client.ListAtSubscriptionScopePreparer(ctx, deploymentName, top)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "ListAtSubscriptionScope", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListAtSubscriptionScopeSender(req)
- if err != nil {
- result.dolr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "ListAtSubscriptionScope", resp, "Failure sending request")
- return
- }
-
- result.dolr, err = client.ListAtSubscriptionScopeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "ListAtSubscriptionScope", resp, "Failure responding to request")
- return
- }
- if result.dolr.hasNextLink() && result.dolr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListAtSubscriptionScopePreparer prepares the ListAtSubscriptionScope request.
-func (client DeploymentOperationsClient) ListAtSubscriptionScopePreparer(ctx context.Context, deploymentName string, top *int32) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = autorest.Encode("query", *top)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListAtSubscriptionScopeSender sends the ListAtSubscriptionScope request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentOperationsClient) ListAtSubscriptionScopeSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListAtSubscriptionScopeResponder handles the response to the ListAtSubscriptionScope request. The method always
-// closes the http.Response Body.
-func (client DeploymentOperationsClient) ListAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentOperationsListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listAtSubscriptionScopeNextResults retrieves the next set of results, if any.
-func (client DeploymentOperationsClient) listAtSubscriptionScopeNextResults(ctx context.Context, lastResults DeploymentOperationsListResult) (result DeploymentOperationsListResult, err error) {
- req, err := lastResults.deploymentOperationsListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "listAtSubscriptionScopeNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListAtSubscriptionScopeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "listAtSubscriptionScopeNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListAtSubscriptionScopeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "listAtSubscriptionScopeNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListAtSubscriptionScopeComplete enumerates all values, automatically crossing page boundaries as required.
-func (client DeploymentOperationsClient) ListAtSubscriptionScopeComplete(ctx context.Context, deploymentName string, top *int32) (result DeploymentOperationsListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsClient.ListAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListAtSubscriptionScope(ctx, deploymentName, top)
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deployments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deployments.go
deleted file mode 100644
index 72b2bd557..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deployments.go
+++ /dev/null
@@ -1,1618 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// DeploymentsClient is the provides operations for working with resources and resource groups.
-type DeploymentsClient struct {
- BaseClient
-}
-
-// NewDeploymentsClient creates an instance of the DeploymentsClient client.
-func NewDeploymentsClient(subscriptionID string) DeploymentsClient {
- return NewDeploymentsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewDeploymentsClientWithBaseURI creates an instance of the DeploymentsClient client using a custom endpoint. Use
-// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentsClient {
- return DeploymentsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CalculateTemplateHash calculate the hash of the given template.
-// Parameters:
-// templateParameter - the template provided to calculate hash.
-func (client DeploymentsClient) CalculateTemplateHash(ctx context.Context, templateParameter interface{}) (result TemplateHashResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.CalculateTemplateHash")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.CalculateTemplateHashPreparer(ctx, templateParameter)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CalculateTemplateHash", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CalculateTemplateHashSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CalculateTemplateHash", resp, "Failure sending request")
- return
- }
-
- result, err = client.CalculateTemplateHashResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CalculateTemplateHash", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CalculateTemplateHashPreparer prepares the CalculateTemplateHash request.
-func (client DeploymentsClient) CalculateTemplateHashPreparer(ctx context.Context, templateParameter interface{}) (*http.Request, error) {
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/providers/Microsoft.Resources/calculateTemplateHash"),
- autorest.WithJSON(templateParameter),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CalculateTemplateHashSender sends the CalculateTemplateHash request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) CalculateTemplateHashSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CalculateTemplateHashResponder handles the response to the CalculateTemplateHash request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) CalculateTemplateHashResponder(resp *http.Response) (result TemplateHashResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Cancel you can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
-// canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
-// template deployment and leaves the resource group partially deployed.
-// Parameters:
-// resourceGroupName - the name of the resource group. The name is case insensitive.
-// deploymentName - the name of the deployment to cancel.
-func (client DeploymentsClient) Cancel(ctx context.Context, resourceGroupName string, deploymentName string) (result autorest.Response, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Cancel")
- defer func() {
- sc := -1
- if result.Response != nil {
- sc = result.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}},
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "Cancel", err.Error())
- }
-
- req, err := client.CancelPreparer(ctx, resourceGroupName, deploymentName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Cancel", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CancelSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Cancel", resp, "Failure sending request")
- return
- }
-
- result, err = client.CancelResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Cancel", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CancelPreparer prepares the Cancel request.
-func (client DeploymentsClient) CancelPreparer(ctx context.Context, resourceGroupName string, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CancelSender sends the Cancel request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) CancelSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// CancelResponder handles the response to the Cancel request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CancelAtSubscriptionScope you can cancel a deployment only if the provisioningState is Accepted or Running. After
-// the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the
-// currently running template deployment and leaves the resources partially deployed.
-// Parameters:
-// deploymentName - the name of the deployment to cancel.
-func (client DeploymentsClient) CancelAtSubscriptionScope(ctx context.Context, deploymentName string) (result autorest.Response, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.CancelAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.Response != nil {
- sc = result.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "CancelAtSubscriptionScope", err.Error())
- }
-
- req, err := client.CancelAtSubscriptionScopePreparer(ctx, deploymentName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CancelAtSubscriptionScope", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CancelAtSubscriptionScopeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CancelAtSubscriptionScope", resp, "Failure sending request")
- return
- }
-
- result, err = client.CancelAtSubscriptionScopeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CancelAtSubscriptionScope", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CancelAtSubscriptionScopePreparer prepares the CancelAtSubscriptionScope request.
-func (client DeploymentsClient) CancelAtSubscriptionScopePreparer(ctx context.Context, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CancelAtSubscriptionScopeSender sends the CancelAtSubscriptionScope request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) CancelAtSubscriptionScopeSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// CancelAtSubscriptionScopeResponder handles the response to the CancelAtSubscriptionScope request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) CancelAtSubscriptionScopeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CheckExistence checks whether the deployment exists.
-// Parameters:
-// resourceGroupName - the name of the resource group with the deployment to check. The name is case
-// insensitive.
-// deploymentName - the name of the deployment to check.
-func (client DeploymentsClient) CheckExistence(ctx context.Context, resourceGroupName string, deploymentName string) (result autorest.Response, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.CheckExistence")
- defer func() {
- sc := -1
- if result.Response != nil {
- sc = result.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}},
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "CheckExistence", err.Error())
- }
-
- req, err := client.CheckExistencePreparer(ctx, resourceGroupName, deploymentName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CheckExistence", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CheckExistenceSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CheckExistence", resp, "Failure sending request")
- return
- }
-
- result, err = client.CheckExistenceResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CheckExistence", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CheckExistencePreparer prepares the CheckExistence request.
-func (client DeploymentsClient) CheckExistencePreparer(ctx context.Context, resourceGroupName string, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CheckExistenceSender sends the CheckExistence request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) CheckExistenceSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// CheckExistenceResponder handles the response to the CheckExistence request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CheckExistenceAtSubscriptionScope checks whether the deployment exists.
-// Parameters:
-// deploymentName - the name of the deployment to check.
-func (client DeploymentsClient) CheckExistenceAtSubscriptionScope(ctx context.Context, deploymentName string) (result autorest.Response, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.CheckExistenceAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.Response != nil {
- sc = result.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "CheckExistenceAtSubscriptionScope", err.Error())
- }
-
- req, err := client.CheckExistenceAtSubscriptionScopePreparer(ctx, deploymentName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CheckExistenceAtSubscriptionScope", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CheckExistenceAtSubscriptionScopeSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CheckExistenceAtSubscriptionScope", resp, "Failure sending request")
- return
- }
-
- result, err = client.CheckExistenceAtSubscriptionScopeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CheckExistenceAtSubscriptionScope", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CheckExistenceAtSubscriptionScopePreparer prepares the CheckExistenceAtSubscriptionScope request.
-func (client DeploymentsClient) CheckExistenceAtSubscriptionScopePreparer(ctx context.Context, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CheckExistenceAtSubscriptionScopeSender sends the CheckExistenceAtSubscriptionScope request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) CheckExistenceAtSubscriptionScopeSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// CheckExistenceAtSubscriptionScopeResponder handles the response to the CheckExistenceAtSubscriptionScope request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) CheckExistenceAtSubscriptionScopeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CreateOrUpdate you can provide the template and parameters directly in the request or link to JSON files.
-// Parameters:
-// resourceGroupName - the name of the resource group to deploy the resources to. The name is case insensitive.
-// The resource group must already exist.
-// deploymentName - the name of the deployment.
-// parameters - additional parameters supplied to the operation.
-func (client DeploymentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentsCreateOrUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}},
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "parameters.Properties.TemplateLink", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Properties.TemplateLink.URI", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "parameters.Properties.ParametersLink", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Properties.ParametersLink.URI", Name: validation.Null, Rule: true, Chain: nil}}},
- }}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "CreateOrUpdate", err.Error())
- }
-
- req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, deploymentName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateOrUpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client DeploymentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) CreateOrUpdateSender(req *http.Request) (future DeploymentsCreateOrUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (result DeploymentExtended, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateOrUpdateAtSubscriptionScope you can provide the template and parameters directly in the request or link to
-// JSON files.
-// Parameters:
-// deploymentName - the name of the deployment.
-// parameters - additional parameters supplied to the operation.
-func (client DeploymentsClient) CreateOrUpdateAtSubscriptionScope(ctx context.Context, deploymentName string, parameters Deployment) (result DeploymentsCreateOrUpdateAtSubscriptionScopeFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.CreateOrUpdateAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "parameters.Properties.TemplateLink", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Properties.TemplateLink.URI", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "parameters.Properties.ParametersLink", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Properties.ParametersLink.URI", Name: validation.Null, Rule: true, Chain: nil}}},
- }}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "CreateOrUpdateAtSubscriptionScope", err.Error())
- }
-
- req, err := client.CreateOrUpdateAtSubscriptionScopePreparer(ctx, deploymentName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CreateOrUpdateAtSubscriptionScope", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateOrUpdateAtSubscriptionScopeSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "CreateOrUpdateAtSubscriptionScope", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreateOrUpdateAtSubscriptionScopePreparer prepares the CreateOrUpdateAtSubscriptionScope request.
-func (client DeploymentsClient) CreateOrUpdateAtSubscriptionScopePreparer(ctx context.Context, deploymentName string, parameters Deployment) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateAtSubscriptionScopeSender sends the CreateOrUpdateAtSubscriptionScope request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) CreateOrUpdateAtSubscriptionScopeSender(req *http.Request) (future DeploymentsCreateOrUpdateAtSubscriptionScopeFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateOrUpdateAtSubscriptionScopeResponder handles the response to the CreateOrUpdateAtSubscriptionScope request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) CreateOrUpdateAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentExtended, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete a template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
-// associated deployment operations. Deleting a template deployment does not affect the state of the resource group.
-// This is an asynchronous operation that returns a status of 202 until the template deployment is successfully
-// deleted. The Location response header contains the URI that is used to obtain the status of the process. While the
-// process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the
-// URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the
-// Location header returns an error-level status code.
-// Parameters:
-// resourceGroupName - the name of the resource group with the deployment to delete. The name is case
-// insensitive.
-// deploymentName - the name of the deployment to delete.
-func (client DeploymentsClient) Delete(ctx context.Context, resourceGroupName string, deploymentName string) (result DeploymentsDeleteFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Delete")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}},
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "Delete", err.Error())
- }
-
- req, err := client.DeletePreparer(ctx, resourceGroupName, deploymentName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Delete", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client DeploymentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) DeleteSender(req *http.Request) (future DeploymentsDeleteFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteAtSubscriptionScope a template deployment that is currently running cannot be deleted. Deleting a template
-// deployment removes the associated deployment operations. This is an asynchronous operation that returns a status of
-// 202 until the template deployment is successfully deleted. The Location response header contains the URI that is
-// used to obtain the status of the process. While the process is running, a call to the URI in the Location header
-// returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on
-// success. If the asynchronous request failed, the URI in the Location header returns an error-level status code.
-// Parameters:
-// deploymentName - the name of the deployment to delete.
-func (client DeploymentsClient) DeleteAtSubscriptionScope(ctx context.Context, deploymentName string) (result DeploymentsDeleteAtSubscriptionScopeFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.DeleteAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "DeleteAtSubscriptionScope", err.Error())
- }
-
- req, err := client.DeleteAtSubscriptionScopePreparer(ctx, deploymentName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "DeleteAtSubscriptionScope", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteAtSubscriptionScopeSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "DeleteAtSubscriptionScope", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeleteAtSubscriptionScopePreparer prepares the DeleteAtSubscriptionScope request.
-func (client DeploymentsClient) DeleteAtSubscriptionScopePreparer(ctx context.Context, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteAtSubscriptionScopeSender sends the DeleteAtSubscriptionScope request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) DeleteAtSubscriptionScopeSender(req *http.Request) (future DeploymentsDeleteAtSubscriptionScopeFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteAtSubscriptionScopeResponder handles the response to the DeleteAtSubscriptionScope request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) DeleteAtSubscriptionScopeResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// ExportTemplate exports the template used for specified deployment.
-// Parameters:
-// resourceGroupName - the name of the resource group. The name is case insensitive.
-// deploymentName - the name of the deployment from which to get the template.
-func (client DeploymentsClient) ExportTemplate(ctx context.Context, resourceGroupName string, deploymentName string) (result DeploymentExportResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.ExportTemplate")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}},
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "ExportTemplate", err.Error())
- }
-
- req, err := client.ExportTemplatePreparer(ctx, resourceGroupName, deploymentName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExportTemplateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplate", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExportTemplateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplate", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ExportTemplatePreparer prepares the ExportTemplate request.
-func (client DeploymentsClient) ExportTemplatePreparer(ctx context.Context, resourceGroupName string, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExportTemplateSender sends the ExportTemplate request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) ExportTemplateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ExportTemplateResponder handles the response to the ExportTemplate request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) ExportTemplateResponder(resp *http.Response) (result DeploymentExportResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ExportTemplateAtSubscriptionScope exports the template used for specified deployment.
-// Parameters:
-// deploymentName - the name of the deployment from which to get the template.
-func (client DeploymentsClient) ExportTemplateAtSubscriptionScope(ctx context.Context, deploymentName string) (result DeploymentExportResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.ExportTemplateAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "ExportTemplateAtSubscriptionScope", err.Error())
- }
-
- req, err := client.ExportTemplateAtSubscriptionScopePreparer(ctx, deploymentName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplateAtSubscriptionScope", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExportTemplateAtSubscriptionScopeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplateAtSubscriptionScope", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExportTemplateAtSubscriptionScopeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplateAtSubscriptionScope", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ExportTemplateAtSubscriptionScopePreparer prepares the ExportTemplateAtSubscriptionScope request.
-func (client DeploymentsClient) ExportTemplateAtSubscriptionScopePreparer(ctx context.Context, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExportTemplateAtSubscriptionScopeSender sends the ExportTemplateAtSubscriptionScope request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) ExportTemplateAtSubscriptionScopeSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ExportTemplateAtSubscriptionScopeResponder handles the response to the ExportTemplateAtSubscriptionScope request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) ExportTemplateAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentExportResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get gets a deployment.
-// Parameters:
-// resourceGroupName - the name of the resource group. The name is case insensitive.
-// deploymentName - the name of the deployment to get.
-func (client DeploymentsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string) (result DeploymentExtended, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}},
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "Get", err.Error())
- }
-
- req, err := client.GetPreparer(ctx, resourceGroupName, deploymentName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client DeploymentsClient) GetPreparer(ctx context.Context, resourceGroupName string, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) GetResponder(resp *http.Response) (result DeploymentExtended, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetAtSubscriptionScope gets a deployment.
-// Parameters:
-// deploymentName - the name of the deployment to get.
-func (client DeploymentsClient) GetAtSubscriptionScope(ctx context.Context, deploymentName string) (result DeploymentExtended, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.GetAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "GetAtSubscriptionScope", err.Error())
- }
-
- req, err := client.GetAtSubscriptionScopePreparer(ctx, deploymentName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "GetAtSubscriptionScope", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetAtSubscriptionScopeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "GetAtSubscriptionScope", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetAtSubscriptionScopeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "GetAtSubscriptionScope", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetAtSubscriptionScopePreparer prepares the GetAtSubscriptionScope request.
-func (client DeploymentsClient) GetAtSubscriptionScopePreparer(ctx context.Context, deploymentName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetAtSubscriptionScopeSender sends the GetAtSubscriptionScope request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) GetAtSubscriptionScopeSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetAtSubscriptionScopeResponder handles the response to the GetAtSubscriptionScope request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) GetAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentExtended, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListAtSubscriptionScope get all the deployments for a subscription.
-// Parameters:
-// filter - the filter to apply on the operation. For example, you can use $filter=provisioningState eq
-// '{state}'.
-// top - the number of results to get. If null is passed, returns all deployments.
-func (client DeploymentsClient) ListAtSubscriptionScope(ctx context.Context, filter string, top *int32) (result DeploymentListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.ListAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.dlr.Response.Response != nil {
- sc = result.dlr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listAtSubscriptionScopeNextResults
- req, err := client.ListAtSubscriptionScopePreparer(ctx, filter, top)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListAtSubscriptionScope", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListAtSubscriptionScopeSender(req)
- if err != nil {
- result.dlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListAtSubscriptionScope", resp, "Failure sending request")
- return
- }
-
- result.dlr, err = client.ListAtSubscriptionScopeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListAtSubscriptionScope", resp, "Failure responding to request")
- return
- }
- if result.dlr.hasNextLink() && result.dlr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListAtSubscriptionScopePreparer prepares the ListAtSubscriptionScope request.
-func (client DeploymentsClient) ListAtSubscriptionScopePreparer(ctx context.Context, filter string, top *int32) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if top != nil {
- queryParameters["$top"] = autorest.Encode("query", *top)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListAtSubscriptionScopeSender sends the ListAtSubscriptionScope request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) ListAtSubscriptionScopeSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListAtSubscriptionScopeResponder handles the response to the ListAtSubscriptionScope request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) ListAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listAtSubscriptionScopeNextResults retrieves the next set of results, if any.
-func (client DeploymentsClient) listAtSubscriptionScopeNextResults(ctx context.Context, lastResults DeploymentListResult) (result DeploymentListResult, err error) {
- req, err := lastResults.deploymentListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "listAtSubscriptionScopeNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListAtSubscriptionScopeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "listAtSubscriptionScopeNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListAtSubscriptionScopeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "listAtSubscriptionScopeNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListAtSubscriptionScopeComplete enumerates all values, automatically crossing page boundaries as required.
-func (client DeploymentsClient) ListAtSubscriptionScopeComplete(ctx context.Context, filter string, top *int32) (result DeploymentListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.ListAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListAtSubscriptionScope(ctx, filter, top)
- return
-}
-
-// ListByResourceGroup get all the deployments for a resource group.
-// Parameters:
-// resourceGroupName - the name of the resource group with the deployments to get. The name is case
-// insensitive.
-// filter - the filter to apply on the operation. For example, you can use $filter=provisioningState eq
-// '{state}'.
-// top - the number of results to get. If null is passed, returns all deployments.
-func (client DeploymentsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32) (result DeploymentListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.ListByResourceGroup")
- defer func() {
- sc := -1
- if result.dlr.Response.Response != nil {
- sc = result.dlr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "ListByResourceGroup", err.Error())
- }
-
- result.fn = client.listByResourceGroupNextResults
- req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, top)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.dlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", resp, "Failure sending request")
- return
- }
-
- result.dlr, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ListByResourceGroup", resp, "Failure responding to request")
- return
- }
- if result.dlr.hasNextLink() && result.dlr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
-func (client DeploymentsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, top *int32) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if top != nil {
- queryParameters["$top"] = autorest.Encode("query", *top)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) ListByResourceGroupResponder(resp *http.Response) (result DeploymentListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listByResourceGroupNextResults retrieves the next set of results, if any.
-func (client DeploymentsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DeploymentListResult) (result DeploymentListResult, err error) {
- req, err := lastResults.deploymentListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
-func (client DeploymentsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, top *int32) (result DeploymentListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.ListByResourceGroup")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter, top)
- return
-}
-
-// Validate validates whether the specified template is syntactically correct and will be accepted by Azure Resource
-// Manager..
-// Parameters:
-// resourceGroupName - the name of the resource group the template will be deployed to. The name is case
-// insensitive.
-// deploymentName - the name of the deployment.
-// parameters - parameters to validate.
-func (client DeploymentsClient) Validate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentValidateResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.Validate")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}},
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "parameters.Properties.TemplateLink", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Properties.TemplateLink.URI", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "parameters.Properties.ParametersLink", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Properties.ParametersLink.URI", Name: validation.Null, Rule: true, Chain: nil}}},
- }}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "Validate", err.Error())
- }
-
- req, err := client.ValidatePreparer(ctx, resourceGroupName, deploymentName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Validate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ValidateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Validate", resp, "Failure sending request")
- return
- }
-
- result, err = client.ValidateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "Validate", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ValidatePreparer prepares the Validate request.
-func (client DeploymentsClient) ValidatePreparer(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ValidateSender sends the Validate request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) ValidateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ValidateResponder handles the response to the Validate request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) ValidateResponder(resp *http.Response) (result DeploymentValidateResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ValidateAtSubscriptionScope validates whether the specified template is syntactically correct and will be accepted
-// by Azure Resource Manager..
-// Parameters:
-// deploymentName - the name of the deployment.
-// parameters - parameters to validate.
-func (client DeploymentsClient) ValidateAtSubscriptionScope(ctx context.Context, deploymentName string, parameters Deployment) (result DeploymentValidateResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentsClient.ValidateAtSubscriptionScope")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: deploymentName,
- Constraints: []validation.Constraint{{Target: "deploymentName", Name: validation.MaxLength, Rule: 64, Chain: nil},
- {Target: "deploymentName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "deploymentName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "parameters.Properties.TemplateLink", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Properties.TemplateLink.URI", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "parameters.Properties.ParametersLink", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Properties.ParametersLink.URI", Name: validation.Null, Rule: true, Chain: nil}}},
- }}}}}); err != nil {
- return result, validation.NewError("resources.DeploymentsClient", "ValidateAtSubscriptionScope", err.Error())
- }
-
- req, err := client.ValidateAtSubscriptionScopePreparer(ctx, deploymentName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ValidateAtSubscriptionScope", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ValidateAtSubscriptionScopeSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ValidateAtSubscriptionScope", resp, "Failure sending request")
- return
- }
-
- result, err = client.ValidateAtSubscriptionScopeResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ValidateAtSubscriptionScope", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ValidateAtSubscriptionScopePreparer prepares the ValidateAtSubscriptionScope request.
-func (client DeploymentsClient) ValidateAtSubscriptionScopePreparer(ctx context.Context, deploymentName string, parameters Deployment) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "deploymentName": autorest.Encode("path", deploymentName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ValidateAtSubscriptionScopeSender sends the ValidateAtSubscriptionScope request. The method will close the
-// http.Response Body if it receives an error.
-func (client DeploymentsClient) ValidateAtSubscriptionScopeSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ValidateAtSubscriptionScopeResponder handles the response to the ValidateAtSubscriptionScope request. The method always
-// closes the http.Response Body.
-func (client DeploymentsClient) ValidateAtSubscriptionScopeResponder(resp *http.Response) (result DeploymentValidateResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/enums.go
deleted file mode 100644
index 90b8ab23b..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/enums.go
+++ /dev/null
@@ -1,56 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-// DeploymentMode enumerates the values for deployment mode.
-type DeploymentMode string
-
-const (
- // Complete ...
- Complete DeploymentMode = "Complete"
- // Incremental ...
- Incremental DeploymentMode = "Incremental"
-)
-
-// PossibleDeploymentModeValues returns an array of possible values for the DeploymentMode const type.
-func PossibleDeploymentModeValues() []DeploymentMode {
- return []DeploymentMode{Complete, Incremental}
-}
-
-// OnErrorDeploymentType enumerates the values for on error deployment type.
-type OnErrorDeploymentType string
-
-const (
- // LastSuccessful ...
- LastSuccessful OnErrorDeploymentType = "LastSuccessful"
- // SpecificDeployment ...
- SpecificDeployment OnErrorDeploymentType = "SpecificDeployment"
-)
-
-// PossibleOnErrorDeploymentTypeValues returns an array of possible values for the OnErrorDeploymentType const type.
-func PossibleOnErrorDeploymentTypeValues() []OnErrorDeploymentType {
- return []OnErrorDeploymentType{LastSuccessful, SpecificDeployment}
-}
-
-// ResourceIdentityType enumerates the values for resource identity type.
-type ResourceIdentityType string
-
-const (
- // None ...
- None ResourceIdentityType = "None"
- // SystemAssigned ...
- SystemAssigned ResourceIdentityType = "SystemAssigned"
- // SystemAssignedUserAssigned ...
- SystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned"
- // UserAssigned ...
- UserAssigned ResourceIdentityType = "UserAssigned"
-)
-
-// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type.
-func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
- return []ResourceIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/groups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/groups.go
deleted file mode 100644
index bf6c5cfee..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/groups.go
+++ /dev/null
@@ -1,666 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// GroupsClient is the provides operations for working with resources and resource groups.
-type GroupsClient struct {
- BaseClient
-}
-
-// NewGroupsClient creates an instance of the GroupsClient client.
-func NewGroupsClient(subscriptionID string) GroupsClient {
- return NewGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewGroupsClientWithBaseURI creates an instance of the GroupsClient client using a custom endpoint. Use this when
-// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsClient {
- return GroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CheckExistence checks whether a resource group exists.
-// Parameters:
-// resourceGroupName - the name of the resource group to check. The name is case insensitive.
-func (client GroupsClient) CheckExistence(ctx context.Context, resourceGroupName string) (result autorest.Response, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.CheckExistence")
- defer func() {
- sc := -1
- if result.Response != nil {
- sc = result.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.GroupsClient", "CheckExistence", err.Error())
- }
-
- req, err := client.CheckExistencePreparer(ctx, resourceGroupName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "CheckExistence", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CheckExistenceSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "CheckExistence", resp, "Failure sending request")
- return
- }
-
- result, err = client.CheckExistenceResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "CheckExistence", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CheckExistencePreparer prepares the CheckExistence request.
-func (client GroupsClient) CheckExistencePreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CheckExistenceSender sends the CheckExistence request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) CheckExistenceSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// CheckExistenceResponder handles the response to the CheckExistence request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CreateOrUpdate creates or updates a resource group.
-// Parameters:
-// resourceGroupName - the name of the resource group to create or update. Can include alphanumeric,
-// underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed
-// characters.
-// parameters - parameters supplied to the create or update a resource group.
-func (client GroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, parameters Group) (result Group, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}},
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.GroupsClient", "CreateOrUpdate", err.Error())
- }
-
- req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreateOrUpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "CreateOrUpdate", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreateOrUpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "CreateOrUpdate", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client GroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, parameters Group) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- parameters.ID = nil
- parameters.Name = nil
- parameters.Type = nil
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result Group, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete when you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes
-// all of its template deployments and currently stored operations.
-// Parameters:
-// resourceGroupName - the name of the resource group to delete. The name is case insensitive.
-func (client GroupsClient) Delete(ctx context.Context, resourceGroupName string) (result GroupsDeleteFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Delete")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.GroupsClient", "Delete", err.Error())
- }
-
- req, err := client.DeletePreparer(ctx, resourceGroupName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Delete", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client GroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) DeleteSender(req *http.Request) (future GroupsDeleteFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// ExportTemplate captures the specified resource group as a template.
-// Parameters:
-// resourceGroupName - the name of the resource group to export as a template.
-// parameters - parameters for exporting the template.
-func (client GroupsClient) ExportTemplate(ctx context.Context, resourceGroupName string, parameters ExportTemplateRequest) (result GroupExportResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.ExportTemplate")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.GroupsClient", "ExportTemplate", err.Error())
- }
-
- req, err := client.ExportTemplatePreparer(ctx, resourceGroupName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ExportTemplate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ExportTemplateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ExportTemplate", resp, "Failure sending request")
- return
- }
-
- result, err = client.ExportTemplateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ExportTemplate", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ExportTemplatePreparer prepares the ExportTemplate request.
-func (client GroupsClient) ExportTemplatePreparer(ctx context.Context, resourceGroupName string, parameters ExportTemplateRequest) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ExportTemplateSender sends the ExportTemplate request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) ExportTemplateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ExportTemplateResponder handles the response to the ExportTemplate request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) ExportTemplateResponder(resp *http.Response) (result GroupExportResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Get gets a resource group.
-// Parameters:
-// resourceGroupName - the name of the resource group to get. The name is case insensitive.
-func (client GroupsClient) Get(ctx context.Context, resourceGroupName string) (result Group, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.GroupsClient", "Get", err.Error())
- }
-
- req, err := client.GetPreparer(ctx, resourceGroupName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client GroupsClient) GetPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) GetResponder(resp *http.Response) (result Group, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets all the resource groups for a subscription.
-// Parameters:
-// filter - the filter to apply on the operation.
You can filter by tag names and values. For example,
-// to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
-// top - the number of results to return. If null is passed, returns all resource groups.
-func (client GroupsClient) List(ctx context.Context, filter string, top *int32) (result GroupListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.List")
- defer func() {
- sc := -1
- if result.glr.Response.Response != nil {
- sc = result.glr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, top)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.glr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "List", resp, "Failure sending request")
- return
- }
-
- result.glr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "List", resp, "Failure responding to request")
- return
- }
- if result.glr.hasNextLink() && result.glr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client GroupsClient) ListPreparer(ctx context.Context, filter string, top *int32) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if top != nil {
- queryParameters["$top"] = autorest.Encode("query", *top)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) ListResponder(resp *http.Response) (result GroupListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client GroupsClient) listNextResults(ctx context.Context, lastResults GroupListResult) (result GroupListResult, err error) {
- req, err := lastResults.groupListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client GroupsClient) ListComplete(ctx context.Context, filter string, top *int32) (result GroupListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx, filter, top)
- return
-}
-
-// Update resource groups can be updated through a simple PATCH operation to a group address. The format of the request
-// is the same as that for creating a resource group. If a field is unspecified, the current value is retained.
-// Parameters:
-// resourceGroupName - the name of the resource group to update. The name is case insensitive.
-// parameters - parameters supplied to update a resource group.
-func (client GroupsClient) Update(ctx context.Context, resourceGroupName string, parameters GroupPatchable) (result Group, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Update")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.GroupsClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, resourceGroupName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsClient", "Update", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client GroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, parameters GroupPatchable) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client GroupsClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client GroupsClient) UpdateResponder(resp *http.Response) (result Group, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/models.go
deleted file mode 100644
index 1de747860..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/models.go
+++ /dev/null
@@ -1,2552 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "encoding/json"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/autorest/to"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// The package's fully qualified name.
-const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources"
-
-// AliasPathType the type of the paths for alias.
-type AliasPathType struct {
- // Path - The path of an alias.
- Path *string `json:"path,omitempty"`
- // APIVersions - The API versions.
- APIVersions *[]string `json:"apiVersions,omitempty"`
-}
-
-// AliasType the alias type.
-type AliasType struct {
- // Name - The alias name.
- Name *string `json:"name,omitempty"`
- // Paths - The paths for an alias.
- Paths *[]AliasPathType `json:"paths,omitempty"`
-}
-
-// BasicDependency deployment dependency information.
-type BasicDependency struct {
- // ID - The ID of the dependency.
- ID *string `json:"id,omitempty"`
- // ResourceType - The dependency resource type.
- ResourceType *string `json:"resourceType,omitempty"`
- // ResourceName - The dependency resource name.
- ResourceName *string `json:"resourceName,omitempty"`
-}
-
-// CloudError an error response for a resource management request.
-type CloudError struct {
- Error *ErrorResponse `json:"error,omitempty"`
-}
-
-// CreateOrUpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type CreateOrUpdateByIDFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(Client) (GenericResource, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *CreateOrUpdateByIDFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for CreateOrUpdateByIDFuture.Result.
-func (future *CreateOrUpdateByIDFuture) result(client Client) (gr GenericResource, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- gr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateByIDFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
- gr, err = client.CreateOrUpdateByIDResponder(gr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type CreateOrUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(Client) (GenericResource, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *CreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for CreateOrUpdateFuture.Result.
-func (future *CreateOrUpdateFuture) result(client Client) (gr GenericResource, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- gr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
- gr, err = client.CreateOrUpdateResponder(gr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// DebugSetting ...
-type DebugSetting struct {
- // DetailLevel - Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information you are passing in during deployment. By logging information about the request or response, you could potentially expose sensitive data that is retrieved through the deployment operations.
- DetailLevel *string `json:"detailLevel,omitempty"`
-}
-
-// DeleteByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation.
-type DeleteByIDFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(Client) (autorest.Response, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *DeleteByIDFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for DeleteByIDFuture.Result.
-func (future *DeleteByIDFuture) result(client Client) (ar autorest.Response, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeleteByIDFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- ar.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.DeleteByIDFuture")
- return
- }
- ar.Response = future.Response()
- return
-}
-
-// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
-type DeleteFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(Client) (autorest.Response, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *DeleteFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for DeleteFuture.Result.
-func (future *DeleteFuture) result(client Client) (ar autorest.Response, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeleteFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- ar.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.DeleteFuture")
- return
- }
- ar.Response = future.Response()
- return
-}
-
-// Dependency deployment dependency information.
-type Dependency struct {
- // DependsOn - The list of dependencies.
- DependsOn *[]BasicDependency `json:"dependsOn,omitempty"`
- // ID - The ID of the dependency.
- ID *string `json:"id,omitempty"`
- // ResourceType - The dependency resource type.
- ResourceType *string `json:"resourceType,omitempty"`
- // ResourceName - The dependency resource name.
- ResourceName *string `json:"resourceName,omitempty"`
-}
-
-// Deployment deployment operation parameters.
-type Deployment struct {
- // Location - The location to store the deployment data.
- Location *string `json:"location,omitempty"`
- // Properties - The deployment properties.
- Properties *DeploymentProperties `json:"properties,omitempty"`
-}
-
-// DeploymentExportResult the deployment export result.
-type DeploymentExportResult struct {
- autorest.Response `json:"-"`
- // Template - The template content.
- Template interface{} `json:"template,omitempty"`
-}
-
-// DeploymentExtended deployment information.
-type DeploymentExtended struct {
- autorest.Response `json:"-"`
- // ID - READ-ONLY; The ID of the deployment.
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; The name of the deployment.
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; The type of the deployment.
- Type *string `json:"type,omitempty"`
- // Location - the location of the deployment.
- Location *string `json:"location,omitempty"`
- // Properties - Deployment properties.
- Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for DeploymentExtended.
-func (de DeploymentExtended) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if de.Location != nil {
- objectMap["location"] = de.Location
- }
- if de.Properties != nil {
- objectMap["properties"] = de.Properties
- }
- return json.Marshal(objectMap)
-}
-
-// DeploymentExtendedFilter deployment filter.
-type DeploymentExtendedFilter struct {
- // ProvisioningState - The provisioning state.
- ProvisioningState *string `json:"provisioningState,omitempty"`
-}
-
-// DeploymentListResult list of deployments.
-type DeploymentListResult struct {
- autorest.Response `json:"-"`
- // Value - An array of deployments.
- Value *[]DeploymentExtended `json:"value,omitempty"`
- // NextLink - READ-ONLY; The URL to use for getting the next set of results.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for DeploymentListResult.
-func (dlr DeploymentListResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if dlr.Value != nil {
- objectMap["value"] = dlr.Value
- }
- return json.Marshal(objectMap)
-}
-
-// DeploymentListResultIterator provides access to a complete listing of DeploymentExtended values.
-type DeploymentListResultIterator struct {
- i int
- page DeploymentListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *DeploymentListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *DeploymentListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter DeploymentListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter DeploymentListResultIterator) Response() DeploymentListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter DeploymentListResultIterator) Value() DeploymentExtended {
- if !iter.page.NotDone() {
- return DeploymentExtended{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the DeploymentListResultIterator type.
-func NewDeploymentListResultIterator(page DeploymentListResultPage) DeploymentListResultIterator {
- return DeploymentListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (dlr DeploymentListResult) IsEmpty() bool {
- return dlr.Value == nil || len(*dlr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (dlr DeploymentListResult) hasNextLink() bool {
- return dlr.NextLink != nil && len(*dlr.NextLink) != 0
-}
-
-// deploymentListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (dlr DeploymentListResult) deploymentListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !dlr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(dlr.NextLink)))
-}
-
-// DeploymentListResultPage contains a page of DeploymentExtended values.
-type DeploymentListResultPage struct {
- fn func(context.Context, DeploymentListResult) (DeploymentListResult, error)
- dlr DeploymentListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *DeploymentListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.dlr)
- if err != nil {
- return err
- }
- page.dlr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *DeploymentListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page DeploymentListResultPage) NotDone() bool {
- return !page.dlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page DeploymentListResultPage) Response() DeploymentListResult {
- return page.dlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page DeploymentListResultPage) Values() []DeploymentExtended {
- if page.dlr.IsEmpty() {
- return nil
- }
- return *page.dlr.Value
-}
-
-// Creates a new instance of the DeploymentListResultPage type.
-func NewDeploymentListResultPage(cur DeploymentListResult, getNextPage func(context.Context, DeploymentListResult) (DeploymentListResult, error)) DeploymentListResultPage {
- return DeploymentListResultPage{
- fn: getNextPage,
- dlr: cur,
- }
-}
-
-// DeploymentOperation deployment operation information.
-type DeploymentOperation struct {
- autorest.Response `json:"-"`
- // ID - READ-ONLY; Full deployment operation ID.
- ID *string `json:"id,omitempty"`
- // OperationID - READ-ONLY; Deployment operation ID.
- OperationID *string `json:"operationId,omitempty"`
- // Properties - Deployment properties.
- Properties *DeploymentOperationProperties `json:"properties,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for DeploymentOperation.
-func (do DeploymentOperation) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if do.Properties != nil {
- objectMap["properties"] = do.Properties
- }
- return json.Marshal(objectMap)
-}
-
-// DeploymentOperationProperties deployment operation properties.
-type DeploymentOperationProperties struct {
- // ProvisioningState - READ-ONLY; The state of the provisioning.
- ProvisioningState *string `json:"provisioningState,omitempty"`
- // Timestamp - READ-ONLY; The date and time of the operation.
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // ServiceRequestID - READ-ONLY; Deployment operation service request id.
- ServiceRequestID *string `json:"serviceRequestId,omitempty"`
- // StatusCode - READ-ONLY; Operation status code.
- StatusCode *string `json:"statusCode,omitempty"`
- // StatusMessage - READ-ONLY; Operation status message.
- StatusMessage interface{} `json:"statusMessage,omitempty"`
- // TargetResource - READ-ONLY; The target resource.
- TargetResource *TargetResource `json:"targetResource,omitempty"`
- // Request - READ-ONLY; The HTTP request message.
- Request *HTTPMessage `json:"request,omitempty"`
- // Response - READ-ONLY; The HTTP response message.
- Response *HTTPMessage `json:"response,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for DeploymentOperationProperties.
-func (dop DeploymentOperationProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// DeploymentOperationsListResult list of deployment operations.
-type DeploymentOperationsListResult struct {
- autorest.Response `json:"-"`
- // Value - An array of deployment operations.
- Value *[]DeploymentOperation `json:"value,omitempty"`
- // NextLink - READ-ONLY; The URL to use for getting the next set of results.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for DeploymentOperationsListResult.
-func (dolr DeploymentOperationsListResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if dolr.Value != nil {
- objectMap["value"] = dolr.Value
- }
- return json.Marshal(objectMap)
-}
-
-// DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation
-// values.
-type DeploymentOperationsListResultIterator struct {
- i int
- page DeploymentOperationsListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *DeploymentOperationsListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *DeploymentOperationsListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter DeploymentOperationsListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter DeploymentOperationsListResultIterator) Response() DeploymentOperationsListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter DeploymentOperationsListResultIterator) Value() DeploymentOperation {
- if !iter.page.NotDone() {
- return DeploymentOperation{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the DeploymentOperationsListResultIterator type.
-func NewDeploymentOperationsListResultIterator(page DeploymentOperationsListResultPage) DeploymentOperationsListResultIterator {
- return DeploymentOperationsListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (dolr DeploymentOperationsListResult) IsEmpty() bool {
- return dolr.Value == nil || len(*dolr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (dolr DeploymentOperationsListResult) hasNextLink() bool {
- return dolr.NextLink != nil && len(*dolr.NextLink) != 0
-}
-
-// deploymentOperationsListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !dolr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(dolr.NextLink)))
-}
-
-// DeploymentOperationsListResultPage contains a page of DeploymentOperation values.
-type DeploymentOperationsListResultPage struct {
- fn func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)
- dolr DeploymentOperationsListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *DeploymentOperationsListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentOperationsListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.dolr)
- if err != nil {
- return err
- }
- page.dolr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *DeploymentOperationsListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page DeploymentOperationsListResultPage) NotDone() bool {
- return !page.dolr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page DeploymentOperationsListResultPage) Response() DeploymentOperationsListResult {
- return page.dolr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page DeploymentOperationsListResultPage) Values() []DeploymentOperation {
- if page.dolr.IsEmpty() {
- return nil
- }
- return *page.dolr.Value
-}
-
-// Creates a new instance of the DeploymentOperationsListResultPage type.
-func NewDeploymentOperationsListResultPage(cur DeploymentOperationsListResult, getNextPage func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)) DeploymentOperationsListResultPage {
- return DeploymentOperationsListResultPage{
- fn: getNextPage,
- dolr: cur,
- }
-}
-
-// DeploymentProperties deployment properties.
-type DeploymentProperties struct {
- // Template - The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both.
- Template interface{} `json:"template,omitempty"`
- // TemplateLink - The URI of the template. Use either the templateLink property or the template property, but not both.
- TemplateLink *TemplateLink `json:"templateLink,omitempty"`
- // Parameters - Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string.
- Parameters interface{} `json:"parameters,omitempty"`
- // ParametersLink - The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both.
- ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
- // Mode - The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. Possible values include: 'Incremental', 'Complete'
- Mode DeploymentMode `json:"mode,omitempty"`
- // DebugSetting - The debug setting of the deployment.
- DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
- // OnErrorDeployment - The deployment on error behavior.
- OnErrorDeployment *OnErrorDeployment `json:"onErrorDeployment,omitempty"`
-}
-
-// DeploymentPropertiesExtended deployment properties with additional details.
-type DeploymentPropertiesExtended struct {
- // ProvisioningState - READ-ONLY; The state of the provisioning.
- ProvisioningState *string `json:"provisioningState,omitempty"`
- // CorrelationID - READ-ONLY; The correlation ID of the deployment.
- CorrelationID *string `json:"correlationId,omitempty"`
- // Timestamp - READ-ONLY; The timestamp of the template deployment.
- Timestamp *date.Time `json:"timestamp,omitempty"`
- // Outputs - Key/value pairs that represent deployment output.
- Outputs interface{} `json:"outputs,omitempty"`
- // Providers - The list of resource providers needed for the deployment.
- Providers *[]Provider `json:"providers,omitempty"`
- // Dependencies - The list of deployment dependencies.
- Dependencies *[]Dependency `json:"dependencies,omitempty"`
- // Template - The template content. Use only one of Template or TemplateLink.
- Template interface{} `json:"template,omitempty"`
- // TemplateLink - The URI referencing the template. Use only one of Template or TemplateLink.
- TemplateLink *TemplateLink `json:"templateLink,omitempty"`
- // Parameters - Deployment parameters. Use only one of Parameters or ParametersLink.
- Parameters interface{} `json:"parameters,omitempty"`
- // ParametersLink - The URI referencing the parameters. Use only one of Parameters or ParametersLink.
- ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
- // Mode - The deployment mode. Possible values are Incremental and Complete. Possible values include: 'Incremental', 'Complete'
- Mode DeploymentMode `json:"mode,omitempty"`
- // DebugSetting - The debug setting of the deployment.
- DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
- // OnErrorDeployment - The deployment on error behavior.
- OnErrorDeployment *OnErrorDeploymentExtended `json:"onErrorDeployment,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for DeploymentPropertiesExtended.
-func (dpe DeploymentPropertiesExtended) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if dpe.Outputs != nil {
- objectMap["outputs"] = dpe.Outputs
- }
- if dpe.Providers != nil {
- objectMap["providers"] = dpe.Providers
- }
- if dpe.Dependencies != nil {
- objectMap["dependencies"] = dpe.Dependencies
- }
- if dpe.Template != nil {
- objectMap["template"] = dpe.Template
- }
- if dpe.TemplateLink != nil {
- objectMap["templateLink"] = dpe.TemplateLink
- }
- if dpe.Parameters != nil {
- objectMap["parameters"] = dpe.Parameters
- }
- if dpe.ParametersLink != nil {
- objectMap["parametersLink"] = dpe.ParametersLink
- }
- if dpe.Mode != "" {
- objectMap["mode"] = dpe.Mode
- }
- if dpe.DebugSetting != nil {
- objectMap["debugSetting"] = dpe.DebugSetting
- }
- if dpe.OnErrorDeployment != nil {
- objectMap["onErrorDeployment"] = dpe.OnErrorDeployment
- }
- return json.Marshal(objectMap)
-}
-
-// DeploymentsCreateOrUpdateAtSubscriptionScopeFuture an abstraction for monitoring and retrieving the
-// results of a long-running operation.
-type DeploymentsCreateOrUpdateAtSubscriptionScopeFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(DeploymentsClient) (DeploymentExtended, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *DeploymentsCreateOrUpdateAtSubscriptionScopeFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for DeploymentsCreateOrUpdateAtSubscriptionScopeFuture.Result.
-func (future *DeploymentsCreateOrUpdateAtSubscriptionScopeFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- de.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
- de, err = client.CreateOrUpdateAtSubscriptionScopeResponder(de.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture", "Result", de.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type DeploymentsCreateOrUpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(DeploymentsClient) (DeploymentExtended, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *DeploymentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for DeploymentsCreateOrUpdateFuture.Result.
-func (future *DeploymentsCreateOrUpdateFuture) result(client DeploymentsClient) (de DeploymentExtended, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- de.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.DeploymentsCreateOrUpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
- de, err = client.CreateOrUpdateResponder(de.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", de.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// DeploymentsDeleteAtSubscriptionScopeFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type DeploymentsDeleteAtSubscriptionScopeFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(DeploymentsClient) (autorest.Response, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *DeploymentsDeleteAtSubscriptionScopeFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for DeploymentsDeleteAtSubscriptionScopeFuture.Result.
-func (future *DeploymentsDeleteAtSubscriptionScopeFuture) result(client DeploymentsClient) (ar autorest.Response, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteAtSubscriptionScopeFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- ar.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.DeploymentsDeleteAtSubscriptionScopeFuture")
- return
- }
- ar.Response = future.Response()
- return
-}
-
-// DeploymentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type DeploymentsDeleteFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(DeploymentsClient) (autorest.Response, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *DeploymentsDeleteFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for DeploymentsDeleteFuture.Result.
-func (future *DeploymentsDeleteFuture) result(client DeploymentsClient) (ar autorest.Response, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- ar.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.DeploymentsDeleteFuture")
- return
- }
- ar.Response = future.Response()
- return
-}
-
-// DeploymentValidateResult information from validate template deployment response.
-type DeploymentValidateResult struct {
- autorest.Response `json:"-"`
- // Error - Validation error.
- Error *ManagementErrorWithDetails `json:"error,omitempty"`
- // Properties - The template deployment properties.
- Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
-}
-
-// ErrorAdditionalInfo the resource management error additional info.
-type ErrorAdditionalInfo struct {
- // Type - READ-ONLY; The additional info type.
- Type *string `json:"type,omitempty"`
- // Info - READ-ONLY; The additional info.
- Info interface{} `json:"info,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
-func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// 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 ErrorResponse struct {
- // Code - READ-ONLY; The error code.
- Code *string `json:"code,omitempty"`
- // Message - READ-ONLY; The error message.
- Message *string `json:"message,omitempty"`
- // Target - READ-ONLY; The error target.
- Target *string `json:"target,omitempty"`
- // Details - READ-ONLY; The error details.
- Details *[]ErrorResponse `json:"details,omitempty"`
- // AdditionalInfo - READ-ONLY; The error additional info.
- AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ErrorResponse.
-func (er ErrorResponse) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// ExportTemplateRequest export resource group template request parameters.
-type ExportTemplateRequest struct {
- // ResourcesProperty - The IDs of the resources to filter the export by. To export all resources, supply an array with single entry '*'.
- ResourcesProperty *[]string `json:"resources,omitempty"`
- // Options - The export template options. A CSV-formatted list containing zero or more of the following: 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', 'SkipAllParameterization'
- Options *string `json:"options,omitempty"`
-}
-
-// GenericResource resource information.
-type GenericResource struct {
- autorest.Response `json:"-"`
- // Plan - The plan of the resource.
- Plan *Plan `json:"plan,omitempty"`
- // Properties - The resource properties.
- Properties interface{} `json:"properties,omitempty"`
- // Kind - The kind of the resource.
- Kind *string `json:"kind,omitempty"`
- // ManagedBy - ID of the resource that manages this resource.
- ManagedBy *string `json:"managedBy,omitempty"`
- // Sku - The SKU of the resource.
- Sku *Sku `json:"sku,omitempty"`
- // Identity - The identity of the resource.
- Identity *Identity `json:"identity,omitempty"`
- // ID - READ-ONLY; Resource ID
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for GenericResource.
-func (gr GenericResource) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if gr.Plan != nil {
- objectMap["plan"] = gr.Plan
- }
- if gr.Properties != nil {
- objectMap["properties"] = gr.Properties
- }
- if gr.Kind != nil {
- objectMap["kind"] = gr.Kind
- }
- if gr.ManagedBy != nil {
- objectMap["managedBy"] = gr.ManagedBy
- }
- if gr.Sku != nil {
- objectMap["sku"] = gr.Sku
- }
- if gr.Identity != nil {
- objectMap["identity"] = gr.Identity
- }
- if gr.Location != nil {
- objectMap["location"] = gr.Location
- }
- if gr.Tags != nil {
- objectMap["tags"] = gr.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// GenericResourceExpanded resource information.
-type GenericResourceExpanded struct {
- // CreatedTime - READ-ONLY; The created time of the resource. This is only present if requested via the $expand query parameter.
- CreatedTime *date.Time `json:"createdTime,omitempty"`
- // ChangedTime - READ-ONLY; The changed time of the resource. This is only present if requested via the $expand query parameter.
- ChangedTime *date.Time `json:"changedTime,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state of the resource. This is only present if requested via the $expand query parameter.
- ProvisioningState *string `json:"provisioningState,omitempty"`
- // Plan - The plan of the resource.
- Plan *Plan `json:"plan,omitempty"`
- // Properties - The resource properties.
- Properties interface{} `json:"properties,omitempty"`
- // Kind - The kind of the resource.
- Kind *string `json:"kind,omitempty"`
- // ManagedBy - ID of the resource that manages this resource.
- ManagedBy *string `json:"managedBy,omitempty"`
- // Sku - The SKU of the resource.
- Sku *Sku `json:"sku,omitempty"`
- // Identity - The identity of the resource.
- Identity *Identity `json:"identity,omitempty"`
- // ID - READ-ONLY; Resource ID
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for GenericResourceExpanded.
-func (gre GenericResourceExpanded) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if gre.Plan != nil {
- objectMap["plan"] = gre.Plan
- }
- if gre.Properties != nil {
- objectMap["properties"] = gre.Properties
- }
- if gre.Kind != nil {
- objectMap["kind"] = gre.Kind
- }
- if gre.ManagedBy != nil {
- objectMap["managedBy"] = gre.ManagedBy
- }
- if gre.Sku != nil {
- objectMap["sku"] = gre.Sku
- }
- if gre.Identity != nil {
- objectMap["identity"] = gre.Identity
- }
- if gre.Location != nil {
- objectMap["location"] = gre.Location
- }
- if gre.Tags != nil {
- objectMap["tags"] = gre.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// GenericResourceFilter resource filter.
-type GenericResourceFilter struct {
- // ResourceType - The resource type.
- ResourceType *string `json:"resourceType,omitempty"`
- // Tagname - The tag name.
- Tagname *string `json:"tagname,omitempty"`
- // Tagvalue - The tag value.
- Tagvalue *string `json:"tagvalue,omitempty"`
-}
-
-// Group resource group information.
-type Group struct {
- autorest.Response `json:"-"`
- // ID - READ-ONLY; The ID of the resource group.
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; The name of the resource group.
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; The type of the resource group.
- Type *string `json:"type,omitempty"`
- Properties *GroupProperties `json:"properties,omitempty"`
- // Location - The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
- Location *string `json:"location,omitempty"`
- // ManagedBy - The ID of the resource that manages this resource group.
- ManagedBy *string `json:"managedBy,omitempty"`
- // Tags - The tags attached to the resource group.
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for Group.
-func (g Group) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if g.Properties != nil {
- objectMap["properties"] = g.Properties
- }
- if g.Location != nil {
- objectMap["location"] = g.Location
- }
- if g.ManagedBy != nil {
- objectMap["managedBy"] = g.ManagedBy
- }
- if g.Tags != nil {
- objectMap["tags"] = g.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// GroupExportResult resource group export result.
-type GroupExportResult struct {
- autorest.Response `json:"-"`
- // Template - The template content.
- Template interface{} `json:"template,omitempty"`
- // Error - The error.
- Error *ManagementErrorWithDetails `json:"error,omitempty"`
-}
-
-// GroupFilter resource group filter.
-type GroupFilter struct {
- // TagName - The tag name.
- TagName *string `json:"tagName,omitempty"`
- // TagValue - The tag value.
- TagValue *string `json:"tagValue,omitempty"`
-}
-
-// GroupListResult list of resource groups.
-type GroupListResult struct {
- autorest.Response `json:"-"`
- // Value - An array of resource groups.
- Value *[]Group `json:"value,omitempty"`
- // NextLink - READ-ONLY; The URL to use for getting the next set of results.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for GroupListResult.
-func (glr GroupListResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if glr.Value != nil {
- objectMap["value"] = glr.Value
- }
- return json.Marshal(objectMap)
-}
-
-// GroupListResultIterator provides access to a complete listing of Group values.
-type GroupListResultIterator struct {
- i int
- page GroupListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *GroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *GroupListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter GroupListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter GroupListResultIterator) Response() GroupListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter GroupListResultIterator) Value() Group {
- if !iter.page.NotDone() {
- return Group{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the GroupListResultIterator type.
-func NewGroupListResultIterator(page GroupListResultPage) GroupListResultIterator {
- return GroupListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (glr GroupListResult) IsEmpty() bool {
- return glr.Value == nil || len(*glr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (glr GroupListResult) hasNextLink() bool {
- return glr.NextLink != nil && len(*glr.NextLink) != 0
-}
-
-// groupListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (glr GroupListResult) groupListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !glr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(glr.NextLink)))
-}
-
-// GroupListResultPage contains a page of Group values.
-type GroupListResultPage struct {
- fn func(context.Context, GroupListResult) (GroupListResult, error)
- glr GroupListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *GroupListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.glr)
- if err != nil {
- return err
- }
- page.glr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *GroupListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page GroupListResultPage) NotDone() bool {
- return !page.glr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page GroupListResultPage) Response() GroupListResult {
- return page.glr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page GroupListResultPage) Values() []Group {
- if page.glr.IsEmpty() {
- return nil
- }
- return *page.glr.Value
-}
-
-// Creates a new instance of the GroupListResultPage type.
-func NewGroupListResultPage(cur GroupListResult, getNextPage func(context.Context, GroupListResult) (GroupListResult, error)) GroupListResultPage {
- return GroupListResultPage{
- fn: getNextPage,
- glr: cur,
- }
-}
-
-// GroupPatchable resource group information.
-type GroupPatchable struct {
- // Name - The name of the resource group.
- Name *string `json:"name,omitempty"`
- Properties *GroupProperties `json:"properties,omitempty"`
- // ManagedBy - The ID of the resource that manages this resource group.
- ManagedBy *string `json:"managedBy,omitempty"`
- // Tags - The tags attached to the resource group.
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for GroupPatchable.
-func (gp GroupPatchable) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if gp.Name != nil {
- objectMap["name"] = gp.Name
- }
- if gp.Properties != nil {
- objectMap["properties"] = gp.Properties
- }
- if gp.ManagedBy != nil {
- objectMap["managedBy"] = gp.ManagedBy
- }
- if gp.Tags != nil {
- objectMap["tags"] = gp.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// GroupProperties the resource group properties.
-type GroupProperties struct {
- // ProvisioningState - READ-ONLY; The provisioning state.
- ProvisioningState *string `json:"provisioningState,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for GroupProperties.
-func (gp GroupProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// GroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
-type GroupsDeleteFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(GroupsClient) (autorest.Response, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *GroupsDeleteFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for GroupsDeleteFuture.Result.
-func (future *GroupsDeleteFuture) result(client GroupsClient) (ar autorest.Response, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.GroupsDeleteFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- ar.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.GroupsDeleteFuture")
- return
- }
- ar.Response = future.Response()
- return
-}
-
-// HTTPMessage HTTP message.
-type HTTPMessage struct {
- // Content - HTTP message content.
- Content interface{} `json:"content,omitempty"`
-}
-
-// Identity identity for the resource.
-type Identity struct {
- // PrincipalID - READ-ONLY; The principal ID of resource identity.
- PrincipalID *string `json:"principalId,omitempty"`
- // TenantID - READ-ONLY; The tenant ID of resource.
- TenantID *string `json:"tenantId,omitempty"`
- // Type - The identity type. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned', 'None'
- Type ResourceIdentityType `json:"type,omitempty"`
- // UserAssignedIdentities - The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
- UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"`
-}
-
-// MarshalJSON is the custom marshaler for Identity.
-func (i Identity) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if i.Type != "" {
- objectMap["type"] = i.Type
- }
- if i.UserAssignedIdentities != nil {
- objectMap["userAssignedIdentities"] = i.UserAssignedIdentities
- }
- return json.Marshal(objectMap)
-}
-
-// IdentityUserAssignedIdentitiesValue ...
-type IdentityUserAssignedIdentitiesValue struct {
- // PrincipalID - READ-ONLY; The principal id of user assigned identity.
- PrincipalID *string `json:"principalId,omitempty"`
- // ClientID - READ-ONLY; The client id of user assigned identity.
- ClientID *string `json:"clientId,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for IdentityUserAssignedIdentitiesValue.
-func (iAiv IdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// ListResult list of resource groups.
-type ListResult struct {
- autorest.Response `json:"-"`
- // Value - An array of resources.
- Value *[]GenericResourceExpanded `json:"value,omitempty"`
- // NextLink - READ-ONLY; The URL to use for getting the next set of results.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ListResult.
-func (lr ListResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if lr.Value != nil {
- objectMap["value"] = lr.Value
- }
- return json.Marshal(objectMap)
-}
-
-// ListResultIterator provides access to a complete listing of GenericResourceExpanded values.
-type ListResultIterator struct {
- i int
- page ListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *ListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ListResultIterator) Response() ListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ListResultIterator) Value() GenericResourceExpanded {
- if !iter.page.NotDone() {
- return GenericResourceExpanded{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the ListResultIterator type.
-func NewListResultIterator(page ListResultPage) ListResultIterator {
- return ListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (lr ListResult) IsEmpty() bool {
- return lr.Value == nil || len(*lr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (lr ListResult) hasNextLink() bool {
- return lr.NextLink != nil && len(*lr.NextLink) != 0
-}
-
-// listResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) {
- if !lr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(lr.NextLink)))
-}
-
-// ListResultPage contains a page of GenericResourceExpanded values.
-type ListResultPage struct {
- fn func(context.Context, ListResult) (ListResult, error)
- lr ListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.lr)
- if err != nil {
- return err
- }
- page.lr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *ListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ListResultPage) NotDone() bool {
- return !page.lr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ListResultPage) Response() ListResult {
- return page.lr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ListResultPage) Values() []GenericResourceExpanded {
- if page.lr.IsEmpty() {
- return nil
- }
- return *page.lr.Value
-}
-
-// Creates a new instance of the ListResultPage type.
-func NewListResultPage(cur ListResult, getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage {
- return ListResultPage{
- fn: getNextPage,
- lr: cur,
- }
-}
-
-// ManagementErrorWithDetails the detailed error message of resource management.
-type ManagementErrorWithDetails struct {
- // Code - READ-ONLY; The error code returned when exporting the template.
- Code *string `json:"code,omitempty"`
- // Message - READ-ONLY; The error message describing the export error.
- Message *string `json:"message,omitempty"`
- // Target - READ-ONLY; The target of the error.
- Target *string `json:"target,omitempty"`
- // Details - READ-ONLY; Validation error.
- Details *[]ManagementErrorWithDetails `json:"details,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ManagementErrorWithDetails.
-func (mewd ManagementErrorWithDetails) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// MoveInfo parameters of move resources.
-type MoveInfo struct {
- // ResourcesProperty - The IDs of the resources.
- ResourcesProperty *[]string `json:"resources,omitempty"`
- // TargetResourceGroup - The target resource group.
- TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
-}
-
-// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type MoveResourcesFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(Client) (autorest.Response, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *MoveResourcesFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for MoveResourcesFuture.Result.
-func (future *MoveResourcesFuture) result(client Client) (ar autorest.Response, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.MoveResourcesFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- ar.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.MoveResourcesFuture")
- return
- }
- ar.Response = future.Response()
- return
-}
-
-// OnErrorDeployment deployment on error behavior.
-type OnErrorDeployment struct {
- // Type - The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. Possible values include: 'LastSuccessful', 'SpecificDeployment'
- Type OnErrorDeploymentType `json:"type,omitempty"`
- // DeploymentName - The deployment to be used on error case.
- DeploymentName *string `json:"deploymentName,omitempty"`
-}
-
-// OnErrorDeploymentExtended deployment on error behavior with additional details.
-type OnErrorDeploymentExtended struct {
- // ProvisioningState - READ-ONLY; The state of the provisioning for the on error deployment.
- ProvisioningState *string `json:"provisioningState,omitempty"`
- // Type - The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. Possible values include: 'LastSuccessful', 'SpecificDeployment'
- Type OnErrorDeploymentType `json:"type,omitempty"`
- // DeploymentName - The deployment to be used on error case.
- DeploymentName *string `json:"deploymentName,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for OnErrorDeploymentExtended.
-func (oede OnErrorDeploymentExtended) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if oede.Type != "" {
- objectMap["type"] = oede.Type
- }
- if oede.DeploymentName != nil {
- objectMap["deploymentName"] = oede.DeploymentName
- }
- return json.Marshal(objectMap)
-}
-
-// Operation microsoft.Resources operation
-type Operation struct {
- // Name - Operation name: {provider}/{resource}/{operation}
- Name *string `json:"name,omitempty"`
- // Display - The object that represents the operation.
- Display *OperationDisplay `json:"display,omitempty"`
-}
-
-// OperationDisplay the object that represents the operation.
-type OperationDisplay struct {
- // Provider - Service provider: Microsoft.Resources
- Provider *string `json:"provider,omitempty"`
- // Resource - Resource on which the operation is performed: Profile, endpoint, etc.
- Resource *string `json:"resource,omitempty"`
- // Operation - Operation type: Read, write, delete, etc.
- Operation *string `json:"operation,omitempty"`
- // Description - Description of the operation.
- Description *string `json:"description,omitempty"`
-}
-
-// OperationListResult result of the request to list Microsoft.Resources operations. It contains a list of
-// operations and a URL link to get the next set of results.
-type OperationListResult struct {
- autorest.Response `json:"-"`
- // Value - List of Microsoft.Resources operations.
- Value *[]Operation `json:"value,omitempty"`
- // NextLink - URL to get the next set of operation list results if there are any.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// OperationListResultIterator provides access to a complete listing of Operation values.
-type OperationListResultIterator struct {
- i int
- page OperationListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *OperationListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter OperationListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter OperationListResultIterator) Response() OperationListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter OperationListResultIterator) Value() Operation {
- if !iter.page.NotDone() {
- return Operation{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the OperationListResultIterator type.
-func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
- return OperationListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (olr OperationListResult) IsEmpty() bool {
- return olr.Value == nil || len(*olr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (olr OperationListResult) hasNextLink() bool {
- return olr.NextLink != nil && len(*olr.NextLink) != 0
-}
-
-// operationListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !olr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(olr.NextLink)))
-}
-
-// OperationListResultPage contains a page of Operation values.
-type OperationListResultPage struct {
- fn func(context.Context, OperationListResult) (OperationListResult, error)
- olr OperationListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.olr)
- if err != nil {
- return err
- }
- page.olr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *OperationListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page OperationListResultPage) NotDone() bool {
- return !page.olr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page OperationListResultPage) Response() OperationListResult {
- return page.olr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page OperationListResultPage) Values() []Operation {
- if page.olr.IsEmpty() {
- return nil
- }
- return *page.olr.Value
-}
-
-// Creates a new instance of the OperationListResultPage type.
-func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
- return OperationListResultPage{
- fn: getNextPage,
- olr: cur,
- }
-}
-
-// ParametersLink entity representing the reference to the deployment parameters.
-type ParametersLink struct {
- // URI - The URI of the parameters file.
- URI *string `json:"uri,omitempty"`
- // ContentVersion - If included, must match the ContentVersion in the template.
- ContentVersion *string `json:"contentVersion,omitempty"`
-}
-
-// Plan plan for the resource.
-type Plan struct {
- // Name - The plan ID.
- Name *string `json:"name,omitempty"`
- // Publisher - The publisher ID.
- Publisher *string `json:"publisher,omitempty"`
- // Product - The offer ID.
- Product *string `json:"product,omitempty"`
- // PromotionCode - The promotion code.
- PromotionCode *string `json:"promotionCode,omitempty"`
- // Version - The plan's version.
- Version *string `json:"version,omitempty"`
-}
-
-// Provider resource provider information.
-type Provider struct {
- autorest.Response `json:"-"`
- // ID - READ-ONLY; The provider ID.
- ID *string `json:"id,omitempty"`
- // Namespace - The namespace of the resource provider.
- Namespace *string `json:"namespace,omitempty"`
- // RegistrationState - READ-ONLY; The registration state of the provider.
- RegistrationState *string `json:"registrationState,omitempty"`
- // ResourceTypes - READ-ONLY; The collection of provider resource types.
- ResourceTypes *[]ProviderResourceType `json:"resourceTypes,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for Provider.
-func (p Provider) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if p.Namespace != nil {
- objectMap["namespace"] = p.Namespace
- }
- return json.Marshal(objectMap)
-}
-
-// ProviderListResult list of resource providers.
-type ProviderListResult struct {
- autorest.Response `json:"-"`
- // Value - An array of resource providers.
- Value *[]Provider `json:"value,omitempty"`
- // NextLink - READ-ONLY; The URL to use for getting the next set of results.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ProviderListResult.
-func (plr ProviderListResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if plr.Value != nil {
- objectMap["value"] = plr.Value
- }
- return json.Marshal(objectMap)
-}
-
-// ProviderListResultIterator provides access to a complete listing of Provider values.
-type ProviderListResultIterator struct {
- i int
- page ProviderListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ProviderListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ProviderListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *ProviderListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ProviderListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ProviderListResultIterator) Response() ProviderListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ProviderListResultIterator) Value() Provider {
- if !iter.page.NotDone() {
- return Provider{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the ProviderListResultIterator type.
-func NewProviderListResultIterator(page ProviderListResultPage) ProviderListResultIterator {
- return ProviderListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (plr ProviderListResult) IsEmpty() bool {
- return plr.Value == nil || len(*plr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (plr ProviderListResult) hasNextLink() bool {
- return plr.NextLink != nil && len(*plr.NextLink) != 0
-}
-
-// providerListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (plr ProviderListResult) providerListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !plr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(plr.NextLink)))
-}
-
-// ProviderListResultPage contains a page of Provider values.
-type ProviderListResultPage struct {
- fn func(context.Context, ProviderListResult) (ProviderListResult, error)
- plr ProviderListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *ProviderListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ProviderListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.plr)
- if err != nil {
- return err
- }
- page.plr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *ProviderListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ProviderListResultPage) NotDone() bool {
- return !page.plr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page ProviderListResultPage) Response() ProviderListResult {
- return page.plr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page ProviderListResultPage) Values() []Provider {
- if page.plr.IsEmpty() {
- return nil
- }
- return *page.plr.Value
-}
-
-// Creates a new instance of the ProviderListResultPage type.
-func NewProviderListResultPage(cur ProviderListResult, getNextPage func(context.Context, ProviderListResult) (ProviderListResult, error)) ProviderListResultPage {
- return ProviderListResultPage{
- fn: getNextPage,
- plr: cur,
- }
-}
-
-// ProviderOperationDisplayProperties resource provider operation's display properties.
-type ProviderOperationDisplayProperties struct {
- // Publisher - Operation description.
- Publisher *string `json:"publisher,omitempty"`
- // Provider - Operation provider.
- Provider *string `json:"provider,omitempty"`
- // Resource - Operation resource.
- Resource *string `json:"resource,omitempty"`
- // Operation - Resource provider operation.
- Operation *string `json:"operation,omitempty"`
- // Description - Operation description.
- Description *string `json:"description,omitempty"`
-}
-
-// ProviderResourceType resource type managed by the resource provider.
-type ProviderResourceType struct {
- // ResourceType - The resource type.
- ResourceType *string `json:"resourceType,omitempty"`
- // Locations - The collection of locations where this resource type can be created.
- Locations *[]string `json:"locations,omitempty"`
- // Aliases - The aliases that are supported by this resource type.
- Aliases *[]AliasType `json:"aliases,omitempty"`
- // APIVersions - The API version.
- APIVersions *[]string `json:"apiVersions,omitempty"`
- // Properties - The properties.
- Properties map[string]*string `json:"properties"`
-}
-
-// MarshalJSON is the custom marshaler for ProviderResourceType.
-func (prt ProviderResourceType) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if prt.ResourceType != nil {
- objectMap["resourceType"] = prt.ResourceType
- }
- if prt.Locations != nil {
- objectMap["locations"] = prt.Locations
- }
- if prt.Aliases != nil {
- objectMap["aliases"] = prt.Aliases
- }
- if prt.APIVersions != nil {
- objectMap["apiVersions"] = prt.APIVersions
- }
- if prt.Properties != nil {
- objectMap["properties"] = prt.Properties
- }
- return json.Marshal(objectMap)
-}
-
-// Resource specified resource.
-type Resource struct {
- // ID - READ-ONLY; Resource ID
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for Resource.
-func (r Resource) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if r.Location != nil {
- objectMap["location"] = r.Location
- }
- if r.Tags != nil {
- objectMap["tags"] = r.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// Sku SKU for the resource.
-type Sku struct {
- // Name - The SKU name.
- Name *string `json:"name,omitempty"`
- // Tier - The SKU tier.
- Tier *string `json:"tier,omitempty"`
- // Size - The SKU size.
- Size *string `json:"size,omitempty"`
- // Family - The SKU family.
- Family *string `json:"family,omitempty"`
- // Model - The SKU model.
- Model *string `json:"model,omitempty"`
- // Capacity - The SKU capacity.
- Capacity *int32 `json:"capacity,omitempty"`
-}
-
-// SubResource sub-resource.
-type SubResource struct {
- // ID - Resource ID
- ID *string `json:"id,omitempty"`
-}
-
-// TagCount tag count.
-type TagCount struct {
- // Type - Type of count.
- Type *string `json:"type,omitempty"`
- // Value - Value of count.
- Value *int32 `json:"value,omitempty"`
-}
-
-// TagDetails tag details.
-type TagDetails struct {
- autorest.Response `json:"-"`
- // ID - READ-ONLY; The tag ID.
- ID *string `json:"id,omitempty"`
- // TagName - The tag name.
- TagName *string `json:"tagName,omitempty"`
- // Count - The total number of resources that use the resource tag. When a tag is initially created and has no associated resources, the value is 0.
- Count *TagCount `json:"count,omitempty"`
- // Values - The list of tag values.
- Values *[]TagValue `json:"values,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for TagDetails.
-func (td TagDetails) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if td.TagName != nil {
- objectMap["tagName"] = td.TagName
- }
- if td.Count != nil {
- objectMap["count"] = td.Count
- }
- if td.Values != nil {
- objectMap["values"] = td.Values
- }
- return json.Marshal(objectMap)
-}
-
-// TagsListResult list of subscription tags.
-type TagsListResult struct {
- autorest.Response `json:"-"`
- // Value - An array of tags.
- Value *[]TagDetails `json:"value,omitempty"`
- // NextLink - READ-ONLY; The URL to use for getting the next set of results.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for TagsListResult.
-func (tlr TagsListResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if tlr.Value != nil {
- objectMap["value"] = tlr.Value
- }
- return json.Marshal(objectMap)
-}
-
-// TagsListResultIterator provides access to a complete listing of TagDetails values.
-type TagsListResultIterator struct {
- i int
- page TagsListResultPage
-}
-
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *TagsListResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/TagsListResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
- }
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
- }
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *TagsListResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter TagsListResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter TagsListResultIterator) Response() TagsListResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter TagsListResultIterator) Value() TagDetails {
- if !iter.page.NotDone() {
- return TagDetails{}
- }
- return iter.page.Values()[iter.i]
-}
-
-// Creates a new instance of the TagsListResultIterator type.
-func NewTagsListResultIterator(page TagsListResultPage) TagsListResultIterator {
- return TagsListResultIterator{page: page}
-}
-
-// IsEmpty returns true if the ListResult contains no values.
-func (tlr TagsListResult) IsEmpty() bool {
- return tlr.Value == nil || len(*tlr.Value) == 0
-}
-
-// hasNextLink returns true if the NextLink is not empty.
-func (tlr TagsListResult) hasNextLink() bool {
- return tlr.NextLink != nil && len(*tlr.NextLink) != 0
-}
-
-// tagsListResultPreparer prepares a request to retrieve the next set of results.
-// It returns nil if no more results exist.
-func (tlr TagsListResult) tagsListResultPreparer(ctx context.Context) (*http.Request, error) {
- if !tlr.hasNextLink() {
- return nil, nil
- }
- return autorest.Prepare((&http.Request{}).WithContext(ctx),
- autorest.AsJSON(),
- autorest.AsGet(),
- autorest.WithBaseURL(to.String(tlr.NextLink)))
-}
-
-// TagsListResultPage contains a page of TagDetails values.
-type TagsListResultPage struct {
- fn func(context.Context, TagsListResult) (TagsListResult, error)
- tlr TagsListResult
-}
-
-// NextWithContext advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-func (page *TagsListResultPage) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/TagsListResultPage.NextWithContext")
- defer func() {
- sc := -1
- if page.Response().Response.Response != nil {
- sc = page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- for {
- next, err := page.fn(ctx, page.tlr)
- if err != nil {
- return err
- }
- page.tlr = next
- if !next.hasNextLink() || !next.IsEmpty() {
- break
- }
- }
- return nil
-}
-
-// Next advances to the next page of values. If there was an error making
-// the request the page does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (page *TagsListResultPage) Next() error {
- return page.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page TagsListResultPage) NotDone() bool {
- return !page.tlr.IsEmpty()
-}
-
-// Response returns the raw server response from the last page request.
-func (page TagsListResultPage) Response() TagsListResult {
- return page.tlr
-}
-
-// Values returns the slice of values for the current page or nil if there are no values.
-func (page TagsListResultPage) Values() []TagDetails {
- if page.tlr.IsEmpty() {
- return nil
- }
- return *page.tlr.Value
-}
-
-// Creates a new instance of the TagsListResultPage type.
-func NewTagsListResultPage(cur TagsListResult, getNextPage func(context.Context, TagsListResult) (TagsListResult, error)) TagsListResultPage {
- return TagsListResultPage{
- fn: getNextPage,
- tlr: cur,
- }
-}
-
-// TagValue tag information.
-type TagValue struct {
- autorest.Response `json:"-"`
- // ID - READ-ONLY; The tag ID.
- ID *string `json:"id,omitempty"`
- // TagValue - The tag value.
- TagValue *string `json:"tagValue,omitempty"`
- // Count - The tag value count.
- Count *TagCount `json:"count,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for TagValue.
-func (tv TagValue) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if tv.TagValue != nil {
- objectMap["tagValue"] = tv.TagValue
- }
- if tv.Count != nil {
- objectMap["count"] = tv.Count
- }
- return json.Marshal(objectMap)
-}
-
-// TargetResource target resource.
-type TargetResource struct {
- // ID - The ID of the resource.
- ID *string `json:"id,omitempty"`
- // ResourceName - The name of the resource.
- ResourceName *string `json:"resourceName,omitempty"`
- // ResourceType - The type of the resource.
- ResourceType *string `json:"resourceType,omitempty"`
-}
-
-// TemplateHashResult result of the request to calculate template hash. It contains a string of minified
-// template and its hash.
-type TemplateHashResult struct {
- autorest.Response `json:"-"`
- // MinifiedTemplate - The minified template string.
- MinifiedTemplate *string `json:"minifiedTemplate,omitempty"`
- // TemplateHash - The template hash.
- TemplateHash *string `json:"templateHash,omitempty"`
-}
-
-// TemplateLink entity representing the reference to the template.
-type TemplateLink struct {
- // URI - The URI of the template to deploy.
- URI *string `json:"uri,omitempty"`
- // ContentVersion - If included, must match the ContentVersion in the template.
- ContentVersion *string `json:"contentVersion,omitempty"`
-}
-
-// UpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation.
-type UpdateByIDFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(Client) (GenericResource, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *UpdateByIDFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for UpdateByIDFuture.Result.
-func (future *UpdateByIDFuture) result(client Client) (gr GenericResource, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- gr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.UpdateByIDFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
- gr, err = client.UpdateByIDResponder(gr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
-type UpdateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(Client) (GenericResource, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *UpdateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for UpdateFuture.Result.
-func (future *UpdateFuture) result(client Client) (gr GenericResource, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- gr.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.UpdateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
- gr, err = client.UpdateResponder(gr.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// ValidateMoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type ValidateMoveResourcesFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(Client) (autorest.Response, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *ValidateMoveResourcesFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for ValidateMoveResourcesFuture.Result.
-func (future *ValidateMoveResourcesFuture) result(client Client) (ar autorest.Response, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.ValidateMoveResourcesFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- ar.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("resources.ValidateMoveResourcesFuture")
- return
- }
- ar.Response = future.Response()
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/operations.go
deleted file mode 100644
index a537283e5..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/operations.go
+++ /dev/null
@@ -1,140 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// OperationsClient is the provides operations for working with resources and resource groups.
-type OperationsClient struct {
- BaseClient
-}
-
-// NewOperationsClient creates an instance of the OperationsClient client.
-func NewOperationsClient(subscriptionID string) OperationsClient {
- return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this
-// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
- return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// List lists all of the available Microsoft.Resources REST API operations.
-func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List")
- defer func() {
- sc := -1
- if result.olr.Response.Response != nil {
- sc = result.olr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.OperationsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.olr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.OperationsClient", "List", resp, "Failure sending request")
- return
- }
-
- result.olr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.OperationsClient", "List", resp, "Failure responding to request")
- return
- }
- if result.olr.hasNextLink() && result.olr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/providers/Microsoft.Resources/operations"),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) {
- req, err := lastResults.operationListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources.OperationsClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources.OperationsClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.OperationsClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx)
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/providers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/providers.go
deleted file mode 100644
index 409c4917a..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/providers.go
+++ /dev/null
@@ -1,382 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// ProvidersClient is the provides operations for working with resources and resource groups.
-type ProvidersClient struct {
- BaseClient
-}
-
-// NewProvidersClient creates an instance of the ProvidersClient client.
-func NewProvidersClient(subscriptionID string) ProvidersClient {
- return NewProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewProvidersClientWithBaseURI creates an instance of the ProvidersClient client using a custom endpoint. Use this
-// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewProvidersClientWithBaseURI(baseURI string, subscriptionID string) ProvidersClient {
- return ProvidersClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get gets the specified resource provider.
-// Parameters:
-// resourceProviderNamespace - the namespace of the resource provider.
-// expand - the $expand query parameter. For example, to include property aliases in response, use
-// $expand=resourceTypes/aliases.
-func (client ProvidersClient) Get(ctx context.Context, resourceProviderNamespace string, expand string) (result Provider, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ProvidersClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, resourceProviderNamespace, expand)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client ProvidersClient) GetPreparer(ctx context.Context, resourceProviderNamespace string, expand string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client ProvidersClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client ProvidersClient) GetResponder(resp *http.Response) (result Provider, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List gets all resource providers for a subscription.
-// Parameters:
-// top - the number of results to return. If null is passed returns all deployments.
-// expand - the properties to include in the results. For example, use &$expand=metadata in the query string to
-// retrieve resource provider metadata. To include property aliases in response, use
-// $expand=resourceTypes/aliases.
-func (client ProvidersClient) List(ctx context.Context, top *int32, expand string) (result ProviderListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ProvidersClient.List")
- defer func() {
- sc := -1
- if result.plr.Response.Response != nil {
- sc = result.plr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, top, expand)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.plr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", resp, "Failure sending request")
- return
- }
-
- result.plr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", resp, "Failure responding to request")
- return
- }
- if result.plr.hasNextLink() && result.plr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client ProvidersClient) ListPreparer(ctx context.Context, top *int32, expand string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if top != nil {
- queryParameters["$top"] = autorest.Encode("query", *top)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client ProvidersClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client ProvidersClient) ListResponder(resp *http.Response) (result ProviderListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client ProvidersClient) listNextResults(ctx context.Context, lastResults ProviderListResult) (result ProviderListResult, err error) {
- req, err := lastResults.providerListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client ProvidersClient) ListComplete(ctx context.Context, top *int32, expand string) (result ProviderListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ProvidersClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx, top, expand)
- return
-}
-
-// Register registers a subscription with a resource provider.
-// Parameters:
-// resourceProviderNamespace - the namespace of the resource provider to register.
-func (client ProvidersClient) Register(ctx context.Context, resourceProviderNamespace string) (result Provider, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ProvidersClient.Register")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.RegisterPreparer(ctx, resourceProviderNamespace)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Register", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RegisterSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Register", resp, "Failure sending request")
- return
- }
-
- result, err = client.RegisterResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Register", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// RegisterPreparer prepares the Register request.
-func (client ProvidersClient) RegisterPreparer(ctx context.Context, resourceProviderNamespace string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RegisterSender sends the Register request. The method will close the
-// http.Response Body if it receives an error.
-func (client ProvidersClient) RegisterSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// RegisterResponder handles the response to the Register request. The method always
-// closes the http.Response Body.
-func (client ProvidersClient) RegisterResponder(resp *http.Response) (result Provider, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Unregister unregisters a subscription from a resource provider.
-// Parameters:
-// resourceProviderNamespace - the namespace of the resource provider to unregister.
-func (client ProvidersClient) Unregister(ctx context.Context, resourceProviderNamespace string) (result Provider, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ProvidersClient.Unregister")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.UnregisterPreparer(ctx, resourceProviderNamespace)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Unregister", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UnregisterSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Unregister", resp, "Failure sending request")
- return
- }
-
- result, err = client.UnregisterResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "Unregister", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// UnregisterPreparer prepares the Unregister request.
-func (client ProvidersClient) UnregisterPreparer(ctx context.Context, resourceProviderNamespace string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UnregisterSender sends the Unregister request. The method will close the
-// http.Response Body if it receives an error.
-func (client ProvidersClient) UnregisterSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// UnregisterResponder handles the response to the Unregister request. The method always
-// closes the http.Response Body.
-func (client ProvidersClient) UnregisterResponder(resp *http.Response) (result Provider, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/resources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/resources.go
deleted file mode 100644
index 0edce8e64..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/resources.go
+++ /dev/null
@@ -1,1360 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// Client is the provides operations for working with resources and resource groups.
-type Client struct {
- BaseClient
-}
-
-// NewClient creates an instance of the Client client.
-func NewClient(subscriptionID string) Client {
- return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewClientWithBaseURI creates an instance of the Client client using a custom endpoint. Use this when interacting
-// with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
- return Client{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CheckExistence checks whether a resource exists.
-// Parameters:
-// resourceGroupName - the name of the resource group containing the resource to check. The name is case
-// insensitive.
-// resourceProviderNamespace - the resource provider of the resource to check.
-// parentResourcePath - the parent resource identity.
-// resourceType - the resource type.
-// resourceName - the name of the resource to check whether it exists.
-// APIVersion - the API version to use for the operation.
-func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result autorest.Response, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistence")
- defer func() {
- sc := -1
- if result.Response != nil {
- sc = result.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.Client", "CheckExistence", err.Error())
- }
-
- req, err := client.CheckExistencePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CheckExistenceSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", resp, "Failure sending request")
- return
- }
-
- result, err = client.CheckExistenceResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CheckExistencePreparer prepares the CheckExistence request.
-func (client Client) CheckExistencePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "resourceName": autorest.Encode("path", resourceName),
- "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CheckExistenceSender sends the CheckExistence request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) CheckExistenceSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// CheckExistenceResponder handles the response to the CheckExistence request. The method always
-// closes the http.Response Body.
-func (client Client) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CheckExistenceByID checks by ID whether a resource exists.
-// Parameters:
-// resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the
-// format,
-// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
-// APIVersion - the API version to use for the operation.
-func (client Client) CheckExistenceByID(ctx context.Context, resourceID string, APIVersion string) (result autorest.Response, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.CheckExistenceByID")
- defer func() {
- sc := -1
- if result.Response != nil {
- sc = result.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.CheckExistenceByIDPreparer(ctx, resourceID, APIVersion)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistenceByID", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CheckExistenceByIDSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistenceByID", resp, "Failure sending request")
- return
- }
-
- result, err = client.CheckExistenceByIDResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "CheckExistenceByID", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CheckExistenceByIDPreparer prepares the CheckExistenceByID request.
-func (client Client) CheckExistenceByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceId": resourceID,
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsHead(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/{resourceId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CheckExistenceByIDSender sends the CheckExistenceByID request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) CheckExistenceByIDSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// CheckExistenceByIDResponder handles the response to the CheckExistenceByID request. The method always
-// closes the http.Response Body.
-func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// CreateOrUpdate creates a resource.
-// Parameters:
-// resourceGroupName - the name of the resource group for the resource. The name is case insensitive.
-// resourceProviderNamespace - the namespace of the resource provider.
-// parentResourcePath - the parent resource identity.
-// resourceType - the resource type of the resource to create.
-// resourceName - the name of the resource to create.
-// APIVersion - the API version to use for the operation.
-// parameters - parameters for creating or updating the resource.
-func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result CreateOrUpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}},
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.Kind", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Kind", Name: validation.Pattern, Rule: `^[-\w\._,\(\)]+$`, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("resources.Client", "CreateOrUpdate", err.Error())
- }
-
- req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateOrUpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "resourceName": autorest.Encode("path", resourceName),
- "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) CreateOrUpdateSender(req *http.Request) (future CreateOrUpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client Client) CreateOrUpdateResponder(resp *http.Response) (result GenericResource, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateOrUpdateByID create a resource by ID.
-// Parameters:
-// resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the
-// format,
-// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
-// APIVersion - the API version to use for the operation.
-// parameters - create or update resource parameters.
-func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdateByID")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.Kind", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Kind", Name: validation.Pattern, Rule: `^[-\w\._,\(\)]+$`, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("resources.Client", "CreateOrUpdateByID", err.Error())
- }
-
- req, err := client.CreateOrUpdateByIDPreparer(ctx, resourceID, APIVersion, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdateByID", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateOrUpdateByIDSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdateByID", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreateOrUpdateByIDPreparer prepares the CreateOrUpdateByID request.
-func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceId": resourceID,
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/{resourceId}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateByIDSender sends the CreateOrUpdateByID request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) CreateOrUpdateByIDSender(req *http.Request) (future CreateOrUpdateByIDFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateOrUpdateByIDResponder handles the response to the CreateOrUpdateByID request. The method always
-// closes the http.Response Body.
-func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result GenericResource, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes a resource.
-// Parameters:
-// resourceGroupName - the name of the resource group that contains the resource to delete. The name is case
-// insensitive.
-// resourceProviderNamespace - the namespace of the resource provider.
-// parentResourcePath - the parent resource identity.
-// resourceType - the resource type.
-// resourceName - the name of the resource to delete.
-// APIVersion - the API version to use for the operation.
-func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result DeleteFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.Client", "Delete", err.Error())
- }
-
- req, err := client.DeletePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "Delete", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "resourceName": autorest.Encode("path", resourceName),
- "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteByID deletes a resource by ID.
-// Parameters:
-// resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the
-// format,
-// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
-// APIVersion - the API version to use for the operation.
-func (client Client) DeleteByID(ctx context.Context, resourceID string, APIVersion string) (result DeleteByIDFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteByID")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeleteByIDPreparer(ctx, resourceID, APIVersion)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "DeleteByID", nil, "Failure preparing request")
- return
- }
-
- result, err = client.DeleteByIDSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "DeleteByID", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// DeleteByIDPreparer prepares the DeleteByID request.
-func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceId": resourceID,
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/{resourceId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteByIDSender sends the DeleteByID request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) DeleteByIDSender(req *http.Request) (future DeleteByIDFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// DeleteByIDResponder handles the response to the DeleteByID request. The method always
-// closes the http.Response Body.
-func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Get gets a resource.
-// Parameters:
-// resourceGroupName - the name of the resource group containing the resource to get. The name is case
-// insensitive.
-// resourceProviderNamespace - the namespace of the resource provider.
-// parentResourcePath - the parent resource identity.
-// resourceType - the resource type of the resource.
-// resourceName - the name of the resource to get.
-// APIVersion - the API version to use for the operation.
-func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (result GenericResource, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.Client", "Get", err.Error())
- }
-
- req, err := client.GetPreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.Client", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "resourceName": autorest.Encode("path", resourceName),
- "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client Client) GetResponder(resp *http.Response) (result GenericResource, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// GetByID gets a resource by ID.
-// Parameters:
-// resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the
-// format,
-// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
-// APIVersion - the API version to use for the operation.
-func (client Client) GetByID(ctx context.Context, resourceID string, APIVersion string) (result GenericResource, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetByID")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetByIDPreparer(ctx, resourceID, APIVersion)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "GetByID", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetByIDSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.Client", "GetByID", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetByIDResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "GetByID", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetByIDPreparer prepares the GetByID request.
-func (client Client) GetByIDPreparer(ctx context.Context, resourceID string, APIVersion string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceId": resourceID,
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/{resourceId}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetByIDSender sends the GetByID request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) GetByIDSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// GetByIDResponder handles the response to the GetByID request. The method always
-// closes the http.Response Body.
-func (client Client) GetByIDResponder(resp *http.Response) (result GenericResource, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List get all the resources in a subscription.
-// Parameters:
-// filter - the filter to apply on the operation.
The properties you can use for eq (equals) or ne (not
-// equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan,
-// plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.
For example, to filter
-// by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
You can use
-// substringof(value, property) in the filter. The properties you can use for substring are: name and
-// resourceGroup.
For example, to get all resources with 'demo' anywhere in the name, use:
-// $filter=substringof('demo', name)
You can link more than one substringof together by adding and/or
-// operators.
You can filter by tag names and values. For example, to filter for a tag name and value,
-// use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
You can use some properties together when
-// filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and
-// plan/name, identity and identity/principalId.
-// expand - comma-separated list of additional properties to be included in the response. Valid values include
-// `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
-// top - the number of results to return. If null is passed, returns all resource groups.
-func (client Client) List(ctx context.Context, filter string, expand string, top *int32) (result ListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.List")
- defer func() {
- sc := -1
- if result.lr.Response.Response != nil {
- sc = result.lr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx, filter, expand, top)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.lr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.Client", "List", resp, "Failure sending request")
- return
- }
-
- result.lr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "List", resp, "Failure responding to request")
- return
- }
- if result.lr.hasNextLink() && result.lr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client Client) ListPreparer(ctx context.Context, filter string, expand string, top *int32) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if top != nil {
- queryParameters["$top"] = autorest.Encode("query", *top)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resources", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client Client) ListResponder(resp *http.Response) (result ListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client Client) listNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) {
- req, err := lastResults.listResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources.Client", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources.Client", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client Client) ListComplete(ctx context.Context, filter string, expand string, top *int32) (result ListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx, filter, expand, top)
- return
-}
-
-// ListByResourceGroup get all the resources for a resource group.
-// Parameters:
-// resourceGroupName - the resource group with the resources to get.
-// filter - the filter to apply on the operation.
The properties you can use for eq (equals) or ne (not
-// equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan,
-// plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.
For example, to filter
-// by a resource type, use: $filter=resourceType eq 'Microsoft.Network/virtualNetworks'
You can use
-// substringof(value, property) in the filter. The properties you can use for substring are: name and
-// resourceGroup.
For example, to get all resources with 'demo' anywhere in the name, use:
-// $filter=substringof('demo', name)
You can link more than one substringof together by adding and/or
-// operators.
You can filter by tag names and values. For example, to filter for a tag name and value,
-// use $filter=tagName eq 'tag1' and tagValue eq 'Value1'
You can use some properties together when
-// filtering. The combinations you can use are: substringof and/or resourceType, plan and plan/publisher and
-// plan/name, identity and identity/principalId.
-// expand - comma-separated list of additional properties to be included in the response. Valid values include
-// `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`.
-// top - the number of results to return. If null is passed, returns all resources.
-func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result ListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup")
- defer func() {
- sc := -1
- if result.lr.Response.Response != nil {
- sc = result.lr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.Client", "ListByResourceGroup", err.Error())
- }
-
- result.fn = client.listByResourceGroupNextResults
- req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, expand, top)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "ListByResourceGroup", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.lr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.Client", "ListByResourceGroup", resp, "Failure sending request")
- return
- }
-
- result.lr, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "ListByResourceGroup", resp, "Failure responding to request")
- return
- }
- if result.lr.hasNextLink() && result.lr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
-func (client Client) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
- if len(filter) > 0 {
- queryParameters["$filter"] = autorest.Encode("query", filter)
- }
- if len(expand) > 0 {
- queryParameters["$expand"] = autorest.Encode("query", expand)
- }
- if top != nil {
- queryParameters["$top"] = autorest.Encode("query", *top)
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
-// closes the http.Response Body.
-func (client Client) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listByResourceGroupNextResults retrieves the next set of results, if any.
-func (client Client) listByResourceGroupNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) {
- req, err := lastResults.listResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources.Client", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources.Client", "listByResourceGroupNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
-func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result ListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter, expand, top)
- return
-}
-
-// MoveResources the resources to move must be in the same source resource group. The target resource group may be in a
-// different subscription. When moving resources, both the source group and the target group are locked for the
-// duration of the operation. Write and delete operations are blocked on the groups until the move completes.
-// Parameters:
-// sourceResourceGroupName - the name of the resource group containing the resources to move.
-// parameters - parameters for moving resources.
-func (client Client) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo) (result MoveResourcesFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.MoveResources")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: sourceResourceGroupName,
- Constraints: []validation.Constraint{{Target: "sourceResourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "sourceResourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "sourceResourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.Client", "MoveResources", err.Error())
- }
-
- req, err := client.MoveResourcesPreparer(ctx, sourceResourceGroupName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "MoveResources", nil, "Failure preparing request")
- return
- }
-
- result, err = client.MoveResourcesSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "MoveResources", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// MoveResourcesPreparer prepares the MoveResources request.
-func (client Client) MoveResourcesPreparer(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "sourceResourceGroupName": autorest.Encode("path", sourceResourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// MoveResourcesSender sends the MoveResources request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) MoveResourcesSender(req *http.Request) (future MoveResourcesFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// MoveResourcesResponder handles the response to the MoveResources request. The method always
-// closes the http.Response Body.
-func (client Client) MoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// Update updates a resource.
-// Parameters:
-// resourceGroupName - the name of the resource group for the resource. The name is case insensitive.
-// resourceProviderNamespace - the namespace of the resource provider.
-// parentResourcePath - the parent resource identity.
-// resourceType - the resource type of the resource to update.
-// resourceName - the name of the resource to update.
-// APIVersion - the API version to use for the operation.
-// parameters - parameters for updating the resource.
-func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (result UpdateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.Client", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, APIVersion, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "Update", nil, "Failure preparing request")
- return
- }
-
- result, err = client.UpdateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "Update", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, APIVersion string, parameters GenericResource) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "parentResourcePath": parentResourcePath,
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "resourceName": autorest.Encode("path", resourceName),
- "resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
- "resourceType": resourceType,
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client Client) UpdateResponder(resp *http.Response) (result GenericResource, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// UpdateByID updates a resource by ID.
-// Parameters:
-// resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the
-// format,
-// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
-// APIVersion - the API version to use for the operation.
-// parameters - update resource parameters.
-func (client Client) UpdateByID(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (result UpdateByIDFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateByID")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.UpdateByIDPreparer(ctx, resourceID, APIVersion, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "UpdateByID", nil, "Failure preparing request")
- return
- }
-
- result, err = client.UpdateByIDSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "UpdateByID", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// UpdateByIDPreparer prepares the UpdateByID request.
-func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string, APIVersion string, parameters GenericResource) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceId": resourceID,
- }
-
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/{resourceId}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateByIDSender sends the UpdateByID request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) UpdateByIDSender(req *http.Request) (future UpdateByIDFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// UpdateByIDResponder handles the response to the UpdateByID request. The method always
-// closes the http.Response Body.
-func (client Client) UpdateByIDResponder(resp *http.Response) (result GenericResource, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ValidateMoveResources this operation checks whether the specified resources can be moved to the target. The
-// resources to move must be in the same source resource group. The target resource group may be in a different
-// subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it
-// returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to
-// check the result of the long-running operation.
-// Parameters:
-// sourceResourceGroupName - the name of the resource group containing the resources to validate for move.
-// parameters - parameters for moving resources.
-func (client Client) ValidateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo) (result ValidateMoveResourcesFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/Client.ValidateMoveResources")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: sourceResourceGroupName,
- Constraints: []validation.Constraint{{Target: "sourceResourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "sourceResourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "sourceResourceGroupName", Name: validation.Pattern, Rule: `^[-\p{L}\._\(\)\w]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("resources.Client", "ValidateMoveResources", err.Error())
- }
-
- req, err := client.ValidateMoveResourcesPreparer(ctx, sourceResourceGroupName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "ValidateMoveResources", nil, "Failure preparing request")
- return
- }
-
- result, err = client.ValidateMoveResourcesSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.Client", "ValidateMoveResources", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// ValidateMoveResourcesPreparer prepares the ValidateMoveResources request.
-func (client Client) ValidateMoveResourcesPreparer(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "sourceResourceGroupName": autorest.Encode("path", sourceResourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ValidateMoveResourcesSender sends the ValidateMoveResources request. The method will close the
-// http.Response Body if it receives an error.
-func (client Client) ValidateMoveResourcesSender(req *http.Request) (future ValidateMoveResourcesFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// ValidateMoveResourcesResponder handles the response to the ValidateMoveResources request. The method always
-// closes the http.Response Body.
-func (client Client) ValidateMoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusConflict),
- autorest.ByClosing())
- result.Response = resp
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/tags.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/tags.go
deleted file mode 100644
index 1477ae573..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/tags.go
+++ /dev/null
@@ -1,443 +0,0 @@
-package resources
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// TagsClient is the provides operations for working with resources and resource groups.
-type TagsClient struct {
- BaseClient
-}
-
-// NewTagsClient creates an instance of the TagsClient client.
-func NewTagsClient(subscriptionID string) TagsClient {
- return NewTagsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewTagsClientWithBaseURI creates an instance of the TagsClient client using a custom endpoint. Use this when
-// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewTagsClientWithBaseURI(baseURI string, subscriptionID string) TagsClient {
- return TagsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CreateOrUpdate the tag name can have a maximum of 512 characters and is case insensitive. Tag names created by Azure
-// have prefixes of microsoft, azure, or windows. You cannot create tags with one of these prefixes.
-// Parameters:
-// tagName - the name of the tag to create.
-func (client TagsClient) CreateOrUpdate(ctx context.Context, tagName string) (result TagDetails, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.CreateOrUpdate")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.CreateOrUpdatePreparer(ctx, tagName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdate", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreateOrUpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdate", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreateOrUpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdate", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
-func (client TagsClient) CreateOrUpdatePreparer(ctx context.Context, tagName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "tagName": autorest.Encode("path", tagName),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
-// http.Response Body if it receives an error.
-func (client TagsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
-// closes the http.Response Body.
-func (client TagsClient) CreateOrUpdateResponder(resp *http.Response) (result TagDetails, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// CreateOrUpdateValue creates a tag value. The name of the tag must already exist.
-// Parameters:
-// tagName - the name of the tag.
-// tagValue - the value of the tag to create.
-func (client TagsClient) CreateOrUpdateValue(ctx context.Context, tagName string, tagValue string) (result TagValue, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.CreateOrUpdateValue")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.CreateOrUpdateValuePreparer(ctx, tagName, tagValue)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdateValue", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CreateOrUpdateValueSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdateValue", resp, "Failure sending request")
- return
- }
-
- result, err = client.CreateOrUpdateValueResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "CreateOrUpdateValue", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CreateOrUpdateValuePreparer prepares the CreateOrUpdateValue request.
-func (client TagsClient) CreateOrUpdateValuePreparer(ctx context.Context, tagName string, tagValue string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "tagName": autorest.Encode("path", tagName),
- "tagValue": autorest.Encode("path", tagValue),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateOrUpdateValueSender sends the CreateOrUpdateValue request. The method will close the
-// http.Response Body if it receives an error.
-func (client TagsClient) CreateOrUpdateValueSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// CreateOrUpdateValueResponder handles the response to the CreateOrUpdateValue request. The method always
-// closes the http.Response Body.
-func (client TagsClient) CreateOrUpdateValueResponder(resp *http.Response) (result TagValue, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete you must remove all values from a resource tag before you can delete it.
-// Parameters:
-// tagName - the name of the tag.
-func (client TagsClient) Delete(ctx context.Context, tagName string) (result autorest.Response, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.Delete")
- defer func() {
- sc := -1
- if result.Response != nil {
- sc = result.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeletePreparer(ctx, tagName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "Delete", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client TagsClient) DeletePreparer(ctx context.Context, tagName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "tagName": autorest.Encode("path", tagName),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client TagsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client TagsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// DeleteValue deletes a tag value.
-// Parameters:
-// tagName - the name of the tag.
-// tagValue - the value of the tag to delete.
-func (client TagsClient) DeleteValue(ctx context.Context, tagName string, tagValue string) (result autorest.Response, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.DeleteValue")
- defer func() {
- sc := -1
- if result.Response != nil {
- sc = result.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.DeleteValuePreparer(ctx, tagName, tagValue)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "DeleteValue", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteValueSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "DeleteValue", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteValueResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "DeleteValue", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// DeleteValuePreparer prepares the DeleteValue request.
-func (client TagsClient) DeleteValuePreparer(ctx context.Context, tagName string, tagValue string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- "tagName": autorest.Encode("path", tagName),
- "tagValue": autorest.Encode("path", tagValue),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteValueSender sends the DeleteValue request. The method will close the
-// http.Response Body if it receives an error.
-func (client TagsClient) DeleteValueSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// DeleteValueResponder handles the response to the DeleteValue request. The method always
-// closes the http.Response Body.
-func (client TagsClient) DeleteValueResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// List gets the names and values of all resource tags that are defined in a subscription.
-func (client TagsClient) List(ctx context.Context) (result TagsListResultPage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.List")
- defer func() {
- sc := -1
- if result.tlr.Response.Response != nil {
- sc = result.tlr.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.fn = client.listNextResults
- req, err := client.ListPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.tlr.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "List", resp, "Failure sending request")
- return
- }
-
- result.tlr, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "List", resp, "Failure responding to request")
- return
- }
- if result.tlr.hasNextLink() && result.tlr.IsEmpty() {
- err = result.NextWithContext(ctx)
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client TagsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2018-05-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client TagsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client TagsClient) ListResponder(resp *http.Response) (result TagsListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// listNextResults retrieves the next set of results, if any.
-func (client TagsClient) listNextResults(ctx context.Context, lastResults TagsListResult) (result TagsListResult, err error) {
- req, err := lastResults.tagsListResultPreparer(ctx)
- if err != nil {
- return result, autorest.NewErrorWithError(err, "resources.TagsClient", "listNextResults", nil, "Failure preparing next results request")
- }
- if req == nil {
- return
- }
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- return result, autorest.NewErrorWithError(err, "resources.TagsClient", "listNextResults", resp, "Failure sending next results request")
- }
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "resources.TagsClient", "listNextResults", resp, "Failure responding to next results request")
- }
- return
-}
-
-// ListComplete enumerates all values, automatically crossing page boundaries as required.
-func (client TagsClient) ListComplete(ctx context.Context) (result TagsListResultIterator, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/TagsClient.List")
- defer func() {
- sc := -1
- if result.Response().Response.Response != nil {
- sc = result.page.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- result.page, err = client.List(ctx)
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/version.go
deleted file mode 100644
index 4696ca2b7..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/version.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package resources
-
-import "github.com/Azure/azure-sdk-for-go/version"
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return "Azure-SDK-For-Go/" + Version() + " resources/2018-05-01"
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return version.Number
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/CHANGELOG.md
deleted file mode 100644
index 52911e4cc..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/CHANGELOG.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# Change History
-
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/_meta.json
deleted file mode 100644
index f96d61dc5..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/_meta.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
- "readme": "/_/azure-rest-api-specs/specification/storage/resource-manager/readme.md",
- "tag": "package-2017-10",
- "use": "@microsoft.azure/autorest.go@2.1.187",
- "repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
- "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2017-10 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/storage/resource-manager/readme.md",
- "additional_properties": {
- "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION"
- }
-}
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/accounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/accounts.go
deleted file mode 100644
index 01198724c..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/accounts.go
+++ /dev/null
@@ -1,1026 +0,0 @@
-package storage
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/validation"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// AccountsClient is the the Azure Storage Management API.
-type AccountsClient struct {
- BaseClient
-}
-
-// NewAccountsClient creates an instance of the AccountsClient client.
-func NewAccountsClient(subscriptionID string) AccountsClient {
- return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client using a custom endpoint. Use this
-// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient {
- return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// CheckNameAvailability checks that the storage account name is valid and is not already in use.
-// Parameters:
-// accountName - the name of the storage account within the specified resource group. Storage account names
-// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
-func (client AccountsClient) CheckNameAvailability(ctx context.Context, accountName AccountCheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.CheckNameAvailability")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: accountName,
- Constraints: []validation.Constraint{{Target: "accountName.Name", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "accountName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("storage.AccountsClient", "CheckNameAvailability", err.Error())
- }
-
- req, err := client.CheckNameAvailabilityPreparer(ctx, accountName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.CheckNameAvailabilitySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", resp, "Failure sending request")
- return
- }
-
- result, err = client.CheckNameAvailabilityResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "CheckNameAvailability", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
-func (client AccountsClient) CheckNameAvailabilityPreparer(ctx context.Context, accountName AccountCheckNameAvailabilityParameters) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability", pathParameters),
- autorest.WithJSON(accountName),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
-// closes the http.Response Body.
-func (client AccountsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Create asynchronously creates a new storage account with the specified parameters. If an account is already created
-// and a subsequent create request is issued with different properties, the account properties will be updated. If an
-// account is already created and a subsequent create or update request is issued with the exact same set of
-// properties, the request will succeed.
-// Parameters:
-// resourceGroupName - the name of the resource group within the user's subscription. The name is case
-// insensitive.
-// accountName - the name of the storage account within the specified resource group. Storage account names
-// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
-// parameters - the parameters to provide for the created account.
-func (client AccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters) (result AccountsCreateFuture, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Create")
- defer func() {
- sc := -1
- if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
- sc = result.FutureAPI.Response().StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: accountName,
- Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
- {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "parameters.Identity", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Identity.Type", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "parameters.AccountPropertiesCreateParameters", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain.Name", Name: validation.Null, Rule: true, Chain: nil}}},
- }}}}}); err != nil {
- return result, validation.NewError("storage.AccountsClient", "Create", err.Error())
- }
-
- req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", nil, "Failure preparing request")
- return
- }
-
- result, err = client.CreateSender(req)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Create", result.Response(), "Failure sending request")
- return
- }
-
- return
-}
-
-// CreatePreparer prepares the Create request.
-func (client AccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accountName": autorest.Encode("path", accountName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPut(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// CreateSender sends the Create request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountsClient) CreateSender(req *http.Request) (future AccountsCreateFuture, err error) {
- var resp *http.Response
- future.FutureAPI = &azure.Future{}
- resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
- if err != nil {
- return
- }
- var azf azure.Future
- azf, err = azure.NewFutureFromResponse(resp)
- future.FutureAPI = &azf
- future.Result = future.result
- return
-}
-
-// CreateResponder handles the response to the Create request. The method always
-// closes the http.Response Body.
-func (client AccountsClient) CreateResponder(resp *http.Response) (result Account, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Delete deletes a storage account in Microsoft Azure.
-// Parameters:
-// resourceGroupName - the name of the resource group within the user's subscription. The name is case
-// insensitive.
-// accountName - the name of the storage account within the specified resource group. Storage account names
-// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
-func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Delete")
- defer func() {
- sc := -1
- if result.Response != nil {
- sc = result.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: accountName,
- Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
- {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
- return result, validation.NewError("storage.AccountsClient", "Delete", err.Error())
- }
-
- req, err := client.DeletePreparer(ctx, resourceGroupName, accountName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.DeleteSender(req)
- if err != nil {
- result.Response = resp
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", resp, "Failure sending request")
- return
- }
-
- result, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Delete", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// DeletePreparer prepares the Delete request.
-func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accountName": autorest.Encode("path", accountName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsDelete(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// DeleteSender sends the Delete request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountsClient) DeleteSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// DeleteResponder handles the response to the Delete request. The method always
-// closes the http.Response Body.
-func (client AccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
- autorest.ByClosing())
- result.Response = resp
- return
-}
-
-// GetProperties returns the properties for the specified storage account including but not limited to name, SKU name,
-// location, and account status. The ListKeys operation should be used to retrieve storage keys.
-// Parameters:
-// resourceGroupName - the name of the resource group within the user's subscription. The name is case
-// insensitive.
-// accountName - the name of the storage account within the specified resource group. Storage account names
-// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
-func (client AccountsClient) GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.GetProperties")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: accountName,
- Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
- {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
- return result, validation.NewError("storage.AccountsClient", "GetProperties", err.Error())
- }
-
- req, err := client.GetPropertiesPreparer(ctx, resourceGroupName, accountName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetPropertiesSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetPropertiesResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPropertiesPreparer prepares the GetProperties request.
-func (client AccountsClient) GetPropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accountName": autorest.Encode("path", accountName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetPropertiesSender sends the GetProperties request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountsClient) GetPropertiesSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetPropertiesResponder handles the response to the GetProperties request. The method always
-// closes the http.Response Body.
-func (client AccountsClient) GetPropertiesResponder(resp *http.Response) (result Account, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// List lists all the storage accounts available under the subscription. Note that storage keys are not returned; use
-// the ListKeys operation for this.
-func (client AccountsClient) List(ctx context.Context) (result AccountListResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "List", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client AccountsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client AccountsClient) ListResponder(resp *http.Response) (result AccountListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListAccountSAS list SAS credentials of a storage account.
-// Parameters:
-// resourceGroupName - the name of the resource group within the user's subscription. The name is case
-// insensitive.
-// accountName - the name of the storage account within the specified resource group. Storage account names
-// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
-// parameters - the parameters to provide to list SAS credentials for the storage account.
-func (client AccountsClient) ListAccountSAS(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters) (result ListAccountSasResponse, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListAccountSAS")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: accountName,
- Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
- {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.SharedAccessExpiryTime", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("storage.AccountsClient", "ListAccountSAS", err.Error())
- }
-
- req, err := client.ListAccountSASPreparer(ctx, resourceGroupName, accountName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListAccountSAS", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListAccountSASSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListAccountSAS", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListAccountSASResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListAccountSAS", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListAccountSASPreparer prepares the ListAccountSAS request.
-func (client AccountsClient) ListAccountSASPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accountName": autorest.Encode("path", accountName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListAccountSASSender sends the ListAccountSAS request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountsClient) ListAccountSASSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListAccountSASResponder handles the response to the ListAccountSAS request. The method always
-// closes the http.Response Body.
-func (client AccountsClient) ListAccountSASResponder(resp *http.Response) (result ListAccountSasResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListByResourceGroup lists all the storage accounts available under the given resource group. Note that storage keys
-// are not returned; use the ListKeys operation for this.
-// Parameters:
-// resourceGroupName - the name of the resource group within the user's subscription. The name is case
-// insensitive.
-func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
- return result, validation.NewError("storage.AccountsClient", "ListByResourceGroup", err.Error())
- }
-
- req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListByResourceGroupSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListByResourceGroupResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
-func (client AccountsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
-// closes the http.Response Body.
-func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) (result AccountListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListKeys lists the access keys for the specified storage account.
-// Parameters:
-// resourceGroupName - the name of the resource group within the user's subscription. The name is case
-// insensitive.
-// accountName - the name of the storage account within the specified resource group. Storage account names
-// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
-func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountListKeysResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListKeys")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: accountName,
- Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
- {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
- return result, validation.NewError("storage.AccountsClient", "ListKeys", err.Error())
- }
-
- req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListKeysSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListKeysResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListKeysPreparer prepares the ListKeys request.
-func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accountName": autorest.Encode("path", accountName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListKeysSender sends the ListKeys request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountsClient) ListKeysSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListKeysResponder handles the response to the ListKeys request. The method always
-// closes the http.Response Body.
-func (client AccountsClient) ListKeysResponder(resp *http.Response) (result AccountListKeysResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// ListServiceSAS list service SAS credentials of a specific resource.
-// Parameters:
-// resourceGroupName - the name of the resource group within the user's subscription. The name is case
-// insensitive.
-// accountName - the name of the storage account within the specified resource group. Storage account names
-// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
-// parameters - the parameters to provide to list service SAS credentials.
-func (client AccountsClient) ListServiceSAS(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters) (result ListServiceSasResponse, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListServiceSAS")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: accountName,
- Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
- {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
- {TargetValue: parameters,
- Constraints: []validation.Constraint{{Target: "parameters.CanonicalizedResource", Name: validation.Null, Rule: true, Chain: nil},
- {Target: "parameters.Identifier", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "parameters.Identifier", Name: validation.MaxLength, Rule: 64, Chain: nil}}}}}}); err != nil {
- return result, validation.NewError("storage.AccountsClient", "ListServiceSAS", err.Error())
- }
-
- req, err := client.ListServiceSASPreparer(ctx, resourceGroupName, accountName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListServiceSAS", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListServiceSASSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListServiceSAS", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListServiceSASResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListServiceSAS", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListServiceSASPreparer prepares the ListServiceSAS request.
-func (client AccountsClient) ListServiceSASPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accountName": autorest.Encode("path", accountName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListServiceSASSender sends the ListServiceSAS request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountsClient) ListServiceSASSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListServiceSASResponder handles the response to the ListServiceSAS request. The method always
-// closes the http.Response Body.
-func (client AccountsClient) ListServiceSASResponder(resp *http.Response) (result ListServiceSasResponse, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// RegenerateKey regenerates one of the access keys for the specified storage account.
-// Parameters:
-// resourceGroupName - the name of the resource group within the user's subscription. The name is case
-// insensitive.
-// accountName - the name of the storage account within the specified resource group. Storage account names
-// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
-// regenerateKey - specifies name of the key which should be regenerated -- key1 or key2.
-func (client AccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountListKeysResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.RegenerateKey")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: accountName,
- Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
- {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
- {TargetValue: regenerateKey,
- Constraints: []validation.Constraint{{Target: "regenerateKey.KeyName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
- return result, validation.NewError("storage.AccountsClient", "RegenerateKey", err.Error())
- }
-
- req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, accountName, regenerateKey)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.RegenerateKeySender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", resp, "Failure sending request")
- return
- }
-
- result, err = client.RegenerateKeyResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// RegenerateKeyPreparer prepares the RegenerateKey request.
-func (client AccountsClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accountName": autorest.Encode("path", accountName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPost(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey", pathParameters),
- autorest.WithJSON(regenerateKey),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// RegenerateKeySender sends the RegenerateKey request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountsClient) RegenerateKeySender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always
-// closes the http.Response Body.
-func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result AccountListKeysResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
-
-// Update the update operation can be used to update the SKU, encryption, access tier, or tags for a storage account.
-// It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account;
-// the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value
-// must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This
-// call does not change the storage keys for the account. If you want to change the storage account keys, use the
-// regenerate keys operation. The location and name of the storage account cannot be changed after creation.
-// Parameters:
-// resourceGroupName - the name of the resource group within the user's subscription. The name is case
-// insensitive.
-// accountName - the name of the storage account within the specified resource group. Storage account names
-// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
-// parameters - the parameters to provide for the updated account.
-func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Update")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- if err := validation.Validate([]validation.Validation{
- {TargetValue: resourceGroupName,
- Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
- {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
- {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
- {TargetValue: accountName,
- Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
- {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
- return result, validation.NewError("storage.AccountsClient", "Update", err.Error())
- }
-
- req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, parameters)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.UpdateSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", resp, "Failure sending request")
- return
- }
-
- result, err = client.UpdateResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Update", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// UpdatePreparer prepares the Update request.
-func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "accountName": autorest.Encode("path", accountName),
- "resourceGroupName": autorest.Encode("path", resourceGroupName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsContentType("application/json; charset=utf-8"),
- autorest.AsPatch(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
- autorest.WithJSON(parameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// UpdateSender sends the Update request. The method will close the
-// http.Response Body if it receives an error.
-func (client AccountsClient) UpdateSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// UpdateResponder handles the response to the Update request. The method always
-// closes the http.Response Body.
-func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/client.go
deleted file mode 100644
index 3678aedf0..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/client.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details.
-//
-// Package storage implements the Azure ARM Storage service API version 2017-10-01.
-//
-// The Azure Storage Management API.
-package storage
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "github.com/Azure/go-autorest/autorest"
-)
-
-const (
- // DefaultBaseURI is the default URI used for the service Storage
- DefaultBaseURI = "https://management.azure.com"
-)
-
-// BaseClient is the base client for Storage.
-type BaseClient struct {
- autorest.Client
- BaseURI string
- SubscriptionID string
-}
-
-// New creates an instance of the BaseClient client.
-func New(subscriptionID string) BaseClient {
- return NewWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with
-// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return BaseClient{
- Client: autorest.NewClientWithUserAgent(UserAgent()),
- BaseURI: baseURI,
- SubscriptionID: subscriptionID,
- }
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/enums.go
deleted file mode 100644
index 393c3d714..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/enums.go
+++ /dev/null
@@ -1,355 +0,0 @@
-package storage
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-// AccessTier enumerates the values for access tier.
-type AccessTier string
-
-const (
- // Cool ...
- Cool AccessTier = "Cool"
- // Hot ...
- Hot AccessTier = "Hot"
-)
-
-// PossibleAccessTierValues returns an array of possible values for the AccessTier const type.
-func PossibleAccessTierValues() []AccessTier {
- return []AccessTier{Cool, Hot}
-}
-
-// AccountStatus enumerates the values for account status.
-type AccountStatus string
-
-const (
- // Available ...
- Available AccountStatus = "available"
- // Unavailable ...
- Unavailable AccountStatus = "unavailable"
-)
-
-// PossibleAccountStatusValues returns an array of possible values for the AccountStatus const type.
-func PossibleAccountStatusValues() []AccountStatus {
- return []AccountStatus{Available, Unavailable}
-}
-
-// Action enumerates the values for action.
-type Action string
-
-const (
- // Allow ...
- Allow Action = "Allow"
-)
-
-// PossibleActionValues returns an array of possible values for the Action const type.
-func PossibleActionValues() []Action {
- return []Action{Allow}
-}
-
-// Bypass enumerates the values for bypass.
-type Bypass string
-
-const (
- // AzureServices ...
- AzureServices Bypass = "AzureServices"
- // Logging ...
- Logging Bypass = "Logging"
- // Metrics ...
- Metrics Bypass = "Metrics"
- // None ...
- None Bypass = "None"
-)
-
-// PossibleBypassValues returns an array of possible values for the Bypass const type.
-func PossibleBypassValues() []Bypass {
- return []Bypass{AzureServices, Logging, Metrics, None}
-}
-
-// DefaultAction enumerates the values for default action.
-type DefaultAction string
-
-const (
- // DefaultActionAllow ...
- DefaultActionAllow DefaultAction = "Allow"
- // DefaultActionDeny ...
- DefaultActionDeny DefaultAction = "Deny"
-)
-
-// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type.
-func PossibleDefaultActionValues() []DefaultAction {
- return []DefaultAction{DefaultActionAllow, DefaultActionDeny}
-}
-
-// HTTPProtocol enumerates the values for http protocol.
-type HTTPProtocol string
-
-const (
- // HTTPS ...
- HTTPS HTTPProtocol = "https"
- // Httpshttp ...
- Httpshttp HTTPProtocol = "https,http"
-)
-
-// PossibleHTTPProtocolValues returns an array of possible values for the HTTPProtocol const type.
-func PossibleHTTPProtocolValues() []HTTPProtocol {
- return []HTTPProtocol{HTTPS, Httpshttp}
-}
-
-// KeyPermission enumerates the values for key permission.
-type KeyPermission string
-
-const (
- // Full ...
- Full KeyPermission = "Full"
- // Read ...
- Read KeyPermission = "Read"
-)
-
-// PossibleKeyPermissionValues returns an array of possible values for the KeyPermission const type.
-func PossibleKeyPermissionValues() []KeyPermission {
- return []KeyPermission{Full, Read}
-}
-
-// KeySource enumerates the values for key source.
-type KeySource string
-
-const (
- // MicrosoftKeyvault ...
- MicrosoftKeyvault KeySource = "Microsoft.Keyvault"
- // MicrosoftStorage ...
- MicrosoftStorage KeySource = "Microsoft.Storage"
-)
-
-// PossibleKeySourceValues returns an array of possible values for the KeySource const type.
-func PossibleKeySourceValues() []KeySource {
- return []KeySource{MicrosoftKeyvault, MicrosoftStorage}
-}
-
-// Kind enumerates the values for kind.
-type Kind string
-
-const (
- // BlobStorage ...
- BlobStorage Kind = "BlobStorage"
- // Storage ...
- Storage Kind = "Storage"
- // StorageV2 ...
- StorageV2 Kind = "StorageV2"
-)
-
-// PossibleKindValues returns an array of possible values for the Kind const type.
-func PossibleKindValues() []Kind {
- return []Kind{BlobStorage, Storage, StorageV2}
-}
-
-// Permissions enumerates the values for permissions.
-type Permissions string
-
-const (
- // A ...
- A Permissions = "a"
- // C ...
- C Permissions = "c"
- // D ...
- D Permissions = "d"
- // L ...
- L Permissions = "l"
- // P ...
- P Permissions = "p"
- // R ...
- R Permissions = "r"
- // U ...
- U Permissions = "u"
- // W ...
- W Permissions = "w"
-)
-
-// PossiblePermissionsValues returns an array of possible values for the Permissions const type.
-func PossiblePermissionsValues() []Permissions {
- return []Permissions{A, C, D, L, P, R, U, W}
-}
-
-// ProvisioningState enumerates the values for provisioning state.
-type ProvisioningState string
-
-const (
- // Creating ...
- Creating ProvisioningState = "Creating"
- // ResolvingDNS ...
- ResolvingDNS ProvisioningState = "ResolvingDNS"
- // Succeeded ...
- Succeeded ProvisioningState = "Succeeded"
-)
-
-// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type.
-func PossibleProvisioningStateValues() []ProvisioningState {
- return []ProvisioningState{Creating, ResolvingDNS, Succeeded}
-}
-
-// Reason enumerates the values for reason.
-type Reason string
-
-const (
- // AccountNameInvalid ...
- AccountNameInvalid Reason = "AccountNameInvalid"
- // AlreadyExists ...
- AlreadyExists Reason = "AlreadyExists"
-)
-
-// PossibleReasonValues returns an array of possible values for the Reason const type.
-func PossibleReasonValues() []Reason {
- return []Reason{AccountNameInvalid, AlreadyExists}
-}
-
-// ReasonCode enumerates the values for reason code.
-type ReasonCode string
-
-const (
- // NotAvailableForSubscription ...
- NotAvailableForSubscription ReasonCode = "NotAvailableForSubscription"
- // QuotaID ...
- QuotaID ReasonCode = "QuotaId"
-)
-
-// PossibleReasonCodeValues returns an array of possible values for the ReasonCode const type.
-func PossibleReasonCodeValues() []ReasonCode {
- return []ReasonCode{NotAvailableForSubscription, QuotaID}
-}
-
-// Services enumerates the values for services.
-type Services string
-
-const (
- // B ...
- B Services = "b"
- // F ...
- F Services = "f"
- // Q ...
- Q Services = "q"
- // T ...
- T Services = "t"
-)
-
-// PossibleServicesValues returns an array of possible values for the Services const type.
-func PossibleServicesValues() []Services {
- return []Services{B, F, Q, T}
-}
-
-// SignedResource enumerates the values for signed resource.
-type SignedResource string
-
-const (
- // SignedResourceB ...
- SignedResourceB SignedResource = "b"
- // SignedResourceC ...
- SignedResourceC SignedResource = "c"
- // SignedResourceF ...
- SignedResourceF SignedResource = "f"
- // SignedResourceS ...
- SignedResourceS SignedResource = "s"
-)
-
-// PossibleSignedResourceValues returns an array of possible values for the SignedResource const type.
-func PossibleSignedResourceValues() []SignedResource {
- return []SignedResource{SignedResourceB, SignedResourceC, SignedResourceF, SignedResourceS}
-}
-
-// SignedResourceTypes enumerates the values for signed resource types.
-type SignedResourceTypes string
-
-const (
- // SignedResourceTypesC ...
- SignedResourceTypesC SignedResourceTypes = "c"
- // SignedResourceTypesO ...
- SignedResourceTypesO SignedResourceTypes = "o"
- // SignedResourceTypesS ...
- SignedResourceTypesS SignedResourceTypes = "s"
-)
-
-// PossibleSignedResourceTypesValues returns an array of possible values for the SignedResourceTypes const type.
-func PossibleSignedResourceTypesValues() []SignedResourceTypes {
- return []SignedResourceTypes{SignedResourceTypesC, SignedResourceTypesO, SignedResourceTypesS}
-}
-
-// SkuName enumerates the values for sku name.
-type SkuName string
-
-const (
- // PremiumLRS ...
- PremiumLRS SkuName = "Premium_LRS"
- // StandardGRS ...
- StandardGRS SkuName = "Standard_GRS"
- // StandardLRS ...
- StandardLRS SkuName = "Standard_LRS"
- // StandardRAGRS ...
- StandardRAGRS SkuName = "Standard_RAGRS"
- // StandardZRS ...
- StandardZRS SkuName = "Standard_ZRS"
-)
-
-// PossibleSkuNameValues returns an array of possible values for the SkuName const type.
-func PossibleSkuNameValues() []SkuName {
- return []SkuName{PremiumLRS, StandardGRS, StandardLRS, StandardRAGRS, StandardZRS}
-}
-
-// SkuTier enumerates the values for sku tier.
-type SkuTier string
-
-const (
- // Premium ...
- Premium SkuTier = "Premium"
- // Standard ...
- Standard SkuTier = "Standard"
-)
-
-// PossibleSkuTierValues returns an array of possible values for the SkuTier const type.
-func PossibleSkuTierValues() []SkuTier {
- return []SkuTier{Premium, Standard}
-}
-
-// State enumerates the values for state.
-type State string
-
-const (
- // StateDeprovisioning ...
- StateDeprovisioning State = "deprovisioning"
- // StateFailed ...
- StateFailed State = "failed"
- // StateNetworkSourceDeleted ...
- StateNetworkSourceDeleted State = "networkSourceDeleted"
- // StateProvisioning ...
- StateProvisioning State = "provisioning"
- // StateSucceeded ...
- StateSucceeded State = "succeeded"
-)
-
-// PossibleStateValues returns an array of possible values for the State const type.
-func PossibleStateValues() []State {
- return []State{StateDeprovisioning, StateFailed, StateNetworkSourceDeleted, StateProvisioning, StateSucceeded}
-}
-
-// UsageUnit enumerates the values for usage unit.
-type UsageUnit string
-
-const (
- // Bytes ...
- Bytes UsageUnit = "Bytes"
- // BytesPerSecond ...
- BytesPerSecond UsageUnit = "BytesPerSecond"
- // Count ...
- Count UsageUnit = "Count"
- // CountsPerSecond ...
- CountsPerSecond UsageUnit = "CountsPerSecond"
- // Percent ...
- Percent UsageUnit = "Percent"
- // Seconds ...
- Seconds UsageUnit = "Seconds"
-)
-
-// PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type.
-func PossibleUsageUnitValues() []UsageUnit {
- return []UsageUnit{Bytes, BytesPerSecond, Count, CountsPerSecond, Percent, Seconds}
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go
deleted file mode 100644
index c5a3245e1..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go
+++ /dev/null
@@ -1,1052 +0,0 @@
-package storage
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "encoding/json"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/autorest/date"
- "net/http"
-)
-
-// The package's fully qualified name.
-const fqdn = "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage"
-
-// Account the storage account.
-type Account struct {
- autorest.Response `json:"-"`
- // Sku - READ-ONLY; Gets the SKU.
- Sku *Sku `json:"sku,omitempty"`
- // Kind - READ-ONLY; Gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'
- Kind Kind `json:"kind,omitempty"`
- // Identity - The identity of the resource.
- Identity *Identity `json:"identity,omitempty"`
- // AccountProperties - Properties of the storage account.
- *AccountProperties `json:"properties,omitempty"`
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Tags assigned to a resource; can be used for viewing and grouping a resource (across resource groups).
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for Account.
-func (a Account) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if a.Identity != nil {
- objectMap["identity"] = a.Identity
- }
- if a.AccountProperties != nil {
- objectMap["properties"] = a.AccountProperties
- }
- if a.Location != nil {
- objectMap["location"] = a.Location
- }
- if a.Tags != nil {
- objectMap["tags"] = a.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for Account struct.
-func (a *Account) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "sku":
- if v != nil {
- var sku Sku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- a.Sku = &sku
- }
- case "kind":
- if v != nil {
- var kind Kind
- err = json.Unmarshal(*v, &kind)
- if err != nil {
- return err
- }
- a.Kind = kind
- }
- case "identity":
- if v != nil {
- var identity Identity
- err = json.Unmarshal(*v, &identity)
- if err != nil {
- return err
- }
- a.Identity = &identity
- }
- case "properties":
- if v != nil {
- var accountProperties AccountProperties
- err = json.Unmarshal(*v, &accountProperties)
- if err != nil {
- return err
- }
- a.AccountProperties = &accountProperties
- }
- case "id":
- if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
- if err != nil {
- return err
- }
- a.ID = &ID
- }
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- a.Name = &name
- }
- case "type":
- if v != nil {
- var typeVar string
- err = json.Unmarshal(*v, &typeVar)
- if err != nil {
- return err
- }
- a.Type = &typeVar
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- a.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- a.Tags = tags
- }
- }
- }
-
- return nil
-}
-
-// AccountCheckNameAvailabilityParameters the parameters used to check the availability of the storage
-// account name.
-type AccountCheckNameAvailabilityParameters struct {
- // Name - The storage account name.
- Name *string `json:"name,omitempty"`
- // Type - The type of resource, Microsoft.Storage/storageAccounts
- Type *string `json:"type,omitempty"`
-}
-
-// AccountCreateParameters the parameters used when creating a storage account.
-type AccountCreateParameters struct {
- // Sku - Required. Gets or sets the sku name.
- Sku *Sku `json:"sku,omitempty"`
- // Kind - Required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'
- Kind Kind `json:"kind,omitempty"`
- // Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed.
- Location *string `json:"location,omitempty"`
- // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters.
- Tags map[string]*string `json:"tags"`
- // Identity - The identity of the resource.
- Identity *Identity `json:"identity,omitempty"`
- // AccountPropertiesCreateParameters - The parameters used to create the storage account.
- *AccountPropertiesCreateParameters `json:"properties,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for AccountCreateParameters.
-func (acp AccountCreateParameters) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if acp.Sku != nil {
- objectMap["sku"] = acp.Sku
- }
- if acp.Kind != "" {
- objectMap["kind"] = acp.Kind
- }
- if acp.Location != nil {
- objectMap["location"] = acp.Location
- }
- if acp.Tags != nil {
- objectMap["tags"] = acp.Tags
- }
- if acp.Identity != nil {
- objectMap["identity"] = acp.Identity
- }
- if acp.AccountPropertiesCreateParameters != nil {
- objectMap["properties"] = acp.AccountPropertiesCreateParameters
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for AccountCreateParameters struct.
-func (acp *AccountCreateParameters) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "sku":
- if v != nil {
- var sku Sku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- acp.Sku = &sku
- }
- case "kind":
- if v != nil {
- var kind Kind
- err = json.Unmarshal(*v, &kind)
- if err != nil {
- return err
- }
- acp.Kind = kind
- }
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- acp.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- acp.Tags = tags
- }
- case "identity":
- if v != nil {
- var identity Identity
- err = json.Unmarshal(*v, &identity)
- if err != nil {
- return err
- }
- acp.Identity = &identity
- }
- case "properties":
- if v != nil {
- var accountPropertiesCreateParameters AccountPropertiesCreateParameters
- err = json.Unmarshal(*v, &accountPropertiesCreateParameters)
- if err != nil {
- return err
- }
- acp.AccountPropertiesCreateParameters = &accountPropertiesCreateParameters
- }
- }
- }
-
- return nil
-}
-
-// AccountKey an access key for the storage account.
-type AccountKey struct {
- // KeyName - READ-ONLY; Name of the key.
- KeyName *string `json:"keyName,omitempty"`
- // Value - READ-ONLY; Base 64-encoded value of the key.
- Value *string `json:"value,omitempty"`
- // Permissions - READ-ONLY; Permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full'
- Permissions KeyPermission `json:"permissions,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for AccountKey.
-func (ak AccountKey) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// AccountListKeysResult the response from the ListKeys operation.
-type AccountListKeysResult struct {
- autorest.Response `json:"-"`
- // Keys - READ-ONLY; Gets the list of storage account keys and their properties for the specified storage account.
- Keys *[]AccountKey `json:"keys,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for AccountListKeysResult.
-func (alkr AccountListKeysResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// AccountListResult the response from the List Storage Accounts operation.
-type AccountListResult struct {
- autorest.Response `json:"-"`
- // Value - READ-ONLY; Gets the list of storage accounts and their properties.
- Value *[]Account `json:"value,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for AccountListResult.
-func (alr AccountListResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// AccountProperties properties of the storage account.
-type AccountProperties struct {
- // ProvisioningState - READ-ONLY; Gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded'
- ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
- // PrimaryEndpoints - READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint.
- PrimaryEndpoints *Endpoints `json:"primaryEndpoints,omitempty"`
- // PrimaryLocation - READ-ONLY; Gets the location of the primary data center for the storage account.
- PrimaryLocation *string `json:"primaryLocation,omitempty"`
- // StatusOfPrimary - READ-ONLY; Gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'Available', 'Unavailable'
- StatusOfPrimary AccountStatus `json:"statusOfPrimary,omitempty"`
- // LastGeoFailoverTime - READ-ONLY; Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS.
- LastGeoFailoverTime *date.Time `json:"lastGeoFailoverTime,omitempty"`
- // SecondaryLocation - READ-ONLY; Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS.
- SecondaryLocation *string `json:"secondaryLocation,omitempty"`
- // StatusOfSecondary - READ-ONLY; Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'Available', 'Unavailable'
- StatusOfSecondary AccountStatus `json:"statusOfSecondary,omitempty"`
- // CreationTime - READ-ONLY; Gets the creation date and time of the storage account in UTC.
- CreationTime *date.Time `json:"creationTime,omitempty"`
- // CustomDomain - READ-ONLY; Gets the custom domain the user assigned to this storage account.
- CustomDomain *CustomDomain `json:"customDomain,omitempty"`
- // SecondaryEndpoints - READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS.
- SecondaryEndpoints *Endpoints `json:"secondaryEndpoints,omitempty"`
- // Encryption - READ-ONLY; Gets the encryption settings on the account. If unspecified, the account is unencrypted.
- Encryption *Encryption `json:"encryption,omitempty"`
- // AccessTier - READ-ONLY; Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'
- AccessTier AccessTier `json:"accessTier,omitempty"`
- // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true.
- EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"`
- // NetworkRuleSet - READ-ONLY; Network rule set
- NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for AccountProperties.
-func (ap AccountProperties) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if ap.EnableHTTPSTrafficOnly != nil {
- objectMap["supportsHttpsTrafficOnly"] = ap.EnableHTTPSTrafficOnly
- }
- return json.Marshal(objectMap)
-}
-
-// AccountPropertiesCreateParameters the parameters used to create the storage account.
-type AccountPropertiesCreateParameters struct {
- // CustomDomain - User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property.
- CustomDomain *CustomDomain `json:"customDomain,omitempty"`
- // Encryption - Provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted.
- Encryption *Encryption `json:"encryption,omitempty"`
- // NetworkRuleSet - Network rule set
- NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"`
- // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'
- AccessTier AccessTier `json:"accessTier,omitempty"`
- // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true.
- EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"`
-}
-
-// AccountPropertiesUpdateParameters the parameters used when updating a storage account.
-type AccountPropertiesUpdateParameters struct {
- // CustomDomain - Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property.
- CustomDomain *CustomDomain `json:"customDomain,omitempty"`
- // Encryption - Provides the encryption settings on the account. The default setting is unencrypted.
- Encryption *Encryption `json:"encryption,omitempty"`
- // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool'
- AccessTier AccessTier `json:"accessTier,omitempty"`
- // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true.
- EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"`
- // NetworkRuleSet - Network rule set
- NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"`
-}
-
-// AccountRegenerateKeyParameters the parameters used to regenerate the storage account key.
-type AccountRegenerateKeyParameters struct {
- // KeyName - The name of storage keys that want to be regenerated, possible values are key1, key2.
- KeyName *string `json:"keyName,omitempty"`
-}
-
-// AccountSasParameters the parameters to list SAS credentials of a storage account.
-type AccountSasParameters struct {
- // Services - The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'B', 'Q', 'T', 'F'
- Services Services `json:"signedServices,omitempty"`
- // ResourceTypes - The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 'SignedResourceTypesS', 'SignedResourceTypesC', 'SignedResourceTypesO'
- ResourceTypes SignedResourceTypes `json:"signedResourceTypes,omitempty"`
- // Permissions - The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'R', 'D', 'W', 'L', 'A', 'C', 'U', 'P'
- Permissions Permissions `json:"signedPermission,omitempty"`
- // IPAddressOrRange - An IP address or a range of IP addresses from which to accept requests.
- IPAddressOrRange *string `json:"signedIp,omitempty"`
- // Protocols - The protocol permitted for a request made with the account SAS. Possible values include: 'Httpshttp', 'HTTPS'
- Protocols HTTPProtocol `json:"signedProtocol,omitempty"`
- // SharedAccessStartTime - The time at which the SAS becomes valid.
- SharedAccessStartTime *date.Time `json:"signedStart,omitempty"`
- // SharedAccessExpiryTime - The time at which the shared access signature becomes invalid.
- SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"`
- // KeyToSign - The key to sign the account SAS token with.
- KeyToSign *string `json:"keyToSign,omitempty"`
-}
-
-// AccountsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type AccountsCreateFuture struct {
- azure.FutureAPI
- // Result returns the result of the asynchronous operation.
- // If the operation has not completed it will return an error.
- Result func(AccountsClient) (Account, error)
-}
-
-// UnmarshalJSON is the custom unmarshaller for CreateFuture.
-func (future *AccountsCreateFuture) UnmarshalJSON(body []byte) error {
- var azFuture azure.Future
- if err := json.Unmarshal(body, &azFuture); err != nil {
- return err
- }
- future.FutureAPI = &azFuture
- future.Result = future.result
- return nil
-}
-
-// result is the default implementation for AccountsCreateFuture.Result.
-func (future *AccountsCreateFuture) result(client AccountsClient) (a Account, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", future.Response(), "Polling failure")
- return
- }
- if !done {
- a.Response.Response = future.Response()
- err = azure.NewAsyncOpIncompleteError("storage.AccountsCreateFuture")
- return
- }
- sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
- a, err = client.CreateResponder(a.Response.Response)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", a.Response.Response, "Failure responding to request")
- }
- }
- return
-}
-
-// AccountUpdateParameters the parameters that can be provided when updating the storage account
-// properties.
-type AccountUpdateParameters struct {
- // Sku - Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku names be updated to any other value.
- Sku *Sku `json:"sku,omitempty"`
- // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.
- Tags map[string]*string `json:"tags"`
- // Identity - The identity of the resource.
- Identity *Identity `json:"identity,omitempty"`
- // AccountPropertiesUpdateParameters - The parameters used when updating a storage account.
- *AccountPropertiesUpdateParameters `json:"properties,omitempty"`
- // Kind - Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'
- Kind Kind `json:"kind,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for AccountUpdateParameters.
-func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if aup.Sku != nil {
- objectMap["sku"] = aup.Sku
- }
- if aup.Tags != nil {
- objectMap["tags"] = aup.Tags
- }
- if aup.Identity != nil {
- objectMap["identity"] = aup.Identity
- }
- if aup.AccountPropertiesUpdateParameters != nil {
- objectMap["properties"] = aup.AccountPropertiesUpdateParameters
- }
- if aup.Kind != "" {
- objectMap["kind"] = aup.Kind
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct.
-func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "sku":
- if v != nil {
- var sku Sku
- err = json.Unmarshal(*v, &sku)
- if err != nil {
- return err
- }
- aup.Sku = &sku
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- aup.Tags = tags
- }
- case "identity":
- if v != nil {
- var identity Identity
- err = json.Unmarshal(*v, &identity)
- if err != nil {
- return err
- }
- aup.Identity = &identity
- }
- case "properties":
- if v != nil {
- var accountPropertiesUpdateParameters AccountPropertiesUpdateParameters
- err = json.Unmarshal(*v, &accountPropertiesUpdateParameters)
- if err != nil {
- return err
- }
- aup.AccountPropertiesUpdateParameters = &accountPropertiesUpdateParameters
- }
- case "kind":
- if v != nil {
- var kind Kind
- err = json.Unmarshal(*v, &kind)
- if err != nil {
- return err
- }
- aup.Kind = kind
- }
- }
- }
-
- return nil
-}
-
-// CheckNameAvailabilityResult the CheckNameAvailability operation response.
-type CheckNameAvailabilityResult struct {
- autorest.Response `json:"-"`
- // NameAvailable - READ-ONLY; Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used.
- NameAvailable *bool `json:"nameAvailable,omitempty"`
- // Reason - READ-ONLY; Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'
- Reason Reason `json:"reason,omitempty"`
- // Message - READ-ONLY; Gets an error message explaining the Reason value in more detail.
- Message *string `json:"message,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for CheckNameAvailabilityResult.
-func (cnar CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// CustomDomain the custom domain assigned to this storage account. This can be set via Update.
-type CustomDomain struct {
- // Name - Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.
- Name *string `json:"name,omitempty"`
- // UseSubDomainName - Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.
- UseSubDomainName *bool `json:"useSubDomainName,omitempty"`
-}
-
-// Dimension dimension of blobs, possibly be blob type or access tier.
-type Dimension struct {
- // Name - Display name of dimension.
- Name *string `json:"name,omitempty"`
- // DisplayName - Display name of dimension.
- DisplayName *string `json:"displayName,omitempty"`
-}
-
-// Encryption the encryption settings on the storage account.
-type Encryption struct {
- // Services - List of services which support encryption.
- Services *EncryptionServices `json:"services,omitempty"`
- // KeySource - The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'MicrosoftStorage', 'MicrosoftKeyvault'
- KeySource KeySource `json:"keySource,omitempty"`
- // KeyVaultProperties - Properties provided by key vault.
- KeyVaultProperties *KeyVaultProperties `json:"keyvaultproperties,omitempty"`
-}
-
-// EncryptionService a service that allows server-side encryption to be used.
-type EncryptionService struct {
- // Enabled - A boolean indicating whether or not the service encrypts the data as it is stored.
- Enabled *bool `json:"enabled,omitempty"`
- // LastEnabledTime - READ-ONLY; Gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate.
- LastEnabledTime *date.Time `json:"lastEnabledTime,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EncryptionService.
-func (es EncryptionService) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if es.Enabled != nil {
- objectMap["enabled"] = es.Enabled
- }
- return json.Marshal(objectMap)
-}
-
-// EncryptionServices a list of services that support encryption.
-type EncryptionServices struct {
- // Blob - The encryption function of the blob storage service.
- Blob *EncryptionService `json:"blob,omitempty"`
- // File - The encryption function of the file storage service.
- File *EncryptionService `json:"file,omitempty"`
- // Table - READ-ONLY; The encryption function of the table storage service.
- Table *EncryptionService `json:"table,omitempty"`
- // Queue - READ-ONLY; The encryption function of the queue storage service.
- Queue *EncryptionService `json:"queue,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for EncryptionServices.
-func (es EncryptionServices) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if es.Blob != nil {
- objectMap["blob"] = es.Blob
- }
- if es.File != nil {
- objectMap["file"] = es.File
- }
- return json.Marshal(objectMap)
-}
-
-// Endpoints the URIs that are used to perform a retrieval of a public blob, queue, or table object.
-type Endpoints struct {
- // Blob - READ-ONLY; Gets the blob endpoint.
- Blob *string `json:"blob,omitempty"`
- // Queue - READ-ONLY; Gets the queue endpoint.
- Queue *string `json:"queue,omitempty"`
- // Table - READ-ONLY; Gets the table endpoint.
- Table *string `json:"table,omitempty"`
- // File - READ-ONLY; Gets the file endpoint.
- File *string `json:"file,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for Endpoints.
-func (e Endpoints) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// Identity identity for the resource.
-type Identity struct {
- // PrincipalID - READ-ONLY; The principal ID of resource identity.
- PrincipalID *string `json:"principalId,omitempty"`
- // TenantID - READ-ONLY; The tenant ID of resource.
- TenantID *string `json:"tenantId,omitempty"`
- // Type - The identity type.
- Type *string `json:"type,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for Identity.
-func (i Identity) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if i.Type != nil {
- objectMap["type"] = i.Type
- }
- return json.Marshal(objectMap)
-}
-
-// IPRule IP rule with specific IP or IP range in CIDR format.
-type IPRule struct {
- // IPAddressOrRange - Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed.
- IPAddressOrRange *string `json:"value,omitempty"`
- // Action - The action of IP ACL rule. Possible values include: 'Allow'
- Action Action `json:"action,omitempty"`
-}
-
-// KeyVaultProperties properties of key vault.
-type KeyVaultProperties struct {
- // KeyName - The name of KeyVault key.
- KeyName *string `json:"keyname,omitempty"`
- // KeyVersion - The version of KeyVault key.
- KeyVersion *string `json:"keyversion,omitempty"`
- // KeyVaultURI - The Uri of KeyVault.
- KeyVaultURI *string `json:"keyvaulturi,omitempty"`
-}
-
-// ListAccountSasResponse the List SAS credentials operation response.
-type ListAccountSasResponse struct {
- autorest.Response `json:"-"`
- // AccountSasToken - READ-ONLY; List SAS credentials of storage account.
- AccountSasToken *string `json:"accountSasToken,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ListAccountSasResponse.
-func (lasr ListAccountSasResponse) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// ListServiceSasResponse the List service SAS credentials operation response.
-type ListServiceSasResponse struct {
- autorest.Response `json:"-"`
- // ServiceSasToken - READ-ONLY; List service SAS credentials of specific resource.
- ServiceSasToken *string `json:"serviceSasToken,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for ListServiceSasResponse.
-func (lssr ListServiceSasResponse) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// MetricSpecification metric specification of operation.
-type MetricSpecification struct {
- // Name - Name of metric specification.
- Name *string `json:"name,omitempty"`
- // DisplayName - Display name of metric specification.
- DisplayName *string `json:"displayName,omitempty"`
- // DisplayDescription - Display description of metric specification.
- DisplayDescription *string `json:"displayDescription,omitempty"`
- // Unit - Unit could be Bytes or Count.
- Unit *string `json:"unit,omitempty"`
- // Dimensions - Dimensions of blobs, including blob type and access tier.
- Dimensions *[]Dimension `json:"dimensions,omitempty"`
- // AggregationType - Aggregation type could be Average.
- AggregationType *string `json:"aggregationType,omitempty"`
- // FillGapWithZero - The property to decide fill gap with zero or not.
- FillGapWithZero *bool `json:"fillGapWithZero,omitempty"`
- // Category - The category this metric specification belong to, could be Capacity.
- Category *string `json:"category,omitempty"`
- // ResourceIDDimensionNameOverride - Account Resource Id.
- ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"`
-}
-
-// NetworkRuleSet network rule set
-type NetworkRuleSet struct {
- // Bypass - Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices'
- Bypass Bypass `json:"bypass,omitempty"`
- // VirtualNetworkRules - Sets the virtual network rules
- VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
- // IPRules - Sets the IP ACL rules
- IPRules *[]IPRule `json:"ipRules,omitempty"`
- // DefaultAction - Specifies the default action of allow or deny when no other rules match. Possible values include: 'DefaultActionAllow', 'DefaultActionDeny'
- DefaultAction DefaultAction `json:"defaultAction,omitempty"`
-}
-
-// Operation storage REST API operation definition.
-type Operation struct {
- // Name - Operation name: {provider}/{resource}/{operation}
- Name *string `json:"name,omitempty"`
- // Display - Display metadata associated with the operation.
- Display *OperationDisplay `json:"display,omitempty"`
- // Origin - The origin of operations.
- Origin *string `json:"origin,omitempty"`
- // OperationProperties - Properties of operation, include metric specifications.
- *OperationProperties `json:"properties,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for Operation.
-func (o Operation) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if o.Name != nil {
- objectMap["name"] = o.Name
- }
- if o.Display != nil {
- objectMap["display"] = o.Display
- }
- if o.Origin != nil {
- objectMap["origin"] = o.Origin
- }
- if o.OperationProperties != nil {
- objectMap["properties"] = o.OperationProperties
- }
- return json.Marshal(objectMap)
-}
-
-// UnmarshalJSON is the custom unmarshaler for Operation struct.
-func (o *Operation) UnmarshalJSON(body []byte) error {
- var m map[string]*json.RawMessage
- err := json.Unmarshal(body, &m)
- if err != nil {
- return err
- }
- for k, v := range m {
- switch k {
- case "name":
- if v != nil {
- var name string
- err = json.Unmarshal(*v, &name)
- if err != nil {
- return err
- }
- o.Name = &name
- }
- case "display":
- if v != nil {
- var display OperationDisplay
- err = json.Unmarshal(*v, &display)
- if err != nil {
- return err
- }
- o.Display = &display
- }
- case "origin":
- if v != nil {
- var origin string
- err = json.Unmarshal(*v, &origin)
- if err != nil {
- return err
- }
- o.Origin = &origin
- }
- case "properties":
- if v != nil {
- var operationProperties OperationProperties
- err = json.Unmarshal(*v, &operationProperties)
- if err != nil {
- return err
- }
- o.OperationProperties = &operationProperties
- }
- }
- }
-
- return nil
-}
-
-// OperationDisplay display metadata associated with the operation.
-type OperationDisplay struct {
- // Provider - Service provider: Microsoft Storage.
- Provider *string `json:"provider,omitempty"`
- // Resource - Resource on which the operation is performed etc.
- Resource *string `json:"resource,omitempty"`
- // Operation - Type of operation: get, read, delete, etc.
- Operation *string `json:"operation,omitempty"`
-}
-
-// OperationListResult result of the request to list Storage operations. It contains a list of operations
-// and a URL link to get the next set of results.
-type OperationListResult struct {
- autorest.Response `json:"-"`
- // Value - List of Storage operations supported by the Storage resource provider.
- Value *[]Operation `json:"value,omitempty"`
-}
-
-// OperationProperties properties of operation, include metric specifications.
-type OperationProperties struct {
- // ServiceSpecification - One property of operation, include metric specifications.
- ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
-}
-
-// Resource describes a storage resource.
-type Resource struct {
- // ID - READ-ONLY; Resource Id
- ID *string `json:"id,omitempty"`
- // Name - READ-ONLY; Resource name
- Name *string `json:"name,omitempty"`
- // Type - READ-ONLY; Resource type
- Type *string `json:"type,omitempty"`
- // Location - Resource location
- Location *string `json:"location,omitempty"`
- // Tags - Tags assigned to a resource; can be used for viewing and grouping a resource (across resource groups).
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for Resource.
-func (r Resource) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if r.Location != nil {
- objectMap["location"] = r.Location
- }
- if r.Tags != nil {
- objectMap["tags"] = r.Tags
- }
- return json.Marshal(objectMap)
-}
-
-// Restriction the restriction because of which SKU cannot be used.
-type Restriction struct {
- // Type - READ-ONLY; The type of restrictions. As of now only possible value for this is location.
- Type *string `json:"type,omitempty"`
- // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted.
- Values *[]string `json:"values,omitempty"`
- // ReasonCode - The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaID', 'NotAvailableForSubscription'
- ReasonCode ReasonCode `json:"reasonCode,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for Restriction.
-func (r Restriction) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if r.ReasonCode != "" {
- objectMap["reasonCode"] = r.ReasonCode
- }
- return json.Marshal(objectMap)
-}
-
-// ServiceSasParameters the parameters to list service SAS credentials of a specific resource.
-type ServiceSasParameters struct {
- // CanonicalizedResource - The canonical path to the signed resource.
- CanonicalizedResource *string `json:"canonicalizedResource,omitempty"`
- // Resource - The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'SignedResourceB', 'SignedResourceC', 'SignedResourceF', 'SignedResourceS'
- Resource SignedResource `json:"signedResource,omitempty"`
- // Permissions - The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'R', 'D', 'W', 'L', 'A', 'C', 'U', 'P'
- Permissions Permissions `json:"signedPermission,omitempty"`
- // IPAddressOrRange - An IP address or a range of IP addresses from which to accept requests.
- IPAddressOrRange *string `json:"signedIp,omitempty"`
- // Protocols - The protocol permitted for a request made with the account SAS. Possible values include: 'Httpshttp', 'HTTPS'
- Protocols HTTPProtocol `json:"signedProtocol,omitempty"`
- // SharedAccessStartTime - The time at which the SAS becomes valid.
- SharedAccessStartTime *date.Time `json:"signedStart,omitempty"`
- // SharedAccessExpiryTime - The time at which the shared access signature becomes invalid.
- SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"`
- // Identifier - A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table.
- Identifier *string `json:"signedIdentifier,omitempty"`
- // PartitionKeyStart - The start of partition key.
- PartitionKeyStart *string `json:"startPk,omitempty"`
- // PartitionKeyEnd - The end of partition key.
- PartitionKeyEnd *string `json:"endPk,omitempty"`
- // RowKeyStart - The start of row key.
- RowKeyStart *string `json:"startRk,omitempty"`
- // RowKeyEnd - The end of row key.
- RowKeyEnd *string `json:"endRk,omitempty"`
- // KeyToSign - The key to sign the account SAS token with.
- KeyToSign *string `json:"keyToSign,omitempty"`
- // CacheControl - The response header override for cache control.
- CacheControl *string `json:"rscc,omitempty"`
- // ContentDisposition - The response header override for content disposition.
- ContentDisposition *string `json:"rscd,omitempty"`
- // ContentEncoding - The response header override for content encoding.
- ContentEncoding *string `json:"rsce,omitempty"`
- // ContentLanguage - The response header override for content language.
- ContentLanguage *string `json:"rscl,omitempty"`
- // ContentType - The response header override for content type.
- ContentType *string `json:"rsct,omitempty"`
-}
-
-// ServiceSpecification one property of operation, include metric specifications.
-type ServiceSpecification struct {
- // MetricSpecifications - Metric specifications of operation.
- MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
-}
-
-// Sku the SKU of the storage account.
-type Sku struct {
- // Name - Gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'StandardLRS', 'StandardGRS', 'StandardRAGRS', 'StandardZRS', 'PremiumLRS'
- Name SkuName `json:"name,omitempty"`
- // Tier - READ-ONLY; Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium'
- Tier SkuTier `json:"tier,omitempty"`
- // ResourceType - READ-ONLY; The type of the resource, usually it is 'storageAccounts'.
- ResourceType *string `json:"resourceType,omitempty"`
- // Kind - READ-ONLY; Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage'
- Kind Kind `json:"kind,omitempty"`
- // Locations - READ-ONLY; The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.).
- Locations *[]string `json:"locations,omitempty"`
- // Capabilities - READ-ONLY; The capability information in the specified sku, including file encryption, network acls, change notification, etc.
- Capabilities *[]SKUCapability `json:"capabilities,omitempty"`
- // Restrictions - The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.
- Restrictions *[]Restriction `json:"restrictions,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for Sku.
-func (s Sku) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if s.Name != "" {
- objectMap["name"] = s.Name
- }
- if s.Restrictions != nil {
- objectMap["restrictions"] = s.Restrictions
- }
- return json.Marshal(objectMap)
-}
-
-// SKUCapability the capability information in the specified sku, including file encryption, network acls,
-// change notification, etc.
-type SKUCapability struct {
- // Name - READ-ONLY; The name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc.
- Name *string `json:"name,omitempty"`
- // Value - READ-ONLY; A string value to indicate states of given capability. Possibly 'true' or 'false'.
- Value *string `json:"value,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for SKUCapability.
-func (sc SKUCapability) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// SkuListResult the response from the List Storage SKUs operation.
-type SkuListResult struct {
- autorest.Response `json:"-"`
- // Value - READ-ONLY; Get the list result of storage SKUs and their properties.
- Value *[]Sku `json:"value,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for SkuListResult.
-func (slr SkuListResult) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// Usage describes Storage Resource Usage.
-type Usage struct {
- // Unit - READ-ONLY; Gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond'
- Unit UsageUnit `json:"unit,omitempty"`
- // CurrentValue - READ-ONLY; Gets the current count of the allocated resources in the subscription.
- CurrentValue *int32 `json:"currentValue,omitempty"`
- // Limit - READ-ONLY; Gets the maximum count of the resources that can be allocated in the subscription.
- Limit *int32 `json:"limit,omitempty"`
- // Name - READ-ONLY; Gets the name of the type of usage.
- Name *UsageName `json:"name,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for Usage.
-func (u Usage) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// UsageListResult the response from the List Usages operation.
-type UsageListResult struct {
- autorest.Response `json:"-"`
- // Value - Gets or sets the list of Storage Resource Usages.
- Value *[]Usage `json:"value,omitempty"`
-}
-
-// UsageName the usage names that can be used; currently limited to StorageAccount.
-type UsageName struct {
- // Value - READ-ONLY; Gets a string describing the resource name.
- Value *string `json:"value,omitempty"`
- // LocalizedValue - READ-ONLY; Gets a localized string describing the resource name.
- LocalizedValue *string `json:"localizedValue,omitempty"`
-}
-
-// MarshalJSON is the custom marshaler for UsageName.
-func (un UsageName) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- return json.Marshal(objectMap)
-}
-
-// VirtualNetworkRule virtual Network rule.
-type VirtualNetworkRule struct {
- // VirtualNetworkResourceID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
- VirtualNetworkResourceID *string `json:"id,omitempty"`
- // Action - The action of virtual network rule. Possible values include: 'Allow'
- Action Action `json:"action,omitempty"`
- // State - Gets the state of virtual network rule. Possible values include: 'StateProvisioning', 'StateDeprovisioning', 'StateSucceeded', 'StateFailed', 'StateNetworkSourceDeleted'
- State State `json:"state,omitempty"`
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/operations.go
deleted file mode 100644
index 47665c06a..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/operations.go
+++ /dev/null
@@ -1,98 +0,0 @@
-package storage
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// OperationsClient is the the Azure Storage Management API.
-type OperationsClient struct {
- BaseClient
-}
-
-// NewOperationsClient creates an instance of the OperationsClient client.
-func NewOperationsClient(subscriptionID string) OperationsClient {
- return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this
-// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
- return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// List lists all of the available Storage Rest API operations.
-func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.OperationsClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.OperationsClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.OperationsClient", "List", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPath("/providers/Microsoft.Storage/operations"),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/skus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/skus.go
deleted file mode 100644
index b697e7ff3..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/skus.go
+++ /dev/null
@@ -1,102 +0,0 @@
-package storage
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// SkusClient is the the Azure Storage Management API.
-type SkusClient struct {
- BaseClient
-}
-
-// NewSkusClient creates an instance of the SkusClient client.
-func NewSkusClient(subscriptionID string) SkusClient {
- return NewSkusClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewSkusClientWithBaseURI creates an instance of the SkusClient client using a custom endpoint. Use this when
-// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient {
- return SkusClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// List lists the available SKUs supported by Microsoft.Storage for given subscription.
-func (client SkusClient) List(ctx context.Context) (result SkuListResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.List")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.SkusClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.SkusClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.SkusClient", "List", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client SkusClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client SkusClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client SkusClient) ListResponder(resp *http.Response) (result SkuListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/usage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/usage.go
deleted file mode 100644
index cfe43b850..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/usage.go
+++ /dev/null
@@ -1,102 +0,0 @@
-package storage
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// UsageClient is the the Azure Storage Management API.
-type UsageClient struct {
- BaseClient
-}
-
-// NewUsageClient creates an instance of the UsageClient client.
-func NewUsageClient(subscriptionID string) UsageClient {
- return NewUsageClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewUsageClientWithBaseURI creates an instance of the UsageClient client using a custom endpoint. Use this when
-// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
-func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient {
- return UsageClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// List gets the current usage count and the limit for the resources under the subscription.
-func (client UsageClient) List(ctx context.Context) (result UsageListResult, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.ListPreparer(ctx)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.UsageClient", "List", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.ListSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "storage.UsageClient", "List", resp, "Failure sending request")
- return
- }
-
- result, err = client.ListResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "storage.UsageClient", "List", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// ListPreparer prepares the List request.
-func (client UsageClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2017-10-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// ListSender sends the List request. The method will close the
-// http.Response Body if it receives an error.
-func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// ListResponder handles the response to the List request. The method always
-// closes the http.Response Body.
-func (client UsageClient) ListResponder(resp *http.Response) (result UsageListResult, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/version.go
deleted file mode 100644
index 632b1b8e8..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/version.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package storage
-
-import "github.com/Azure/azure-sdk-for-go/version"
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-// UserAgent returns the UserAgent string to use when sending http.Requests.
-func UserAgent() string {
- return "Azure-SDK-For-Go/" + Version() + " storage/2017-10-01"
-}
-
-// Version returns the semantic version (see http://semver.org) of the client.
-func Version() string {
- return version.Number
-}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/LICENSE b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/LICENSE
new file mode 100644
index 000000000..3d8b93bc7
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache/cache.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache/cache.go
new file mode 100644
index 000000000..19210883b
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache/cache.go
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+/*
+Package cache allows third parties to implement external storage for caching token data
+for distributed systems or multiple local applications access.
+
+The data stored and extracted will represent the entire cache. Therefore it is recommended
+one msal instance per user. This data is considered opaque and there are no guarantees to
+implementers on the format being passed.
+*/
+package cache
+
+import "context"
+
+// Marshaler marshals data from an internal cache to bytes that can be stored.
+type Marshaler interface {
+ Marshal() ([]byte, error)
+}
+
+// Unmarshaler unmarshals data from a storage medium into the internal cache, overwriting it.
+type Unmarshaler interface {
+ Unmarshal([]byte) error
+}
+
+// Serializer can serialize the cache to binary or from binary into the cache.
+type Serializer interface {
+ Marshaler
+ Unmarshaler
+}
+
+// ExportHints are suggestions for storing data.
+type ExportHints struct {
+ // PartitionKey is a suggested key for partitioning the cache
+ PartitionKey string
+}
+
+// ReplaceHints are suggestions for loading data.
+type ReplaceHints struct {
+ // PartitionKey is a suggested key for partitioning the cache
+ PartitionKey string
+}
+
+// ExportReplace exports and replaces in-memory cache data. It doesn't support nil Context or
+// define the outcome of passing one. A Context without a timeout must receive a default timeout
+// specified by the implementor. Retries must be implemented inside the implementation.
+type ExportReplace interface {
+ // Replace replaces the cache with what is in external storage. Implementors should honor
+ // Context cancellations and return context.Canceled or context.DeadlineExceeded in those cases.
+ Replace(ctx context.Context, cache Unmarshaler, hints ReplaceHints) error
+ // Export writes the binary representation of the cache (cache.Marshal()) to external storage.
+ // This is considered opaque. Context cancellations should be honored as in Replace.
+ Export(ctx context.Context, cache Marshaler, hints ExportHints) error
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go
new file mode 100644
index 000000000..6612feb4b
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go
@@ -0,0 +1,685 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+/*
+Package confidential provides a client for authentication of "confidential" applications.
+A "confidential" application is defined as an app that run on servers. They are considered
+difficult to access and for that reason capable of keeping an application secret.
+Confidential clients can hold configuration-time secrets.
+*/
+package confidential
+
+import (
+ "context"
+ "crypto"
+ "crypto/rsa"
+ "crypto/x509"
+ "encoding/base64"
+ "encoding/pem"
+ "errors"
+ "fmt"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/options"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared"
+)
+
+/*
+Design note:
+
+confidential.Client uses base.Client as an embedded type. base.Client statically assigns its attributes
+during creation. As it doesn't have any pointers in it, anything borrowed from it, such as
+Base.AuthParams is a copy that is free to be manipulated here.
+
+Duplicate Calls shared between public.Client and this package:
+There is some duplicate call options provided here that are the same as in public.Client . This
+is a design choices. Go proverb(https://www.youtube.com/watch?v=PAAkCSZUG1c&t=9m28s):
+"a little copying is better than a little dependency". Yes, we could have another package with
+shared options (fail). That divides like 2 options from all others which makes the user look
+through more docs. We can have all clients in one package, but I think separate packages
+here makes for better naming (public.Client vs client.PublicClient). So I chose a little
+duplication.
+
+.Net People, Take note on X509:
+This uses x509.Certificates and private keys. x509 does not store private keys. .Net
+has some x509.Certificate2 thing that has private keys, but that is just some bullcrap that .Net
+added, it doesn't exist in real life. As such I've put a PEM decoder into here.
+*/
+
+// TODO(msal): This should have example code for each method on client using Go's example doc framework.
+// base usage details should be include in the package documentation.
+
+// AuthResult contains the results of one token acquisition operation.
+// For details see https://aka.ms/msal-net-authenticationresult
+type AuthResult = base.AuthResult
+
+type Account = shared.Account
+
+// CertFromPEM converts a PEM file (.pem or .key) for use with [NewCredFromCert]. The file
+// must contain the public certificate and the private key. If a PEM block is encrypted and
+// password is not an empty string, it attempts to decrypt the PEM blocks using the password.
+// Multiple certs are due to certificate chaining for use cases like TLS that sign from root to leaf.
+func CertFromPEM(pemData []byte, password string) ([]*x509.Certificate, crypto.PrivateKey, error) {
+ var certs []*x509.Certificate
+ var priv crypto.PrivateKey
+ for {
+ block, rest := pem.Decode(pemData)
+ if block == nil {
+ break
+ }
+
+ //nolint:staticcheck // x509.IsEncryptedPEMBlock and x509.DecryptPEMBlock are deprecated. They are used here only to support a usecase.
+ if x509.IsEncryptedPEMBlock(block) {
+ b, err := x509.DecryptPEMBlock(block, []byte(password))
+ if err != nil {
+ return nil, nil, fmt.Errorf("could not decrypt encrypted PEM block: %v", err)
+ }
+ block, _ = pem.Decode(b)
+ if block == nil {
+ return nil, nil, fmt.Errorf("encounter encrypted PEM block that did not decode")
+ }
+ }
+
+ switch block.Type {
+ case "CERTIFICATE":
+ cert, err := x509.ParseCertificate(block.Bytes)
+ if err != nil {
+ return nil, nil, fmt.Errorf("block labelled 'CERTIFICATE' could not be parsed by x509: %v", err)
+ }
+ certs = append(certs, cert)
+ case "PRIVATE KEY":
+ if priv != nil {
+ return nil, nil, errors.New("found multiple private key blocks")
+ }
+
+ var err error
+ priv, err = x509.ParsePKCS8PrivateKey(block.Bytes)
+ if err != nil {
+ return nil, nil, fmt.Errorf("could not decode private key: %v", err)
+ }
+ case "RSA PRIVATE KEY":
+ if priv != nil {
+ return nil, nil, errors.New("found multiple private key blocks")
+ }
+ var err error
+ priv, err = x509.ParsePKCS1PrivateKey(block.Bytes)
+ if err != nil {
+ return nil, nil, fmt.Errorf("could not decode private key: %v", err)
+ }
+ }
+ pemData = rest
+ }
+
+ if len(certs) == 0 {
+ return nil, nil, fmt.Errorf("no certificates found")
+ }
+
+ if priv == nil {
+ return nil, nil, fmt.Errorf("no private key found")
+ }
+
+ return certs, priv, nil
+}
+
+// AssertionRequestOptions has required information for client assertion claims
+type AssertionRequestOptions = exported.AssertionRequestOptions
+
+// Credential represents the credential used in confidential client flows.
+type Credential struct {
+ secret string
+
+ cert *x509.Certificate
+ key crypto.PrivateKey
+ x5c []string
+
+ assertionCallback func(context.Context, AssertionRequestOptions) (string, error)
+
+ tokenProvider func(context.Context, TokenProviderParameters) (TokenProviderResult, error)
+}
+
+// toInternal returns the accesstokens.Credential that is used internally. The current structure of the
+// code requires that client.go, requests.go and confidential.go share a credential type without
+// having import recursion. That requires the type used between is in a shared package. Therefore
+// we have this.
+func (c Credential) toInternal() (*accesstokens.Credential, error) {
+ if c.secret != "" {
+ return &accesstokens.Credential{Secret: c.secret}, nil
+ }
+ if c.cert != nil {
+ if c.key == nil {
+ return nil, errors.New("missing private key for certificate")
+ }
+ return &accesstokens.Credential{Cert: c.cert, Key: c.key, X5c: c.x5c}, nil
+ }
+ if c.key != nil {
+ return nil, errors.New("missing certificate for private key")
+ }
+ if c.assertionCallback != nil {
+ return &accesstokens.Credential{AssertionCallback: c.assertionCallback}, nil
+ }
+ if c.tokenProvider != nil {
+ return &accesstokens.Credential{TokenProvider: c.tokenProvider}, nil
+ }
+ return nil, errors.New("invalid credential")
+}
+
+// NewCredFromSecret creates a Credential from a secret.
+func NewCredFromSecret(secret string) (Credential, error) {
+ if secret == "" {
+ return Credential{}, errors.New("secret can't be empty string")
+ }
+ return Credential{secret: secret}, nil
+}
+
+// NewCredFromAssertionCallback creates a Credential that invokes a callback to get assertions
+// authenticating the application. The callback must be thread safe.
+func NewCredFromAssertionCallback(callback func(context.Context, AssertionRequestOptions) (string, error)) Credential {
+ return Credential{assertionCallback: callback}
+}
+
+// NewCredFromCert creates a Credential from a certificate or chain of certificates and an RSA private key
+// as returned by [CertFromPEM].
+func NewCredFromCert(certs []*x509.Certificate, key crypto.PrivateKey) (Credential, error) {
+ cred := Credential{key: key}
+ k, ok := key.(*rsa.PrivateKey)
+ if !ok {
+ return cred, errors.New("key must be an RSA key")
+ }
+ for _, cert := range certs {
+ if cert == nil {
+ // not returning an error here because certs may still contain a sufficient cert/key pair
+ continue
+ }
+ certKey, ok := cert.PublicKey.(*rsa.PublicKey)
+ if ok && k.E == certKey.E && k.N.Cmp(certKey.N) == 0 {
+ // We know this is the signing cert because its public key matches the given private key.
+ // This cert must be first in x5c.
+ cred.cert = cert
+ cred.x5c = append([]string{base64.StdEncoding.EncodeToString(cert.Raw)}, cred.x5c...)
+ } else {
+ cred.x5c = append(cred.x5c, base64.StdEncoding.EncodeToString(cert.Raw))
+ }
+ }
+ if cred.cert == nil {
+ return cred, errors.New("key doesn't match any certificate")
+ }
+ return cred, nil
+}
+
+// TokenProviderParameters is the authentication parameters passed to token providers
+type TokenProviderParameters = exported.TokenProviderParameters
+
+// TokenProviderResult is the authentication result returned by custom token providers
+type TokenProviderResult = exported.TokenProviderResult
+
+// NewCredFromTokenProvider creates a Credential from a function that provides access tokens. The function
+// must be concurrency safe. This is intended only to allow the Azure SDK to cache MSI tokens. It isn't
+// useful to applications in general because the token provider must implement all authentication logic.
+func NewCredFromTokenProvider(provider func(context.Context, TokenProviderParameters) (TokenProviderResult, error)) Credential {
+ return Credential{tokenProvider: provider}
+}
+
+// AutoDetectRegion instructs MSAL Go to auto detect region for Azure regional token service.
+func AutoDetectRegion() string {
+ return "TryAutoDetect"
+}
+
+// Client is a representation of authentication client for confidential applications as defined in the
+// package doc. A new Client should be created PER SERVICE USER.
+// For more information, visit https://docs.microsoft.com/azure/active-directory/develop/msal-client-applications
+type Client struct {
+ base base.Client
+ cred *accesstokens.Credential
+}
+
+// clientOptions are optional settings for New(). These options are set using various functions
+// returning Option calls.
+type clientOptions struct {
+ accessor cache.ExportReplace
+ authority, azureRegion string
+ capabilities []string
+ disableInstanceDiscovery, sendX5C bool
+ httpClient ops.HTTPClient
+}
+
+// Option is an optional argument to New().
+type Option func(o *clientOptions)
+
+// WithCache provides an accessor that will read and write authentication data to an externally managed cache.
+func WithCache(accessor cache.ExportReplace) Option {
+ return func(o *clientOptions) {
+ o.accessor = accessor
+ }
+}
+
+// WithClientCapabilities allows configuring one or more client capabilities such as "CP1"
+func WithClientCapabilities(capabilities []string) Option {
+ return func(o *clientOptions) {
+ // there's no danger of sharing the slice's underlying memory with the application because
+ // this slice is simply passed to base.WithClientCapabilities, which copies its data
+ o.capabilities = capabilities
+ }
+}
+
+// WithHTTPClient allows for a custom HTTP client to be set.
+func WithHTTPClient(httpClient ops.HTTPClient) Option {
+ return func(o *clientOptions) {
+ o.httpClient = httpClient
+ }
+}
+
+// WithX5C specifies if x5c claim(public key of the certificate) should be sent to STS to enable Subject Name Issuer Authentication.
+func WithX5C() Option {
+ return func(o *clientOptions) {
+ o.sendX5C = true
+ }
+}
+
+// WithInstanceDiscovery set to false to disable authority validation (to support private cloud scenarios)
+func WithInstanceDiscovery(enabled bool) Option {
+ return func(o *clientOptions) {
+ o.disableInstanceDiscovery = !enabled
+ }
+}
+
+// WithAzureRegion sets the region(preferred) or Confidential.AutoDetectRegion() for auto detecting region.
+// Region names as per https://azure.microsoft.com/en-ca/global-infrastructure/geographies/.
+// See https://aka.ms/region-map for more details on region names.
+// The region value should be short region name for the region where the service is deployed.
+// For example "centralus" is short name for region Central US.
+// Not all auth flows can use the regional token service.
+// Service To Service (client credential flow) tokens can be obtained from the regional service.
+// Requires configuration at the tenant level.
+// Auto-detection works on a limited number of Azure artifacts (VMs, Azure functions).
+// If auto-detection fails, the non-regional endpoint will be used.
+// If an invalid region name is provided, the non-regional endpoint MIGHT be used or the token request MIGHT fail.
+func WithAzureRegion(val string) Option {
+ return func(o *clientOptions) {
+ o.azureRegion = val
+ }
+}
+
+// New is the constructor for Client. authority is the URL of a token authority such as "https://login.microsoftonline.com/".
+// If the Client will connect directly to AD FS, use "adfs" for the tenant. clientID is the application's client ID (also called its
+// "application ID").
+func New(authority, clientID string, cred Credential, options ...Option) (Client, error) {
+ internalCred, err := cred.toInternal()
+ if err != nil {
+ return Client{}, err
+ }
+
+ opts := clientOptions{
+ authority: authority,
+ // if the caller specified a token provider, it will handle all details of authentication, using Client only as a token cache
+ disableInstanceDiscovery: cred.tokenProvider != nil,
+ httpClient: shared.DefaultClient,
+ }
+ for _, o := range options {
+ o(&opts)
+ }
+ baseOpts := []base.Option{
+ base.WithCacheAccessor(opts.accessor),
+ base.WithClientCapabilities(opts.capabilities),
+ base.WithInstanceDiscovery(!opts.disableInstanceDiscovery),
+ base.WithRegionDetection(opts.azureRegion),
+ base.WithX5C(opts.sendX5C),
+ }
+ base, err := base.New(clientID, opts.authority, oauth.New(opts.httpClient), baseOpts...)
+ if err != nil {
+ return Client{}, err
+ }
+ base.AuthParams.IsConfidentialClient = true
+
+ return Client{base: base, cred: internalCred}, nil
+}
+
+// authCodeURLOptions contains options for AuthCodeURL
+type authCodeURLOptions struct {
+ claims, loginHint, tenantID, domainHint string
+}
+
+// AuthCodeURLOption is implemented by options for AuthCodeURL
+type AuthCodeURLOption interface {
+ authCodeURLOption()
+}
+
+// AuthCodeURL creates a URL used to acquire an authorization code. Users need to call CreateAuthorizationCodeURLParameters and pass it in.
+//
+// Options: [WithClaims], [WithDomainHint], [WithLoginHint], [WithTenantID]
+func (cca Client) AuthCodeURL(ctx context.Context, clientID, redirectURI string, scopes []string, opts ...AuthCodeURLOption) (string, error) {
+ o := authCodeURLOptions{}
+ if err := options.ApplyOptions(&o, opts); err != nil {
+ return "", err
+ }
+ ap, err := cca.base.AuthParams.WithTenant(o.tenantID)
+ if err != nil {
+ return "", err
+ }
+ ap.Claims = o.claims
+ ap.LoginHint = o.loginHint
+ ap.DomainHint = o.domainHint
+ return cca.base.AuthCodeURL(ctx, clientID, redirectURI, scopes, ap)
+}
+
+// WithLoginHint pre-populates the login prompt with a username.
+func WithLoginHint(username string) interface {
+ AuthCodeURLOption
+ options.CallOption
+} {
+ return struct {
+ AuthCodeURLOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *authCodeURLOptions:
+ t.loginHint = username
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// WithDomainHint adds the IdP domain as domain_hint query parameter in the auth url.
+func WithDomainHint(domain string) interface {
+ AuthCodeURLOption
+ options.CallOption
+} {
+ return struct {
+ AuthCodeURLOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *authCodeURLOptions:
+ t.domainHint = domain
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// WithClaims sets additional claims to request for the token, such as those required by conditional access policies.
+// Use this option when Azure AD returned a claims challenge for a prior request. The argument must be decoded.
+// This option is valid for any token acquisition method.
+func WithClaims(claims string) interface {
+ AcquireByAuthCodeOption
+ AcquireByCredentialOption
+ AcquireOnBehalfOfOption
+ AcquireSilentOption
+ AuthCodeURLOption
+ options.CallOption
+} {
+ return struct {
+ AcquireByAuthCodeOption
+ AcquireByCredentialOption
+ AcquireOnBehalfOfOption
+ AcquireSilentOption
+ AuthCodeURLOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *acquireTokenByAuthCodeOptions:
+ t.claims = claims
+ case *acquireTokenByCredentialOptions:
+ t.claims = claims
+ case *acquireTokenOnBehalfOfOptions:
+ t.claims = claims
+ case *acquireTokenSilentOptions:
+ t.claims = claims
+ case *authCodeURLOptions:
+ t.claims = claims
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// WithTenantID specifies a tenant for a single authentication. It may be different than the tenant set in [New].
+// This option is valid for any token acquisition method.
+func WithTenantID(tenantID string) interface {
+ AcquireByAuthCodeOption
+ AcquireByCredentialOption
+ AcquireOnBehalfOfOption
+ AcquireSilentOption
+ AuthCodeURLOption
+ options.CallOption
+} {
+ return struct {
+ AcquireByAuthCodeOption
+ AcquireByCredentialOption
+ AcquireOnBehalfOfOption
+ AcquireSilentOption
+ AuthCodeURLOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *acquireTokenByAuthCodeOptions:
+ t.tenantID = tenantID
+ case *acquireTokenByCredentialOptions:
+ t.tenantID = tenantID
+ case *acquireTokenOnBehalfOfOptions:
+ t.tenantID = tenantID
+ case *acquireTokenSilentOptions:
+ t.tenantID = tenantID
+ case *authCodeURLOptions:
+ t.tenantID = tenantID
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// acquireTokenSilentOptions are all the optional settings to an AcquireTokenSilent() call.
+// These are set by using various AcquireTokenSilentOption functions.
+type acquireTokenSilentOptions struct {
+ account Account
+ claims, tenantID string
+}
+
+// AcquireSilentOption is implemented by options for AcquireTokenSilent
+type AcquireSilentOption interface {
+ acquireSilentOption()
+}
+
+// WithSilentAccount uses the passed account during an AcquireTokenSilent() call.
+func WithSilentAccount(account Account) interface {
+ AcquireSilentOption
+ options.CallOption
+} {
+ return struct {
+ AcquireSilentOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *acquireTokenSilentOptions:
+ t.account = account
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// AcquireTokenSilent acquires a token from either the cache or using a refresh token.
+//
+// Options: [WithClaims], [WithSilentAccount], [WithTenantID]
+func (cca Client) AcquireTokenSilent(ctx context.Context, scopes []string, opts ...AcquireSilentOption) (AuthResult, error) {
+ o := acquireTokenSilentOptions{}
+ if err := options.ApplyOptions(&o, opts); err != nil {
+ return AuthResult{}, err
+ }
+
+ if o.claims != "" {
+ return AuthResult{}, errors.New("call another AcquireToken method to request a new token having these claims")
+ }
+
+ silentParameters := base.AcquireTokenSilentParameters{
+ Scopes: scopes,
+ Account: o.account,
+ RequestType: accesstokens.ATConfidential,
+ Credential: cca.cred,
+ IsAppCache: o.account.IsZero(),
+ TenantID: o.tenantID,
+ }
+
+ return cca.base.AcquireTokenSilent(ctx, silentParameters)
+}
+
+// acquireTokenByAuthCodeOptions contains the optional parameters used to acquire an access token using the authorization code flow.
+type acquireTokenByAuthCodeOptions struct {
+ challenge, claims, tenantID string
+}
+
+// AcquireByAuthCodeOption is implemented by options for AcquireTokenByAuthCode
+type AcquireByAuthCodeOption interface {
+ acquireByAuthCodeOption()
+}
+
+// WithChallenge allows you to provide a challenge for the .AcquireTokenByAuthCode() call.
+func WithChallenge(challenge string) interface {
+ AcquireByAuthCodeOption
+ options.CallOption
+} {
+ return struct {
+ AcquireByAuthCodeOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *acquireTokenByAuthCodeOptions:
+ t.challenge = challenge
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// AcquireTokenByAuthCode is a request to acquire a security token from the authority, using an authorization code.
+// The specified redirect URI must be the same URI that was used when the authorization code was requested.
+//
+// Options: [WithChallenge], [WithClaims], [WithTenantID]
+func (cca Client) AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, opts ...AcquireByAuthCodeOption) (AuthResult, error) {
+ o := acquireTokenByAuthCodeOptions{}
+ if err := options.ApplyOptions(&o, opts); err != nil {
+ return AuthResult{}, err
+ }
+
+ params := base.AcquireTokenAuthCodeParameters{
+ Scopes: scopes,
+ Code: code,
+ Challenge: o.challenge,
+ Claims: o.claims,
+ AppType: accesstokens.ATConfidential,
+ Credential: cca.cred, // This setting differs from public.Client.AcquireTokenByAuthCode
+ RedirectURI: redirectURI,
+ TenantID: o.tenantID,
+ }
+
+ return cca.base.AcquireTokenByAuthCode(ctx, params)
+}
+
+// acquireTokenByCredentialOptions contains optional configuration for AcquireTokenByCredential
+type acquireTokenByCredentialOptions struct {
+ claims, tenantID string
+}
+
+// AcquireByCredentialOption is implemented by options for AcquireTokenByCredential
+type AcquireByCredentialOption interface {
+ acquireByCredOption()
+}
+
+// AcquireTokenByCredential acquires a security token from the authority, using the client credentials grant.
+//
+// Options: [WithClaims], [WithTenantID]
+func (cca Client) AcquireTokenByCredential(ctx context.Context, scopes []string, opts ...AcquireByCredentialOption) (AuthResult, error) {
+ o := acquireTokenByCredentialOptions{}
+ err := options.ApplyOptions(&o, opts)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ authParams, err := cca.base.AuthParams.WithTenant(o.tenantID)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ authParams.Scopes = scopes
+ authParams.AuthorizationType = authority.ATClientCredentials
+ authParams.Claims = o.claims
+
+ token, err := cca.base.Token.Credential(ctx, authParams, cca.cred)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ return cca.base.AuthResultFromToken(ctx, authParams, token, true)
+}
+
+// acquireTokenOnBehalfOfOptions contains optional configuration for AcquireTokenOnBehalfOf
+type acquireTokenOnBehalfOfOptions struct {
+ claims, tenantID string
+}
+
+// AcquireOnBehalfOfOption is implemented by options for AcquireTokenOnBehalfOf
+type AcquireOnBehalfOfOption interface {
+ acquireOBOOption()
+}
+
+// AcquireTokenOnBehalfOf acquires a security token for an app using middle tier apps access token.
+// Refer https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow.
+//
+// Options: [WithClaims], [WithTenantID]
+func (cca Client) AcquireTokenOnBehalfOf(ctx context.Context, userAssertion string, scopes []string, opts ...AcquireOnBehalfOfOption) (AuthResult, error) {
+ o := acquireTokenOnBehalfOfOptions{}
+ if err := options.ApplyOptions(&o, opts); err != nil {
+ return AuthResult{}, err
+ }
+ params := base.AcquireTokenOnBehalfOfParameters{
+ Scopes: scopes,
+ UserAssertion: userAssertion,
+ Claims: o.claims,
+ Credential: cca.cred,
+ TenantID: o.tenantID,
+ }
+ return cca.base.AcquireTokenOnBehalfOf(ctx, params)
+}
+
+// Account gets the account in the token cache with the specified homeAccountID.
+func (cca Client) Account(ctx context.Context, accountID string) (Account, error) {
+ return cca.base.Account(ctx, accountID)
+}
+
+// RemoveAccount signs the account out and forgets account from token cache.
+func (cca Client) RemoveAccount(ctx context.Context, account Account) error {
+ return cca.base.RemoveAccount(ctx, account)
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/error_design.md b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/error_design.md
new file mode 100644
index 000000000..7ef7862fe
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/error_design.md
@@ -0,0 +1,111 @@
+# MSAL Error Design
+
+Author: Abhidnya Patil(abhidnya.patil@microsoft.com)
+
+Contributors:
+
+- John Doak(jdoak@microsoft.com)
+- Keegan Caruso(Keegan.Caruso@microsoft.com)
+- Joel Hendrix(jhendrix@microsoft.com)
+
+## Background
+
+Errors in MSAL are intended for app developers to troubleshoot and not for displaying to end-users.
+
+### Go error handling vs other MSAL languages
+
+Most modern languages use exception based errors. Simply put, you "throw" an exception and it must be caught at some routine in the upper stack or it will eventually crash the program.
+
+Go doesn't use exceptions, instead it relies on multiple return values, one of which can be the builtin error interface type. It is up to the user to decide what to do.
+
+### Go custom error types
+
+Errors can be created in Go by simply using errors.New() or fmt.Errorf() to create an "error".
+
+Custom errors can be created in multiple ways. One of the more robust ways is simply to satisfy the error interface:
+
+```go
+type MyCustomErr struct {
+ Msg string
+}
+func (m MyCustomErr) Error() string { // This implements "error"
+ return m.Msg
+}
+```
+
+### MSAL Error Goals
+
+- Provide diagnostics to the user and for tickets that can be used to track down bugs or client misconfigurations
+- Detect errors that are transitory and can be retried
+- Allow the user to identify certain errors that the program can respond to, such a informing the user for the need to do an enrollment
+
+## Implementing Client Side Errors
+
+Client side errors indicate a misconfiguration or passing of bad arguments that is non-recoverable. Retrying isn't possible.
+
+These errors can simply be standard Go errors created by errors.New() or fmt.Errorf(). If down the line we need a custom error, we can introduce it, but for now the error messages just need to be clear on what the issue was.
+
+## Implementing Service Side Errors
+
+Service side errors occur when an external RPC responds either with an HTTP error code or returns a message that includes an error.
+
+These errors can be transitory (please slow down) or permanent (HTTP 404). To provide our diagnostic goals, we require the ability to differentiate these errors from other errors.
+
+The current implementation includes a specialized type that captures any error from the server:
+
+```go
+// CallErr represents an HTTP call error. Has a Verbose() method that allows getting the
+// http.Request and Response objects. Implements error.
+type CallErr struct {
+ Req *http.Request
+ Resp *http.Response
+ Err error
+}
+
+// Errors implements error.Error().
+func (e CallErr) Error() string {
+ return e.Err.Error()
+}
+
+// Verbose prints a versbose error message with the request or response.
+func (e CallErr) Verbose() string {
+ e.Resp.Request = nil // This brings in a bunch of TLS stuff we don't need
+ e.Resp.TLS = nil // Same
+ return fmt.Sprintf("%s:\nRequest:\n%s\nResponse:\n%s", e.Err, prettyConf.Sprint(e.Req), prettyConf.Sprint(e.Resp))
+}
+```
+
+A user will always receive the most concise error we provide. They can tell if it is a server side error using Go error package:
+
+```go
+var callErr CallErr
+if errors.As(err, &callErr) {
+ ...
+}
+```
+
+We provide a Verbose() function that can retrieve the most verbose message from any error we provide:
+
+```go
+fmt.Println(errors.Verbose(err))
+```
+
+If further differentiation is required, we can add custom errors that use Go error wrapping on top of CallErr to achieve our diagnostic goals (such as detecting when to retry a call due to transient errors).
+
+CallErr is always thrown from the comm package (which handles all http requests) and looks similar to:
+
+```go
+return nil, errors.CallErr{
+ Req: req,
+ Resp: reply,
+ Err: fmt.Errorf("http call(%s)(%s) error: reply status code was %d:\n%s", req.URL.String(), req.Method, reply.StatusCode, ErrorResponse), //ErrorResponse is the json body extracted from the http response
+ }
+```
+
+## Future Decisions
+
+The ability to retry calls needs to have centralized responsibility. Either the user is doing it or the client is doing it.
+
+If the user should be responsible, our errors package will include a CanRetry() function that will inform the user if the error provided to them is retryable. This is based on the http error code and possibly the type of error that was returned. It would also include a sleep time if the server returned an amount of time to wait.
+
+Otherwise we will do this internally and retries will be left to us.
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/errors.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/errors.go
new file mode 100644
index 000000000..c9b8dbed0
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/errors.go
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package errors
+
+import (
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "reflect"
+ "strings"
+
+ "github.com/kylelemons/godebug/pretty"
+)
+
+var prettyConf = &pretty.Config{
+ IncludeUnexported: false,
+ SkipZeroFields: true,
+ TrackCycles: true,
+ Formatter: map[reflect.Type]interface{}{
+ reflect.TypeOf((*io.Reader)(nil)).Elem(): func(r io.Reader) string {
+ b, err := io.ReadAll(r)
+ if err != nil {
+ return "could not read io.Reader content"
+ }
+ return string(b)
+ },
+ },
+}
+
+type verboser interface {
+ Verbose() string
+}
+
+// Verbose prints the most verbose error that the error message has.
+func Verbose(err error) string {
+ build := strings.Builder{}
+ for {
+ if err == nil {
+ break
+ }
+ if v, ok := err.(verboser); ok {
+ build.WriteString(v.Verbose())
+ } else {
+ build.WriteString(err.Error())
+ }
+ err = errors.Unwrap(err)
+ }
+ return build.String()
+}
+
+// New is equivalent to errors.New().
+func New(text string) error {
+ return errors.New(text)
+}
+
+// CallErr represents an HTTP call error. Has a Verbose() method that allows getting the
+// http.Request and Response objects. Implements error.
+type CallErr struct {
+ Req *http.Request
+ // Resp contains response body
+ Resp *http.Response
+ Err error
+}
+
+// Errors implements error.Error().
+func (e CallErr) Error() string {
+ return e.Err.Error()
+}
+
+// Verbose prints a versbose error message with the request or response.
+func (e CallErr) Verbose() string {
+ e.Resp.Request = nil // This brings in a bunch of TLS crap we don't need
+ e.Resp.TLS = nil // Same
+ return fmt.Sprintf("%s:\nRequest:\n%s\nResponse:\n%s", e.Err, prettyConf.Sprint(e.Req), prettyConf.Sprint(e.Resp))
+}
+
+// Is reports whether any error in errors chain matches target.
+func Is(err, target error) bool {
+ return errors.Is(err, target)
+}
+
+// As finds the first error in errors chain that matches target,
+// and if so, sets target to that error value and returns true.
+// Otherwise, it returns false.
+func As(err error, target interface{}) bool {
+ return errors.As(err, target)
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go
new file mode 100644
index 000000000..5f68384f6
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go
@@ -0,0 +1,467 @@
+// Package base contains a "Base" client that is used by the external public.Client and confidential.Client.
+// Base holds shared attributes that must be available to both clients and methods that act as
+// shared calls.
+package base
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "net/url"
+ "reflect"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared"
+)
+
+const (
+ // AuthorityPublicCloud is the default AAD authority host
+ AuthorityPublicCloud = "https://login.microsoftonline.com/common"
+ scopeSeparator = " "
+)
+
+// manager provides an internal cache. It is defined to allow faking the cache in tests.
+// In production it's a *storage.Manager or *storage.PartitionedManager.
+type manager interface {
+ cache.Serializer
+ Read(context.Context, authority.AuthParams) (storage.TokenResponse, error)
+ Write(authority.AuthParams, accesstokens.TokenResponse) (shared.Account, error)
+}
+
+// accountManager is a manager that also caches accounts. In production it's a *storage.Manager.
+type accountManager interface {
+ manager
+ AllAccounts() []shared.Account
+ Account(homeAccountID string) shared.Account
+ RemoveAccount(account shared.Account, clientID string)
+}
+
+// AcquireTokenSilentParameters contains the parameters to acquire a token silently (from cache).
+type AcquireTokenSilentParameters struct {
+ Scopes []string
+ Account shared.Account
+ RequestType accesstokens.AppType
+ Credential *accesstokens.Credential
+ IsAppCache bool
+ TenantID string
+ UserAssertion string
+ AuthorizationType authority.AuthorizeType
+ Claims string
+}
+
+// AcquireTokenAuthCodeParameters contains the parameters required to acquire an access token using the auth code flow.
+// To use PKCE, set the CodeChallengeParameter.
+// Code challenges are used to secure authorization code grants; for more information, visit
+// https://tools.ietf.org/html/rfc7636.
+type AcquireTokenAuthCodeParameters struct {
+ Scopes []string
+ Code string
+ Challenge string
+ Claims string
+ RedirectURI string
+ AppType accesstokens.AppType
+ Credential *accesstokens.Credential
+ TenantID string
+}
+
+type AcquireTokenOnBehalfOfParameters struct {
+ Scopes []string
+ Claims string
+ Credential *accesstokens.Credential
+ TenantID string
+ UserAssertion string
+}
+
+// AuthResult contains the results of one token acquisition operation in PublicClientApplication
+// or ConfidentialClientApplication. For details see https://aka.ms/msal-net-authenticationresult
+type AuthResult struct {
+ Account shared.Account
+ IDToken accesstokens.IDToken
+ AccessToken string
+ ExpiresOn time.Time
+ GrantedScopes []string
+ DeclinedScopes []string
+}
+
+// AuthResultFromStorage creates an AuthResult from a storage token response (which is generated from the cache).
+func AuthResultFromStorage(storageTokenResponse storage.TokenResponse) (AuthResult, error) {
+ if err := storageTokenResponse.AccessToken.Validate(); err != nil {
+ return AuthResult{}, fmt.Errorf("problem with access token in StorageTokenResponse: %w", err)
+ }
+
+ account := storageTokenResponse.Account
+ accessToken := storageTokenResponse.AccessToken.Secret
+ grantedScopes := strings.Split(storageTokenResponse.AccessToken.Scopes, scopeSeparator)
+
+ // Checking if there was an ID token in the cache; this will throw an error in the case of confidential client applications.
+ var idToken accesstokens.IDToken
+ if !storageTokenResponse.IDToken.IsZero() {
+ err := idToken.UnmarshalJSON([]byte(storageTokenResponse.IDToken.Secret))
+ if err != nil {
+ return AuthResult{}, fmt.Errorf("problem decoding JWT token: %w", err)
+ }
+ }
+ return AuthResult{account, idToken, accessToken, storageTokenResponse.AccessToken.ExpiresOn.T, grantedScopes, nil}, nil
+}
+
+// NewAuthResult creates an AuthResult.
+func NewAuthResult(tokenResponse accesstokens.TokenResponse, account shared.Account) (AuthResult, error) {
+ if len(tokenResponse.DeclinedScopes) > 0 {
+ return AuthResult{}, fmt.Errorf("token response failed because declined scopes are present: %s", strings.Join(tokenResponse.DeclinedScopes, ","))
+ }
+ return AuthResult{
+ Account: account,
+ IDToken: tokenResponse.IDToken,
+ AccessToken: tokenResponse.AccessToken,
+ ExpiresOn: tokenResponse.ExpiresOn.T,
+ GrantedScopes: tokenResponse.GrantedScopes.Slice,
+ }, nil
+}
+
+// Client is a base client that provides access to common methods and primatives that
+// can be used by multiple clients.
+type Client struct {
+ Token *oauth.Client
+ manager accountManager // *storage.Manager or fakeManager in tests
+ // pmanager is a partitioned cache for OBO authentication. *storage.PartitionedManager or fakeManager in tests
+ pmanager manager
+
+ AuthParams authority.AuthParams // DO NOT EVER MAKE THIS A POINTER! See "Note" in New().
+ cacheAccessor cache.ExportReplace
+ cacheAccessorMu *sync.RWMutex
+}
+
+// Option is an optional argument to the New constructor.
+type Option func(c *Client) error
+
+// WithCacheAccessor allows you to set some type of cache for storing authentication tokens.
+func WithCacheAccessor(ca cache.ExportReplace) Option {
+ return func(c *Client) error {
+ if ca != nil {
+ c.cacheAccessor = ca
+ }
+ return nil
+ }
+}
+
+// WithClientCapabilities allows configuring one or more client capabilities such as "CP1"
+func WithClientCapabilities(capabilities []string) Option {
+ return func(c *Client) error {
+ var err error
+ if len(capabilities) > 0 {
+ cc, err := authority.NewClientCapabilities(capabilities)
+ if err == nil {
+ c.AuthParams.Capabilities = cc
+ }
+ }
+ return err
+ }
+}
+
+// WithKnownAuthorityHosts specifies hosts Client shouldn't validate or request metadata for because they're known to the user
+func WithKnownAuthorityHosts(hosts []string) Option {
+ return func(c *Client) error {
+ cp := make([]string, len(hosts))
+ copy(cp, hosts)
+ c.AuthParams.KnownAuthorityHosts = cp
+ return nil
+ }
+}
+
+// WithX5C specifies if x5c claim(public key of the certificate) should be sent to STS to enable Subject Name Issuer Authentication.
+func WithX5C(sendX5C bool) Option {
+ return func(c *Client) error {
+ c.AuthParams.SendX5C = sendX5C
+ return nil
+ }
+}
+
+func WithRegionDetection(region string) Option {
+ return func(c *Client) error {
+ c.AuthParams.AuthorityInfo.Region = region
+ return nil
+ }
+}
+
+func WithInstanceDiscovery(instanceDiscoveryEnabled bool) Option {
+ return func(c *Client) error {
+ c.AuthParams.AuthorityInfo.ValidateAuthority = instanceDiscoveryEnabled
+ c.AuthParams.AuthorityInfo.InstanceDiscoveryDisabled = !instanceDiscoveryEnabled
+ return nil
+ }
+}
+
+// New is the constructor for Base.
+func New(clientID string, authorityURI string, token *oauth.Client, options ...Option) (Client, error) {
+ //By default, validateAuthority is set to true and instanceDiscoveryDisabled is set to false
+ authInfo, err := authority.NewInfoFromAuthorityURI(authorityURI, true, false)
+ if err != nil {
+ return Client{}, err
+ }
+ authParams := authority.NewAuthParams(clientID, authInfo)
+ client := Client{ // Note: Hey, don't even THINK about making Base into *Base. See "design notes" in public.go and confidential.go
+ Token: token,
+ AuthParams: authParams,
+ cacheAccessorMu: &sync.RWMutex{},
+ manager: storage.New(token),
+ pmanager: storage.NewPartitionedManager(token),
+ }
+ for _, o := range options {
+ if err = o(&client); err != nil {
+ break
+ }
+ }
+ return client, err
+
+}
+
+// AuthCodeURL creates a URL used to acquire an authorization code.
+func (b Client) AuthCodeURL(ctx context.Context, clientID, redirectURI string, scopes []string, authParams authority.AuthParams) (string, error) {
+ endpoints, err := b.Token.ResolveEndpoints(ctx, authParams.AuthorityInfo, "")
+ if err != nil {
+ return "", err
+ }
+
+ baseURL, err := url.Parse(endpoints.AuthorizationEndpoint)
+ if err != nil {
+ return "", err
+ }
+
+ claims, err := authParams.MergeCapabilitiesAndClaims()
+ if err != nil {
+ return "", err
+ }
+
+ v := url.Values{}
+ v.Add("client_id", clientID)
+ v.Add("response_type", "code")
+ v.Add("redirect_uri", redirectURI)
+ v.Add("scope", strings.Join(scopes, scopeSeparator))
+ if authParams.State != "" {
+ v.Add("state", authParams.State)
+ }
+ if claims != "" {
+ v.Add("claims", claims)
+ }
+ if authParams.CodeChallenge != "" {
+ v.Add("code_challenge", authParams.CodeChallenge)
+ }
+ if authParams.CodeChallengeMethod != "" {
+ v.Add("code_challenge_method", authParams.CodeChallengeMethod)
+ }
+ if authParams.LoginHint != "" {
+ v.Add("login_hint", authParams.LoginHint)
+ }
+ if authParams.Prompt != "" {
+ v.Add("prompt", authParams.Prompt)
+ }
+ if authParams.DomainHint != "" {
+ v.Add("domain_hint", authParams.DomainHint)
+ }
+ // There were left over from an implementation that didn't use any of these. We may
+ // need to add them later, but as of now aren't needed.
+ /*
+ if p.ResponseMode != "" {
+ urlParams.Add("response_mode", p.ResponseMode)
+ }
+ */
+ baseURL.RawQuery = v.Encode()
+ return baseURL.String(), nil
+}
+
+func (b Client) AcquireTokenSilent(ctx context.Context, silent AcquireTokenSilentParameters) (AuthResult, error) {
+ ar := AuthResult{}
+ // when tenant == "", the caller didn't specify a tenant and WithTenant will choose the client's configured tenant
+ tenant := silent.TenantID
+ authParams, err := b.AuthParams.WithTenant(tenant)
+ if err != nil {
+ return ar, err
+ }
+ authParams.Scopes = silent.Scopes
+ authParams.HomeAccountID = silent.Account.HomeAccountID
+ authParams.AuthorizationType = silent.AuthorizationType
+ authParams.Claims = silent.Claims
+ authParams.UserAssertion = silent.UserAssertion
+
+ m := b.pmanager
+ if authParams.AuthorizationType != authority.ATOnBehalfOf {
+ authParams.AuthorizationType = authority.ATRefreshToken
+ m = b.manager
+ }
+ if b.cacheAccessor != nil {
+ key := authParams.CacheKey(silent.IsAppCache)
+ b.cacheAccessorMu.RLock()
+ err = b.cacheAccessor.Replace(ctx, m, cache.ReplaceHints{PartitionKey: key})
+ b.cacheAccessorMu.RUnlock()
+ }
+ if err != nil {
+ return ar, err
+ }
+ storageTokenResponse, err := m.Read(ctx, authParams)
+ if err != nil {
+ return ar, err
+ }
+
+ // ignore cached access tokens when given claims
+ if silent.Claims == "" {
+ ar, err = AuthResultFromStorage(storageTokenResponse)
+ if err == nil {
+ return ar, err
+ }
+ }
+
+ // redeem a cached refresh token, if available
+ if reflect.ValueOf(storageTokenResponse.RefreshToken).IsZero() {
+ return ar, errors.New("no token found")
+ }
+ var cc *accesstokens.Credential
+ if silent.RequestType == accesstokens.ATConfidential {
+ cc = silent.Credential
+ }
+ token, err := b.Token.Refresh(ctx, silent.RequestType, authParams, cc, storageTokenResponse.RefreshToken)
+ if err != nil {
+ return ar, err
+ }
+ return b.AuthResultFromToken(ctx, authParams, token, true)
+}
+
+func (b Client) AcquireTokenByAuthCode(ctx context.Context, authCodeParams AcquireTokenAuthCodeParameters) (AuthResult, error) {
+ authParams, err := b.AuthParams.WithTenant(authCodeParams.TenantID)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ authParams.Claims = authCodeParams.Claims
+ authParams.Scopes = authCodeParams.Scopes
+ authParams.Redirecturi = authCodeParams.RedirectURI
+ authParams.AuthorizationType = authority.ATAuthCode
+
+ var cc *accesstokens.Credential
+ if authCodeParams.AppType == accesstokens.ATConfidential {
+ cc = authCodeParams.Credential
+ authParams.IsConfidentialClient = true
+ }
+
+ req, err := accesstokens.NewCodeChallengeRequest(authParams, authCodeParams.AppType, cc, authCodeParams.Code, authCodeParams.Challenge)
+ if err != nil {
+ return AuthResult{}, err
+ }
+
+ token, err := b.Token.AuthCode(ctx, req)
+ if err != nil {
+ return AuthResult{}, err
+ }
+
+ return b.AuthResultFromToken(ctx, authParams, token, true)
+}
+
+// AcquireTokenOnBehalfOf acquires a security token for an app using middle tier apps access token.
+func (b Client) AcquireTokenOnBehalfOf(ctx context.Context, onBehalfOfParams AcquireTokenOnBehalfOfParameters) (AuthResult, error) {
+ var ar AuthResult
+ silentParameters := AcquireTokenSilentParameters{
+ Scopes: onBehalfOfParams.Scopes,
+ RequestType: accesstokens.ATConfidential,
+ Credential: onBehalfOfParams.Credential,
+ UserAssertion: onBehalfOfParams.UserAssertion,
+ AuthorizationType: authority.ATOnBehalfOf,
+ TenantID: onBehalfOfParams.TenantID,
+ Claims: onBehalfOfParams.Claims,
+ }
+ ar, err := b.AcquireTokenSilent(ctx, silentParameters)
+ if err == nil {
+ return ar, err
+ }
+ authParams, err := b.AuthParams.WithTenant(onBehalfOfParams.TenantID)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ authParams.AuthorizationType = authority.ATOnBehalfOf
+ authParams.Claims = onBehalfOfParams.Claims
+ authParams.Scopes = onBehalfOfParams.Scopes
+ authParams.UserAssertion = onBehalfOfParams.UserAssertion
+ token, err := b.Token.OnBehalfOf(ctx, authParams, onBehalfOfParams.Credential)
+ if err == nil {
+ ar, err = b.AuthResultFromToken(ctx, authParams, token, true)
+ }
+ return ar, err
+}
+
+func (b Client) AuthResultFromToken(ctx context.Context, authParams authority.AuthParams, token accesstokens.TokenResponse, cacheWrite bool) (AuthResult, error) {
+ if !cacheWrite {
+ return NewAuthResult(token, shared.Account{})
+ }
+ var m manager = b.manager
+ if authParams.AuthorizationType == authority.ATOnBehalfOf {
+ m = b.pmanager
+ }
+ key := token.CacheKey(authParams)
+ if b.cacheAccessor != nil {
+ b.cacheAccessorMu.Lock()
+ defer b.cacheAccessorMu.Unlock()
+ err := b.cacheAccessor.Replace(ctx, m, cache.ReplaceHints{PartitionKey: key})
+ if err != nil {
+ return AuthResult{}, err
+ }
+ }
+ account, err := m.Write(authParams, token)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ ar, err := NewAuthResult(token, account)
+ if err == nil && b.cacheAccessor != nil {
+ err = b.cacheAccessor.Export(ctx, b.manager, cache.ExportHints{PartitionKey: key})
+ }
+ return ar, err
+}
+
+func (b Client) AllAccounts(ctx context.Context) ([]shared.Account, error) {
+ if b.cacheAccessor != nil {
+ b.cacheAccessorMu.RLock()
+ defer b.cacheAccessorMu.RUnlock()
+ key := b.AuthParams.CacheKey(false)
+ err := b.cacheAccessor.Replace(ctx, b.manager, cache.ReplaceHints{PartitionKey: key})
+ if err != nil {
+ return nil, err
+ }
+ }
+ return b.manager.AllAccounts(), nil
+}
+
+func (b Client) Account(ctx context.Context, homeAccountID string) (shared.Account, error) {
+ if b.cacheAccessor != nil {
+ b.cacheAccessorMu.RLock()
+ defer b.cacheAccessorMu.RUnlock()
+ authParams := b.AuthParams // This is a copy, as we don't have a pointer receiver and .AuthParams is not a pointer.
+ authParams.AuthorizationType = authority.AccountByID
+ authParams.HomeAccountID = homeAccountID
+ key := b.AuthParams.CacheKey(false)
+ err := b.cacheAccessor.Replace(ctx, b.manager, cache.ReplaceHints{PartitionKey: key})
+ if err != nil {
+ return shared.Account{}, err
+ }
+ }
+ return b.manager.Account(homeAccountID), nil
+}
+
+// RemoveAccount removes all the ATs, RTs and IDTs from the cache associated with this account.
+func (b Client) RemoveAccount(ctx context.Context, account shared.Account) error {
+ if b.cacheAccessor == nil {
+ b.manager.RemoveAccount(account, b.AuthParams.ClientID)
+ return nil
+ }
+ b.cacheAccessorMu.Lock()
+ defer b.cacheAccessorMu.Unlock()
+ key := b.AuthParams.CacheKey(false)
+ err := b.cacheAccessor.Replace(ctx, b.manager, cache.ReplaceHints{PartitionKey: key})
+ if err != nil {
+ return err
+ }
+ b.manager.RemoveAccount(account, b.AuthParams.ClientID)
+ return b.cacheAccessor.Export(ctx, b.manager, cache.ExportHints{PartitionKey: key})
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/items.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/items.go
new file mode 100644
index 000000000..5d4c9f1d1
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/items.go
@@ -0,0 +1,203 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package storage
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+ "strings"
+ "time"
+
+ internalTime "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared"
+)
+
+// Contract is the JSON structure that is written to any storage medium when serializing
+// the internal cache. This design is shared between MSAL versions in many languages.
+// This cannot be changed without design that includes other SDKs.
+type Contract struct {
+ AccessTokens map[string]AccessToken `json:"AccessToken,omitempty"`
+ RefreshTokens map[string]accesstokens.RefreshToken `json:"RefreshToken,omitempty"`
+ IDTokens map[string]IDToken `json:"IdToken,omitempty"`
+ Accounts map[string]shared.Account `json:"Account,omitempty"`
+ AppMetaData map[string]AppMetaData `json:"AppMetadata,omitempty"`
+
+ AdditionalFields map[string]interface{}
+}
+
+// Contract is the JSON structure that is written to any storage medium when serializing
+// the internal cache. This design is shared between MSAL versions in many languages.
+// This cannot be changed without design that includes other SDKs.
+type InMemoryContract struct {
+ AccessTokensPartition map[string]map[string]AccessToken
+ RefreshTokensPartition map[string]map[string]accesstokens.RefreshToken
+ IDTokensPartition map[string]map[string]IDToken
+ AccountsPartition map[string]map[string]shared.Account
+ AppMetaData map[string]AppMetaData
+}
+
+// NewContract is the constructor for Contract.
+func NewInMemoryContract() *InMemoryContract {
+ return &InMemoryContract{
+ AccessTokensPartition: map[string]map[string]AccessToken{},
+ RefreshTokensPartition: map[string]map[string]accesstokens.RefreshToken{},
+ IDTokensPartition: map[string]map[string]IDToken{},
+ AccountsPartition: map[string]map[string]shared.Account{},
+ AppMetaData: map[string]AppMetaData{},
+ }
+}
+
+// NewContract is the constructor for Contract.
+func NewContract() *Contract {
+ return &Contract{
+ AccessTokens: map[string]AccessToken{},
+ RefreshTokens: map[string]accesstokens.RefreshToken{},
+ IDTokens: map[string]IDToken{},
+ Accounts: map[string]shared.Account{},
+ AppMetaData: map[string]AppMetaData{},
+ AdditionalFields: map[string]interface{}{},
+ }
+}
+
+// AccessToken is the JSON representation of a MSAL access token for encoding to storage.
+type AccessToken struct {
+ HomeAccountID string `json:"home_account_id,omitempty"`
+ Environment string `json:"environment,omitempty"`
+ Realm string `json:"realm,omitempty"`
+ CredentialType string `json:"credential_type,omitempty"`
+ ClientID string `json:"client_id,omitempty"`
+ Secret string `json:"secret,omitempty"`
+ Scopes string `json:"target,omitempty"`
+ ExpiresOn internalTime.Unix `json:"expires_on,omitempty"`
+ ExtendedExpiresOn internalTime.Unix `json:"extended_expires_on,omitempty"`
+ CachedAt internalTime.Unix `json:"cached_at,omitempty"`
+ UserAssertionHash string `json:"user_assertion_hash,omitempty"`
+
+ AdditionalFields map[string]interface{}
+}
+
+// NewAccessToken is the constructor for AccessToken.
+func NewAccessToken(homeID, env, realm, clientID string, cachedAt, expiresOn, extendedExpiresOn time.Time, scopes, token string) AccessToken {
+ return AccessToken{
+ HomeAccountID: homeID,
+ Environment: env,
+ Realm: realm,
+ CredentialType: "AccessToken",
+ ClientID: clientID,
+ Secret: token,
+ Scopes: scopes,
+ CachedAt: internalTime.Unix{T: cachedAt.UTC()},
+ ExpiresOn: internalTime.Unix{T: expiresOn.UTC()},
+ ExtendedExpiresOn: internalTime.Unix{T: extendedExpiresOn.UTC()},
+ }
+}
+
+// Key outputs the key that can be used to uniquely look up this entry in a map.
+func (a AccessToken) Key() string {
+ key := strings.Join(
+ []string{a.HomeAccountID, a.Environment, a.CredentialType, a.ClientID, a.Realm, a.Scopes},
+ shared.CacheKeySeparator,
+ )
+ return strings.ToLower(key)
+}
+
+// FakeValidate enables tests to fake access token validation
+var FakeValidate func(AccessToken) error
+
+// Validate validates that this AccessToken can be used.
+func (a AccessToken) Validate() error {
+ if FakeValidate != nil {
+ return FakeValidate(a)
+ }
+ if a.CachedAt.T.After(time.Now()) {
+ return errors.New("access token isn't valid, it was cached at a future time")
+ }
+ if a.ExpiresOn.T.Before(time.Now().Add(5 * time.Minute)) {
+ return fmt.Errorf("access token is expired")
+ }
+ if a.CachedAt.T.IsZero() {
+ return fmt.Errorf("access token does not have CachedAt set")
+ }
+ return nil
+}
+
+// IDToken is the JSON representation of an MSAL id token for encoding to storage.
+type IDToken struct {
+ HomeAccountID string `json:"home_account_id,omitempty"`
+ Environment string `json:"environment,omitempty"`
+ Realm string `json:"realm,omitempty"`
+ CredentialType string `json:"credential_type,omitempty"`
+ ClientID string `json:"client_id,omitempty"`
+ Secret string `json:"secret,omitempty"`
+ UserAssertionHash string `json:"user_assertion_hash,omitempty"`
+ AdditionalFields map[string]interface{}
+}
+
+// IsZero determines if IDToken is the zero value.
+func (i IDToken) IsZero() bool {
+ v := reflect.ValueOf(i)
+ for i := 0; i < v.NumField(); i++ {
+ field := v.Field(i)
+ if !field.IsZero() {
+ switch field.Kind() {
+ case reflect.Map, reflect.Slice:
+ if field.Len() == 0 {
+ continue
+ }
+ }
+ return false
+ }
+ }
+ return true
+}
+
+// NewIDToken is the constructor for IDToken.
+func NewIDToken(homeID, env, realm, clientID, idToken string) IDToken {
+ return IDToken{
+ HomeAccountID: homeID,
+ Environment: env,
+ Realm: realm,
+ CredentialType: "IDToken",
+ ClientID: clientID,
+ Secret: idToken,
+ }
+}
+
+// Key outputs the key that can be used to uniquely look up this entry in a map.
+func (id IDToken) Key() string {
+ key := strings.Join(
+ []string{id.HomeAccountID, id.Environment, id.CredentialType, id.ClientID, id.Realm},
+ shared.CacheKeySeparator,
+ )
+ return strings.ToLower(key)
+}
+
+// AppMetaData is the JSON representation of application metadata for encoding to storage.
+type AppMetaData struct {
+ FamilyID string `json:"family_id,omitempty"`
+ ClientID string `json:"client_id,omitempty"`
+ Environment string `json:"environment,omitempty"`
+
+ AdditionalFields map[string]interface{}
+}
+
+// NewAppMetaData is the constructor for AppMetaData.
+func NewAppMetaData(familyID, clientID, environment string) AppMetaData {
+ return AppMetaData{
+ FamilyID: familyID,
+ ClientID: clientID,
+ Environment: environment,
+ }
+}
+
+// Key outputs the key that can be used to uniquely look up this entry in a map.
+func (a AppMetaData) Key() string {
+ key := strings.Join(
+ []string{"AppMetaData", a.Environment, a.ClientID},
+ shared.CacheKeySeparator,
+ )
+ return strings.ToLower(key)
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/partitioned_storage.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/partitioned_storage.go
new file mode 100644
index 000000000..5e1cae0b8
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/partitioned_storage.go
@@ -0,0 +1,436 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package storage
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared"
+)
+
+// PartitionedManager is a partitioned in-memory cache of access tokens, accounts and meta data.
+type PartitionedManager struct {
+ contract *InMemoryContract
+ contractMu sync.RWMutex
+ requests aadInstanceDiscoveryer // *oauth.Token
+
+ aadCacheMu sync.RWMutex
+ aadCache map[string]authority.InstanceDiscoveryMetadata
+}
+
+// NewPartitionedManager is the constructor for PartitionedManager.
+func NewPartitionedManager(requests *oauth.Client) *PartitionedManager {
+ m := &PartitionedManager{requests: requests, aadCache: make(map[string]authority.InstanceDiscoveryMetadata)}
+ m.contract = NewInMemoryContract()
+ return m
+}
+
+// Read reads a storage token from the cache if it exists.
+func (m *PartitionedManager) Read(ctx context.Context, authParameters authority.AuthParams) (TokenResponse, error) {
+ tr := TokenResponse{}
+ realm := authParameters.AuthorityInfo.Tenant
+ clientID := authParameters.ClientID
+ scopes := authParameters.Scopes
+
+ // fetch metadata if instanceDiscovery is enabled
+ aliases := []string{authParameters.AuthorityInfo.Host}
+ if !authParameters.AuthorityInfo.InstanceDiscoveryDisabled {
+ metadata, err := m.getMetadataEntry(ctx, authParameters.AuthorityInfo)
+ if err != nil {
+ return TokenResponse{}, err
+ }
+ aliases = metadata.Aliases
+ }
+
+ userAssertionHash := authParameters.AssertionHash()
+ partitionKeyFromRequest := userAssertionHash
+
+ // errors returned by read* methods indicate a cache miss and are therefore non-fatal. We continue populating
+ // TokenResponse fields so that e.g. lack of an ID token doesn't prevent the caller from receiving a refresh token.
+ accessToken, err := m.readAccessToken(aliases, realm, clientID, userAssertionHash, scopes, partitionKeyFromRequest)
+ if err == nil {
+ tr.AccessToken = accessToken
+ }
+ idToken, err := m.readIDToken(aliases, realm, clientID, userAssertionHash, getPartitionKeyIDTokenRead(accessToken))
+ if err == nil {
+ tr.IDToken = idToken
+ }
+
+ if appMetadata, err := m.readAppMetaData(aliases, clientID); err == nil {
+ // we need the family ID to identify the correct refresh token, if any
+ familyID := appMetadata.FamilyID
+ refreshToken, err := m.readRefreshToken(aliases, familyID, clientID, userAssertionHash, partitionKeyFromRequest)
+ if err == nil {
+ tr.RefreshToken = refreshToken
+ }
+ }
+
+ account, err := m.readAccount(aliases, realm, userAssertionHash, idToken.HomeAccountID)
+ if err == nil {
+ tr.Account = account
+ }
+ return tr, nil
+}
+
+// Write writes a token response to the cache and returns the account information the token is stored with.
+func (m *PartitionedManager) Write(authParameters authority.AuthParams, tokenResponse accesstokens.TokenResponse) (shared.Account, error) {
+ authParameters.HomeAccountID = tokenResponse.HomeAccountID()
+ homeAccountID := authParameters.HomeAccountID
+ environment := authParameters.AuthorityInfo.Host
+ realm := authParameters.AuthorityInfo.Tenant
+ clientID := authParameters.ClientID
+ target := strings.Join(tokenResponse.GrantedScopes.Slice, scopeSeparator)
+ userAssertionHash := authParameters.AssertionHash()
+ cachedAt := time.Now()
+
+ var account shared.Account
+
+ if len(tokenResponse.RefreshToken) > 0 {
+ refreshToken := accesstokens.NewRefreshToken(homeAccountID, environment, clientID, tokenResponse.RefreshToken, tokenResponse.FamilyID)
+ if authParameters.AuthorizationType == authority.ATOnBehalfOf {
+ refreshToken.UserAssertionHash = userAssertionHash
+ }
+ if err := m.writeRefreshToken(refreshToken, getPartitionKeyRefreshToken(refreshToken)); err != nil {
+ return account, err
+ }
+ }
+
+ if len(tokenResponse.AccessToken) > 0 {
+ accessToken := NewAccessToken(
+ homeAccountID,
+ environment,
+ realm,
+ clientID,
+ cachedAt,
+ tokenResponse.ExpiresOn.T,
+ tokenResponse.ExtExpiresOn.T,
+ target,
+ tokenResponse.AccessToken,
+ )
+ if authParameters.AuthorizationType == authority.ATOnBehalfOf {
+ accessToken.UserAssertionHash = userAssertionHash // get Hash method on this
+ }
+
+ // Since we have a valid access token, cache it before moving on.
+ if err := accessToken.Validate(); err == nil {
+ if err := m.writeAccessToken(accessToken, getPartitionKeyAccessToken(accessToken)); err != nil {
+ return account, err
+ }
+ } else {
+ return shared.Account{}, err
+ }
+ }
+
+ idTokenJwt := tokenResponse.IDToken
+ if !idTokenJwt.IsZero() {
+ idToken := NewIDToken(homeAccountID, environment, realm, clientID, idTokenJwt.RawToken)
+ if authParameters.AuthorizationType == authority.ATOnBehalfOf {
+ idToken.UserAssertionHash = userAssertionHash
+ }
+ if err := m.writeIDToken(idToken, getPartitionKeyIDToken(idToken)); err != nil {
+ return shared.Account{}, err
+ }
+
+ localAccountID := idTokenJwt.LocalAccountID()
+ authorityType := authParameters.AuthorityInfo.AuthorityType
+
+ preferredUsername := idTokenJwt.UPN
+ if idTokenJwt.PreferredUsername != "" {
+ preferredUsername = idTokenJwt.PreferredUsername
+ }
+
+ account = shared.NewAccount(
+ homeAccountID,
+ environment,
+ realm,
+ localAccountID,
+ authorityType,
+ preferredUsername,
+ )
+ if authParameters.AuthorizationType == authority.ATOnBehalfOf {
+ account.UserAssertionHash = userAssertionHash
+ }
+ if err := m.writeAccount(account, getPartitionKeyAccount(account)); err != nil {
+ return shared.Account{}, err
+ }
+ }
+
+ AppMetaData := NewAppMetaData(tokenResponse.FamilyID, clientID, environment)
+
+ if err := m.writeAppMetaData(AppMetaData); err != nil {
+ return shared.Account{}, err
+ }
+ return account, nil
+}
+
+func (m *PartitionedManager) getMetadataEntry(ctx context.Context, authorityInfo authority.Info) (authority.InstanceDiscoveryMetadata, error) {
+ md, err := m.aadMetadataFromCache(ctx, authorityInfo)
+ if err != nil {
+ // not in the cache, retrieve it
+ md, err = m.aadMetadata(ctx, authorityInfo)
+ }
+ return md, err
+}
+
+func (m *PartitionedManager) aadMetadataFromCache(ctx context.Context, authorityInfo authority.Info) (authority.InstanceDiscoveryMetadata, error) {
+ m.aadCacheMu.RLock()
+ defer m.aadCacheMu.RUnlock()
+ metadata, ok := m.aadCache[authorityInfo.Host]
+ if ok {
+ return metadata, nil
+ }
+ return metadata, errors.New("not found")
+}
+
+func (m *PartitionedManager) aadMetadata(ctx context.Context, authorityInfo authority.Info) (authority.InstanceDiscoveryMetadata, error) {
+ discoveryResponse, err := m.requests.AADInstanceDiscovery(ctx, authorityInfo)
+ if err != nil {
+ return authority.InstanceDiscoveryMetadata{}, err
+ }
+
+ m.aadCacheMu.Lock()
+ defer m.aadCacheMu.Unlock()
+
+ for _, metadataEntry := range discoveryResponse.Metadata {
+ for _, aliasedAuthority := range metadataEntry.Aliases {
+ m.aadCache[aliasedAuthority] = metadataEntry
+ }
+ }
+ if _, ok := m.aadCache[authorityInfo.Host]; !ok {
+ m.aadCache[authorityInfo.Host] = authority.InstanceDiscoveryMetadata{
+ PreferredNetwork: authorityInfo.Host,
+ PreferredCache: authorityInfo.Host,
+ }
+ }
+ return m.aadCache[authorityInfo.Host], nil
+}
+
+func (m *PartitionedManager) readAccessToken(envAliases []string, realm, clientID, userAssertionHash string, scopes []string, partitionKey string) (AccessToken, error) {
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+ if accessTokens, ok := m.contract.AccessTokensPartition[partitionKey]; ok {
+ // TODO: linear search (over a map no less) is slow for a large number (thousands) of tokens.
+ // this shows up as the dominating node in a profile. for real-world scenarios this likely isn't
+ // an issue, however if it does become a problem then we know where to look.
+ for _, at := range accessTokens {
+ if at.Realm == realm && at.ClientID == clientID && at.UserAssertionHash == userAssertionHash {
+ if checkAlias(at.Environment, envAliases) {
+ if isMatchingScopes(scopes, at.Scopes) {
+ return at, nil
+ }
+ }
+ }
+ }
+ }
+ return AccessToken{}, fmt.Errorf("access token not found")
+}
+
+func (m *PartitionedManager) writeAccessToken(accessToken AccessToken, partitionKey string) error {
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ key := accessToken.Key()
+ if m.contract.AccessTokensPartition[partitionKey] == nil {
+ m.contract.AccessTokensPartition[partitionKey] = make(map[string]AccessToken)
+ }
+ m.contract.AccessTokensPartition[partitionKey][key] = accessToken
+ return nil
+}
+
+func matchFamilyRefreshTokenObo(rt accesstokens.RefreshToken, userAssertionHash string, envAliases []string) bool {
+ return rt.UserAssertionHash == userAssertionHash && checkAlias(rt.Environment, envAliases) && rt.FamilyID != ""
+}
+
+func matchClientIDRefreshTokenObo(rt accesstokens.RefreshToken, userAssertionHash string, envAliases []string, clientID string) bool {
+ return rt.UserAssertionHash == userAssertionHash && checkAlias(rt.Environment, envAliases) && rt.ClientID == clientID
+}
+
+func (m *PartitionedManager) readRefreshToken(envAliases []string, familyID, clientID, userAssertionHash, partitionKey string) (accesstokens.RefreshToken, error) {
+ byFamily := func(rt accesstokens.RefreshToken) bool {
+ return matchFamilyRefreshTokenObo(rt, userAssertionHash, envAliases)
+ }
+ byClient := func(rt accesstokens.RefreshToken) bool {
+ return matchClientIDRefreshTokenObo(rt, userAssertionHash, envAliases, clientID)
+ }
+
+ var matchers []func(rt accesstokens.RefreshToken) bool
+ if familyID == "" {
+ matchers = []func(rt accesstokens.RefreshToken) bool{
+ byClient, byFamily,
+ }
+ } else {
+ matchers = []func(rt accesstokens.RefreshToken) bool{
+ byFamily, byClient,
+ }
+ }
+
+ // TODO(keegan): All the tests here pass, but Bogdan says this is
+ // more complicated. I'm opening an issue for this to have him
+ // review the tests and suggest tests that would break this so
+ // we can re-write against good tests. His comments as follow:
+ // The algorithm is a bit more complex than this, I assume there are some tests covering everything. I would keep the order as is.
+ // The algorithm is:
+ // If application is NOT part of the family, search by client_ID
+ // If app is part of the family or if we DO NOT KNOW if it's part of the family, search by family ID, then by client_id (we will know if an app is part of the family after the first token response).
+ // https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/311fe8b16e7c293462806f397e189a6aa1159769/src/client/Microsoft.Identity.Client/Internal/Requests/Silent/CacheSilentStrategy.cs#L95
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+ for _, matcher := range matchers {
+ for _, rt := range m.contract.RefreshTokensPartition[partitionKey] {
+ if matcher(rt) {
+ return rt, nil
+ }
+ }
+ }
+
+ return accesstokens.RefreshToken{}, fmt.Errorf("refresh token not found")
+}
+
+func (m *PartitionedManager) writeRefreshToken(refreshToken accesstokens.RefreshToken, partitionKey string) error {
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ key := refreshToken.Key()
+ if m.contract.AccessTokensPartition[partitionKey] == nil {
+ m.contract.RefreshTokensPartition[partitionKey] = make(map[string]accesstokens.RefreshToken)
+ }
+ m.contract.RefreshTokensPartition[partitionKey][key] = refreshToken
+ return nil
+}
+
+func (m *PartitionedManager) readIDToken(envAliases []string, realm, clientID, userAssertionHash, partitionKey string) (IDToken, error) {
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+ for _, idt := range m.contract.IDTokensPartition[partitionKey] {
+ if idt.Realm == realm && idt.ClientID == clientID && idt.UserAssertionHash == userAssertionHash {
+ if checkAlias(idt.Environment, envAliases) {
+ return idt, nil
+ }
+ }
+ }
+ return IDToken{}, fmt.Errorf("token not found")
+}
+
+func (m *PartitionedManager) writeIDToken(idToken IDToken, partitionKey string) error {
+ key := idToken.Key()
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ if m.contract.IDTokensPartition[partitionKey] == nil {
+ m.contract.IDTokensPartition[partitionKey] = make(map[string]IDToken)
+ }
+ m.contract.IDTokensPartition[partitionKey][key] = idToken
+ return nil
+}
+
+func (m *PartitionedManager) readAccount(envAliases []string, realm, UserAssertionHash, partitionKey string) (shared.Account, error) {
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+
+ // You might ask why, if cache.Accounts is a map, we would loop through all of these instead of using a key.
+ // We only use a map because the storage contract shared between all language implementations says use a map.
+ // We can't change that. The other is because the keys are made using a specific "env", but here we are allowing
+ // a match in multiple envs (envAlias). That means we either need to hash each possible keyand do the lookup
+ // or just statically check. Since the design is to have a storage.Manager per user, the amount of keys stored
+ // is really low (say 2). Each hash is more expensive than the entire iteration.
+ for _, acc := range m.contract.AccountsPartition[partitionKey] {
+ if checkAlias(acc.Environment, envAliases) && acc.UserAssertionHash == UserAssertionHash && acc.Realm == realm {
+ return acc, nil
+ }
+ }
+ return shared.Account{}, fmt.Errorf("account not found")
+}
+
+func (m *PartitionedManager) writeAccount(account shared.Account, partitionKey string) error {
+ key := account.Key()
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ if m.contract.AccountsPartition[partitionKey] == nil {
+ m.contract.AccountsPartition[partitionKey] = make(map[string]shared.Account)
+ }
+ m.contract.AccountsPartition[partitionKey][key] = account
+ return nil
+}
+
+func (m *PartitionedManager) readAppMetaData(envAliases []string, clientID string) (AppMetaData, error) {
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+
+ for _, app := range m.contract.AppMetaData {
+ if checkAlias(app.Environment, envAliases) && app.ClientID == clientID {
+ return app, nil
+ }
+ }
+ return AppMetaData{}, fmt.Errorf("not found")
+}
+
+func (m *PartitionedManager) writeAppMetaData(AppMetaData AppMetaData) error {
+ key := AppMetaData.Key()
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ m.contract.AppMetaData[key] = AppMetaData
+ return nil
+}
+
+// update updates the internal cache object. This is for use in tests, other uses are not
+// supported.
+func (m *PartitionedManager) update(cache *InMemoryContract) {
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ m.contract = cache
+}
+
+// Marshal implements cache.Marshaler.
+func (m *PartitionedManager) Marshal() ([]byte, error) {
+ return json.Marshal(m.contract)
+}
+
+// Unmarshal implements cache.Unmarshaler.
+func (m *PartitionedManager) Unmarshal(b []byte) error {
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+
+ contract := NewInMemoryContract()
+
+ err := json.Unmarshal(b, contract)
+ if err != nil {
+ return err
+ }
+
+ m.contract = contract
+
+ return nil
+}
+
+func getPartitionKeyAccessToken(item AccessToken) string {
+ if item.UserAssertionHash != "" {
+ return item.UserAssertionHash
+ }
+ return item.HomeAccountID
+}
+
+func getPartitionKeyRefreshToken(item accesstokens.RefreshToken) string {
+ if item.UserAssertionHash != "" {
+ return item.UserAssertionHash
+ }
+ return item.HomeAccountID
+}
+
+func getPartitionKeyIDToken(item IDToken) string {
+ return item.HomeAccountID
+}
+
+func getPartitionKeyAccount(item shared.Account) string {
+ return item.HomeAccountID
+}
+
+func getPartitionKeyIDTokenRead(item AccessToken) string {
+ return item.HomeAccountID
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/storage.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/storage.go
new file mode 100644
index 000000000..d3a39e005
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/storage.go
@@ -0,0 +1,516 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+// Package storage holds all cached token information for MSAL. This storage can be
+// augmented with third-party extensions to provide persistent storage. In that case,
+// reads and writes in upper packages will call Marshal() to take the entire in-memory
+// representation and write it to storage and Unmarshal() to update the entire in-memory
+// storage with what was in the persistent storage. The persistent storage can only be
+// accessed in this way because multiple MSAL clients written in multiple languages can
+// access the same storage and must adhere to the same method that was defined
+// previously.
+package storage
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared"
+)
+
+// aadInstanceDiscoveryer allows faking in tests.
+// It is implemented in production by ops/authority.Client
+type aadInstanceDiscoveryer interface {
+ AADInstanceDiscovery(ctx context.Context, authorityInfo authority.Info) (authority.InstanceDiscoveryResponse, error)
+}
+
+// TokenResponse mimics a token response that was pulled from the cache.
+type TokenResponse struct {
+ RefreshToken accesstokens.RefreshToken
+ IDToken IDToken // *Credential
+ AccessToken AccessToken
+ Account shared.Account
+}
+
+// Manager is an in-memory cache of access tokens, accounts and meta data. This data is
+// updated on read/write calls. Unmarshal() replaces all data stored here with whatever
+// was given to it on each call.
+type Manager struct {
+ contract *Contract
+ contractMu sync.RWMutex
+ requests aadInstanceDiscoveryer // *oauth.Token
+
+ aadCacheMu sync.RWMutex
+ aadCache map[string]authority.InstanceDiscoveryMetadata
+}
+
+// New is the constructor for Manager.
+func New(requests *oauth.Client) *Manager {
+ m := &Manager{requests: requests, aadCache: make(map[string]authority.InstanceDiscoveryMetadata)}
+ m.contract = NewContract()
+ return m
+}
+
+func checkAlias(alias string, aliases []string) bool {
+ for _, v := range aliases {
+ if alias == v {
+ return true
+ }
+ }
+ return false
+}
+
+func isMatchingScopes(scopesOne []string, scopesTwo string) bool {
+ newScopesTwo := strings.Split(scopesTwo, scopeSeparator)
+ scopeCounter := 0
+ for _, scope := range scopesOne {
+ for _, otherScope := range newScopesTwo {
+ if strings.EqualFold(scope, otherScope) {
+ scopeCounter++
+ continue
+ }
+ }
+ }
+ return scopeCounter == len(scopesOne)
+}
+
+// Read reads a storage token from the cache if it exists.
+func (m *Manager) Read(ctx context.Context, authParameters authority.AuthParams) (TokenResponse, error) {
+ tr := TokenResponse{}
+ homeAccountID := authParameters.HomeAccountID
+ realm := authParameters.AuthorityInfo.Tenant
+ clientID := authParameters.ClientID
+ scopes := authParameters.Scopes
+
+ // fetch metadata if instanceDiscovery is enabled
+ aliases := []string{authParameters.AuthorityInfo.Host}
+ if !authParameters.AuthorityInfo.InstanceDiscoveryDisabled {
+ metadata, err := m.getMetadataEntry(ctx, authParameters.AuthorityInfo)
+ if err != nil {
+ return TokenResponse{}, err
+ }
+ aliases = metadata.Aliases
+ }
+
+ accessToken := m.readAccessToken(homeAccountID, aliases, realm, clientID, scopes)
+ tr.AccessToken = accessToken
+
+ if homeAccountID == "" {
+ // caller didn't specify a user, so there's no reason to search for an ID or refresh token
+ return tr, nil
+ }
+ // errors returned by read* methods indicate a cache miss and are therefore non-fatal. We continue populating
+ // TokenResponse fields so that e.g. lack of an ID token doesn't prevent the caller from receiving a refresh token.
+ idToken, err := m.readIDToken(homeAccountID, aliases, realm, clientID)
+ if err == nil {
+ tr.IDToken = idToken
+ }
+
+ if appMetadata, err := m.readAppMetaData(aliases, clientID); err == nil {
+ // we need the family ID to identify the correct refresh token, if any
+ familyID := appMetadata.FamilyID
+ refreshToken, err := m.readRefreshToken(homeAccountID, aliases, familyID, clientID)
+ if err == nil {
+ tr.RefreshToken = refreshToken
+ }
+ }
+
+ account, err := m.readAccount(homeAccountID, aliases, realm)
+ if err == nil {
+ tr.Account = account
+ }
+ return tr, nil
+}
+
+const scopeSeparator = " "
+
+// Write writes a token response to the cache and returns the account information the token is stored with.
+func (m *Manager) Write(authParameters authority.AuthParams, tokenResponse accesstokens.TokenResponse) (shared.Account, error) {
+ homeAccountID := tokenResponse.HomeAccountID()
+ environment := authParameters.AuthorityInfo.Host
+ realm := authParameters.AuthorityInfo.Tenant
+ clientID := authParameters.ClientID
+ target := strings.Join(tokenResponse.GrantedScopes.Slice, scopeSeparator)
+ cachedAt := time.Now()
+
+ var account shared.Account
+
+ if len(tokenResponse.RefreshToken) > 0 {
+ refreshToken := accesstokens.NewRefreshToken(homeAccountID, environment, clientID, tokenResponse.RefreshToken, tokenResponse.FamilyID)
+ if err := m.writeRefreshToken(refreshToken); err != nil {
+ return account, err
+ }
+ }
+
+ if len(tokenResponse.AccessToken) > 0 {
+ accessToken := NewAccessToken(
+ homeAccountID,
+ environment,
+ realm,
+ clientID,
+ cachedAt,
+ tokenResponse.ExpiresOn.T,
+ tokenResponse.ExtExpiresOn.T,
+ target,
+ tokenResponse.AccessToken,
+ )
+
+ // Since we have a valid access token, cache it before moving on.
+ if err := accessToken.Validate(); err == nil {
+ if err := m.writeAccessToken(accessToken); err != nil {
+ return account, err
+ }
+ }
+ }
+
+ idTokenJwt := tokenResponse.IDToken
+ if !idTokenJwt.IsZero() {
+ idToken := NewIDToken(homeAccountID, environment, realm, clientID, idTokenJwt.RawToken)
+ if err := m.writeIDToken(idToken); err != nil {
+ return shared.Account{}, err
+ }
+
+ localAccountID := idTokenJwt.LocalAccountID()
+ authorityType := authParameters.AuthorityInfo.AuthorityType
+
+ preferredUsername := idTokenJwt.UPN
+ if idTokenJwt.PreferredUsername != "" {
+ preferredUsername = idTokenJwt.PreferredUsername
+ }
+
+ account = shared.NewAccount(
+ homeAccountID,
+ environment,
+ realm,
+ localAccountID,
+ authorityType,
+ preferredUsername,
+ )
+ if err := m.writeAccount(account); err != nil {
+ return shared.Account{}, err
+ }
+ }
+
+ AppMetaData := NewAppMetaData(tokenResponse.FamilyID, clientID, environment)
+
+ if err := m.writeAppMetaData(AppMetaData); err != nil {
+ return shared.Account{}, err
+ }
+ return account, nil
+}
+
+func (m *Manager) getMetadataEntry(ctx context.Context, authorityInfo authority.Info) (authority.InstanceDiscoveryMetadata, error) {
+ md, err := m.aadMetadataFromCache(ctx, authorityInfo)
+ if err != nil {
+ // not in the cache, retrieve it
+ md, err = m.aadMetadata(ctx, authorityInfo)
+ }
+ return md, err
+}
+
+func (m *Manager) aadMetadataFromCache(ctx context.Context, authorityInfo authority.Info) (authority.InstanceDiscoveryMetadata, error) {
+ m.aadCacheMu.RLock()
+ defer m.aadCacheMu.RUnlock()
+ metadata, ok := m.aadCache[authorityInfo.Host]
+ if ok {
+ return metadata, nil
+ }
+ return metadata, errors.New("not found")
+}
+
+func (m *Manager) aadMetadata(ctx context.Context, authorityInfo authority.Info) (authority.InstanceDiscoveryMetadata, error) {
+ m.aadCacheMu.Lock()
+ defer m.aadCacheMu.Unlock()
+ discoveryResponse, err := m.requests.AADInstanceDiscovery(ctx, authorityInfo)
+ if err != nil {
+ return authority.InstanceDiscoveryMetadata{}, err
+ }
+
+ for _, metadataEntry := range discoveryResponse.Metadata {
+ for _, aliasedAuthority := range metadataEntry.Aliases {
+ m.aadCache[aliasedAuthority] = metadataEntry
+ }
+ }
+ if _, ok := m.aadCache[authorityInfo.Host]; !ok {
+ m.aadCache[authorityInfo.Host] = authority.InstanceDiscoveryMetadata{
+ PreferredNetwork: authorityInfo.Host,
+ PreferredCache: authorityInfo.Host,
+ }
+ }
+ return m.aadCache[authorityInfo.Host], nil
+}
+
+func (m *Manager) readAccessToken(homeID string, envAliases []string, realm, clientID string, scopes []string) AccessToken {
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+ // TODO: linear search (over a map no less) is slow for a large number (thousands) of tokens.
+ // this shows up as the dominating node in a profile. for real-world scenarios this likely isn't
+ // an issue, however if it does become a problem then we know where to look.
+ for _, at := range m.contract.AccessTokens {
+ if at.HomeAccountID == homeID && at.Realm == realm && at.ClientID == clientID {
+ if checkAlias(at.Environment, envAliases) {
+ if isMatchingScopes(scopes, at.Scopes) {
+ return at
+ }
+ }
+ }
+ }
+ return AccessToken{}
+}
+
+func (m *Manager) writeAccessToken(accessToken AccessToken) error {
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ key := accessToken.Key()
+ m.contract.AccessTokens[key] = accessToken
+ return nil
+}
+
+func (m *Manager) readRefreshToken(homeID string, envAliases []string, familyID, clientID string) (accesstokens.RefreshToken, error) {
+ byFamily := func(rt accesstokens.RefreshToken) bool {
+ return matchFamilyRefreshToken(rt, homeID, envAliases)
+ }
+ byClient := func(rt accesstokens.RefreshToken) bool {
+ return matchClientIDRefreshToken(rt, homeID, envAliases, clientID)
+ }
+
+ var matchers []func(rt accesstokens.RefreshToken) bool
+ if familyID == "" {
+ matchers = []func(rt accesstokens.RefreshToken) bool{
+ byClient, byFamily,
+ }
+ } else {
+ matchers = []func(rt accesstokens.RefreshToken) bool{
+ byFamily, byClient,
+ }
+ }
+
+ // TODO(keegan): All the tests here pass, but Bogdan says this is
+ // more complicated. I'm opening an issue for this to have him
+ // review the tests and suggest tests that would break this so
+ // we can re-write against good tests. His comments as follow:
+ // The algorithm is a bit more complex than this, I assume there are some tests covering everything. I would keep the order as is.
+ // The algorithm is:
+ // If application is NOT part of the family, search by client_ID
+ // If app is part of the family or if we DO NOT KNOW if it's part of the family, search by family ID, then by client_id (we will know if an app is part of the family after the first token response).
+ // https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/311fe8b16e7c293462806f397e189a6aa1159769/src/client/Microsoft.Identity.Client/Internal/Requests/Silent/CacheSilentStrategy.cs#L95
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+ for _, matcher := range matchers {
+ for _, rt := range m.contract.RefreshTokens {
+ if matcher(rt) {
+ return rt, nil
+ }
+ }
+ }
+
+ return accesstokens.RefreshToken{}, fmt.Errorf("refresh token not found")
+}
+
+func matchFamilyRefreshToken(rt accesstokens.RefreshToken, homeID string, envAliases []string) bool {
+ return rt.HomeAccountID == homeID && checkAlias(rt.Environment, envAliases) && rt.FamilyID != ""
+}
+
+func matchClientIDRefreshToken(rt accesstokens.RefreshToken, homeID string, envAliases []string, clientID string) bool {
+ return rt.HomeAccountID == homeID && checkAlias(rt.Environment, envAliases) && rt.ClientID == clientID
+}
+
+func (m *Manager) writeRefreshToken(refreshToken accesstokens.RefreshToken) error {
+ key := refreshToken.Key()
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ m.contract.RefreshTokens[key] = refreshToken
+ return nil
+}
+
+func (m *Manager) readIDToken(homeID string, envAliases []string, realm, clientID string) (IDToken, error) {
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+ for _, idt := range m.contract.IDTokens {
+ if idt.HomeAccountID == homeID && idt.Realm == realm && idt.ClientID == clientID {
+ if checkAlias(idt.Environment, envAliases) {
+ return idt, nil
+ }
+ }
+ }
+ return IDToken{}, fmt.Errorf("token not found")
+}
+
+func (m *Manager) writeIDToken(idToken IDToken) error {
+ key := idToken.Key()
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ m.contract.IDTokens[key] = idToken
+ return nil
+}
+
+func (m *Manager) AllAccounts() []shared.Account {
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+
+ var accounts []shared.Account
+ for _, v := range m.contract.Accounts {
+ accounts = append(accounts, v)
+ }
+
+ return accounts
+}
+
+func (m *Manager) Account(homeAccountID string) shared.Account {
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+
+ for _, v := range m.contract.Accounts {
+ if v.HomeAccountID == homeAccountID {
+ return v
+ }
+ }
+
+ return shared.Account{}
+}
+
+func (m *Manager) readAccount(homeAccountID string, envAliases []string, realm string) (shared.Account, error) {
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+
+ // You might ask why, if cache.Accounts is a map, we would loop through all of these instead of using a key.
+ // We only use a map because the storage contract shared between all language implementations says use a map.
+ // We can't change that. The other is because the keys are made using a specific "env", but here we are allowing
+ // a match in multiple envs (envAlias). That means we either need to hash each possible keyand do the lookup
+ // or just statically check. Since the design is to have a storage.Manager per user, the amount of keys stored
+ // is really low (say 2). Each hash is more expensive than the entire iteration.
+ for _, acc := range m.contract.Accounts {
+ if acc.HomeAccountID == homeAccountID && checkAlias(acc.Environment, envAliases) && acc.Realm == realm {
+ return acc, nil
+ }
+ }
+ return shared.Account{}, fmt.Errorf("account not found")
+}
+
+func (m *Manager) writeAccount(account shared.Account) error {
+ key := account.Key()
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ m.contract.Accounts[key] = account
+ return nil
+}
+
+func (m *Manager) readAppMetaData(envAliases []string, clientID string) (AppMetaData, error) {
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+
+ for _, app := range m.contract.AppMetaData {
+ if checkAlias(app.Environment, envAliases) && app.ClientID == clientID {
+ return app, nil
+ }
+ }
+ return AppMetaData{}, fmt.Errorf("not found")
+}
+
+func (m *Manager) writeAppMetaData(AppMetaData AppMetaData) error {
+ key := AppMetaData.Key()
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ m.contract.AppMetaData[key] = AppMetaData
+ return nil
+}
+
+// RemoveAccount removes all the associated ATs, RTs and IDTs from the cache associated with this account.
+func (m *Manager) RemoveAccount(account shared.Account, clientID string) {
+ m.removeRefreshTokens(account.HomeAccountID, account.Environment, clientID)
+ m.removeAccessTokens(account.HomeAccountID, account.Environment)
+ m.removeIDTokens(account.HomeAccountID, account.Environment)
+ m.removeAccounts(account.HomeAccountID, account.Environment)
+}
+
+func (m *Manager) removeRefreshTokens(homeID string, env string, clientID string) {
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ for key, rt := range m.contract.RefreshTokens {
+ // Check for RTs associated with the account.
+ if rt.HomeAccountID == homeID && rt.Environment == env {
+ // Do RT's app ownership check as a precaution, in case family apps
+ // and 3rd-party apps share same token cache, although they should not.
+ if rt.ClientID == clientID || rt.FamilyID != "" {
+ delete(m.contract.RefreshTokens, key)
+ }
+ }
+ }
+}
+
+func (m *Manager) removeAccessTokens(homeID string, env string) {
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ for key, at := range m.contract.AccessTokens {
+ // Remove AT's associated with the account
+ if at.HomeAccountID == homeID && at.Environment == env {
+ // # To avoid the complexity of locating sibling family app's AT, we skip AT's app ownership check.
+ // It means ATs for other apps will also be removed, it is OK because:
+ // non-family apps are not supposed to share token cache to begin with;
+ // Even if it happens, we keep other app's RT already, so SSO still works.
+ delete(m.contract.AccessTokens, key)
+ }
+ }
+}
+
+func (m *Manager) removeIDTokens(homeID string, env string) {
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ for key, idt := range m.contract.IDTokens {
+ // Remove ID tokens associated with the account.
+ if idt.HomeAccountID == homeID && idt.Environment == env {
+ delete(m.contract.IDTokens, key)
+ }
+ }
+}
+
+func (m *Manager) removeAccounts(homeID string, env string) {
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ for key, acc := range m.contract.Accounts {
+ // Remove the specified account.
+ if acc.HomeAccountID == homeID && acc.Environment == env {
+ delete(m.contract.Accounts, key)
+ }
+ }
+}
+
+// update updates the internal cache object. This is for use in tests, other uses are not
+// supported.
+func (m *Manager) update(cache *Contract) {
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+ m.contract = cache
+}
+
+// Marshal implements cache.Marshaler.
+func (m *Manager) Marshal() ([]byte, error) {
+ m.contractMu.RLock()
+ defer m.contractMu.RUnlock()
+ return json.Marshal(m.contract)
+}
+
+// Unmarshal implements cache.Unmarshaler.
+func (m *Manager) Unmarshal(b []byte) error {
+ m.contractMu.Lock()
+ defer m.contractMu.Unlock()
+
+ contract := NewContract()
+
+ err := json.Unmarshal(b, contract)
+ if err != nil {
+ return err
+ }
+
+ m.contract = contract
+
+ return nil
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported/exported.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported/exported.go
new file mode 100644
index 000000000..7b673e3fe
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported/exported.go
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+// package exported contains internal types that are re-exported from a public package
+package exported
+
+// AssertionRequestOptions has information required to generate a client assertion
+type AssertionRequestOptions struct {
+ // ClientID identifies the application for which an assertion is requested. Used as the assertion's "iss" and "sub" claims.
+ ClientID string
+
+ // TokenEndpoint is the intended token endpoint. Used as the assertion's "aud" claim.
+ TokenEndpoint string
+}
+
+// TokenProviderParameters is the authentication parameters passed to token providers
+type TokenProviderParameters struct {
+ // Claims contains any additional claims requested for the token
+ Claims string
+ // CorrelationID of the authentication request
+ CorrelationID string
+ // Scopes requested for the token
+ Scopes []string
+ // TenantID identifies the tenant in which to authenticate
+ TenantID string
+}
+
+// TokenProviderResult is the authentication result returned by custom token providers
+type TokenProviderResult struct {
+ // AccessToken is the requested token
+ AccessToken string
+ // ExpiresInSeconds is the lifetime of the token in seconds
+ ExpiresInSeconds int
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/design.md b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/design.md
new file mode 100644
index 000000000..09edb01b7
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/design.md
@@ -0,0 +1,140 @@
+# JSON Package Design
+Author: John Doak(jdoak@microsoft.com)
+
+## Why?
+
+This project needs a special type of marshal/unmarshal not directly supported
+by the encoding/json package.
+
+The need revolves around a few key wants/needs:
+- unmarshal and marshal structs representing JSON messages
+- fields in the messgage not in the struct must be maintained when unmarshalled
+- those same fields must be marshalled back when encoded again
+
+The initial version used map[string]interface{} to put in the keys that
+were known and then any other keys were put into a field called AdditionalFields.
+
+This has a few negatives:
+- Dual marshaling/unmarshalling is required
+- Adding a struct field requires manually adding a key by name to be encoded/decoded from the map (which is a loosely coupled construct), which can lead to bugs that aren't detected or have bad side effects
+- Tests can become quickly disconnected if those keys aren't put
+in tests as well. So you think you have support working, but you
+don't. Existing tests were found that didn't test the marshalling output.
+- There is no enforcement that if AdditionalFields is required on one struct, it should be on all containers
+that don't have custom marshal/unmarshal.
+
+This package aims to support our needs by providing custom Marshal()/Unmarshal() functions.
+
+This prevents all the negatives in the initial solution listed above. However, it does add its own negative:
+- Custom encoding/decoding via reflection is messy (as can be seen in encoding/json itself)
+
+Go proverb: Reflection is never clear
+Suggested reading: https://blog.golang.org/laws-of-reflection
+
+## Important design decisions
+
+- We don't want to understand all JSON decoding rules
+- We don't want to deal with all the quoting, commas, etc on decode
+- Need support for json.Marshaler/Unmarshaler, so we can support types like time.Time
+- If struct does not implement json.Unmarshaler, it must have AdditionalFields defined
+- We only support root level objects that are \*struct or struct
+
+To faciliate these goals, we will utilize the json.Encoder and json.Decoder.
+They provide streaming processing (efficient) and return errors on bad JSON.
+
+Support for json.Marshaler/Unmarshaler allows for us to use non-basic types
+that must be specially encoded/decoded (like time.Time objects).
+
+We don't support types that can't customer unmarshal or have AdditionalFields
+in order to prevent future devs from forgetting that important field and
+generating bad return values.
+
+Support for root level objects of \*struct or struct simply acknowledges the
+fact that this is designed only for the purposes listed in the Introduction.
+Outside that (like encoding a lone number) should be done with the
+regular json package (as it will not have additional fields).
+
+We don't support a few things on json supported reference types and structs:
+- \*map: no need for pointers to maps
+- \*slice: no need for pointers to slices
+- any further pointers on struct after \*struct
+
+There should never be a need for this in Go.
+
+## Design
+
+## State Machines
+
+This uses state machine designs that based upon the Rob Pike talk on
+lexers and parsers: https://www.youtube.com/watch?v=HxaD_trXwRE
+
+This is the most common pattern for state machines in Go and
+the model to follow closesly when dealing with streaming
+processing of textual data.
+
+Our state machines are based on the type:
+```go
+type stateFn func() (stateFn, error)
+```
+
+The state machine itself is simply a struct that has methods that
+satisfy stateFn.
+
+Our state machines have a few standard calls
+- run(): runs the state machine
+- start(): always the first stateFn to be called
+
+All state machines have the following logic:
+* run() is called
+* start() is called and returns the next stateFn or error
+* stateFn is called
+ - If returned stateFn(next state) is non-nil, call it
+ - If error is non-nil, run() returns the error
+ - If stateFn == nil and err == nil, run() return err == nil
+
+## Supporting types
+
+Marshalling/Unmarshalling must support(within top level struct):
+- struct
+- \*struct
+- []struct
+- []\*struct
+- []map[string]structContainer
+- [][]structContainer
+
+**Term note:** structContainer == type that has a struct or \*struct inside it
+
+We specifically do not support []interface or map[string]interface
+where the interface value would hold some value with a struct in it.
+
+Those will still marshal/unmarshal, but without support for
+AdditionalFields.
+
+## Marshalling
+
+The marshalling design will be based around a statemachine design.
+
+The basic logic is as follows:
+
+* If struct has custom marshaller, call it and return
+* If struct has field "AdditionalFields", it must be a map[string]interface{}
+* If struct does not have "AdditionalFields", give an error
+* Get struct tag detailing json names to go names, create mapping
+* For each public field name
+ - Write field name out
+ - If field value is a struct, recursively call our state machine
+ - Otherwise, use the json.Encoder to write out the value
+
+## Unmarshalling
+
+The unmarshalling desin is also based around a statemachine design. The
+basic logic is as follows:
+
+* If struct has custom marhaller, call it
+* If struct has field "AdditionalFields", it must be a map[string]interface{}
+* Get struct tag detailing json names to go names, create mapping
+* For each key found
+ - If key exists,
+ - If value is basic type, extract value into struct field using Decoder
+ - If value is struct type, recursively call statemachine
+ - If key doesn't exist, add it to AdditionalFields if it exists using Decoder
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/json.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/json.go
new file mode 100644
index 000000000..2238521f5
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/json.go
@@ -0,0 +1,184 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+// Package json provide functions for marshalling an unmarshalling types to JSON. These functions are meant to
+// be utilized inside of structs that implement json.Unmarshaler and json.Marshaler interfaces.
+// This package provides the additional functionality of writing fields that are not in the struct when marshalling
+// to a field called AdditionalFields if that field exists and is a map[string]interface{}.
+// When marshalling, if the struct has all the same prerequisites, it will uses the keys in AdditionalFields as
+// extra fields. This package uses encoding/json underneath.
+package json
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "reflect"
+ "strings"
+)
+
+const addField = "AdditionalFields"
+const (
+ marshalJSON = "MarshalJSON"
+ unmarshalJSON = "UnmarshalJSON"
+)
+
+var (
+ leftBrace = []byte("{")[0]
+ rightBrace = []byte("}")[0]
+ comma = []byte(",")[0]
+ leftParen = []byte("[")[0]
+ rightParen = []byte("]")[0]
+)
+
+var mapStrInterType = reflect.TypeOf(map[string]interface{}{})
+
+// stateFn defines a state machine function. This will be used in all state
+// machines in this package.
+type stateFn func() (stateFn, error)
+
+// Marshal is used to marshal a type into its JSON representation. It
+// wraps the stdlib calls in order to marshal a struct or *struct so
+// that a field called "AdditionalFields" of type map[string]interface{}
+// with "-" used inside struct tag `json:"-"` can be marshalled as if
+// they were fields within the struct.
+func Marshal(i interface{}) ([]byte, error) {
+ buff := bytes.Buffer{}
+ enc := json.NewEncoder(&buff)
+ enc.SetEscapeHTML(false)
+ enc.SetIndent("", "")
+
+ v := reflect.ValueOf(i)
+ if v.Kind() != reflect.Ptr && v.CanAddr() {
+ v = v.Addr()
+ }
+ err := marshalStruct(v, &buff, enc)
+ if err != nil {
+ return nil, err
+ }
+ return buff.Bytes(), nil
+}
+
+// Unmarshal unmarshals a []byte representing JSON into i, which must be a *struct. In addition, if the struct has
+// a field called AdditionalFields of type map[string]interface{}, JSON data representing fields not in the struct
+// will be written as key/value pairs to AdditionalFields.
+func Unmarshal(b []byte, i interface{}) error {
+ if len(b) == 0 {
+ return nil
+ }
+
+ jdec := json.NewDecoder(bytes.NewBuffer(b))
+ jdec.UseNumber()
+ return unmarshalStruct(jdec, i)
+}
+
+// MarshalRaw marshals i into a json.RawMessage. If I cannot be marshalled,
+// this will panic. This is exposed to help test AdditionalField values
+// which are stored as json.RawMessage.
+func MarshalRaw(i interface{}) json.RawMessage {
+ b, err := json.Marshal(i)
+ if err != nil {
+ panic(err)
+ }
+ return json.RawMessage(b)
+}
+
+// isDelim simply tests to see if a json.Token is a delimeter.
+func isDelim(got json.Token) bool {
+ switch got.(type) {
+ case json.Delim:
+ return true
+ }
+ return false
+}
+
+// delimIs tests got to see if it is want.
+func delimIs(got json.Token, want rune) bool {
+ switch v := got.(type) {
+ case json.Delim:
+ if v == json.Delim(want) {
+ return true
+ }
+ }
+ return false
+}
+
+// hasMarshalJSON will determine if the value or a pointer to this value has
+// the MarshalJSON method.
+func hasMarshalJSON(v reflect.Value) bool {
+ if method := v.MethodByName(marshalJSON); method.Kind() != reflect.Invalid {
+ _, ok := v.Interface().(json.Marshaler)
+ return ok
+ }
+
+ if v.Kind() == reflect.Ptr {
+ v = v.Elem()
+ } else {
+ if !v.CanAddr() {
+ return false
+ }
+ v = v.Addr()
+ }
+
+ if method := v.MethodByName(marshalJSON); method.Kind() != reflect.Invalid {
+ _, ok := v.Interface().(json.Marshaler)
+ return ok
+ }
+ return false
+}
+
+// callMarshalJSON will call MarshalJSON() method on the value or a pointer to this value.
+// This will panic if the method is not defined.
+func callMarshalJSON(v reflect.Value) ([]byte, error) {
+ if method := v.MethodByName(marshalJSON); method.Kind() != reflect.Invalid {
+ marsh := v.Interface().(json.Marshaler)
+ return marsh.MarshalJSON()
+ }
+
+ if v.Kind() == reflect.Ptr {
+ v = v.Elem()
+ } else {
+ if v.CanAddr() {
+ v = v.Addr()
+ }
+ }
+
+ if method := v.MethodByName(unmarshalJSON); method.Kind() != reflect.Invalid {
+ marsh := v.Interface().(json.Marshaler)
+ return marsh.MarshalJSON()
+ }
+
+ panic(fmt.Sprintf("callMarshalJSON called on type %T that does not have MarshalJSON defined", v.Interface()))
+}
+
+// hasUnmarshalJSON will determine if the value or a pointer to this value has
+// the UnmarshalJSON method.
+func hasUnmarshalJSON(v reflect.Value) bool {
+ // You can't unmarshal on a non-pointer type.
+ if v.Kind() != reflect.Ptr {
+ if !v.CanAddr() {
+ return false
+ }
+ v = v.Addr()
+ }
+
+ if method := v.MethodByName(unmarshalJSON); method.Kind() != reflect.Invalid {
+ _, ok := v.Interface().(json.Unmarshaler)
+ return ok
+ }
+
+ return false
+}
+
+// hasOmitEmpty indicates if the field has instructed us to not output
+// the field if omitempty is set on the tag. tag is the string
+// returned by reflect.StructField.Tag().Get().
+func hasOmitEmpty(tag string) bool {
+ sl := strings.Split(tag, ",")
+ for _, str := range sl {
+ if str == "omitempty" {
+ return true
+ }
+ }
+ return false
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/mapslice.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/mapslice.go
new file mode 100644
index 000000000..cef442f25
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/mapslice.go
@@ -0,0 +1,333 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package json
+
+import (
+ "encoding/json"
+ "fmt"
+ "reflect"
+)
+
+// unmarshalMap unmarshal's a map.
+func unmarshalMap(dec *json.Decoder, m reflect.Value) error {
+ if m.Kind() != reflect.Ptr || m.Elem().Kind() != reflect.Map {
+ panic("unmarshalMap called on non-*map value")
+ }
+ mapValueType := m.Elem().Type().Elem()
+ walk := mapWalk{dec: dec, m: m, valueType: mapValueType}
+ if err := walk.run(); err != nil {
+ return err
+ }
+ return nil
+}
+
+type mapWalk struct {
+ dec *json.Decoder
+ key string
+ m reflect.Value
+ valueType reflect.Type
+}
+
+// run runs our decoder state machine.
+func (m *mapWalk) run() error {
+ var state = m.start
+ var err error
+ for {
+ state, err = state()
+ if err != nil {
+ return err
+ }
+ if state == nil {
+ return nil
+ }
+ }
+}
+
+func (m *mapWalk) start() (stateFn, error) {
+ // maps can have custom unmarshaler's.
+ if hasUnmarshalJSON(m.m) {
+ err := m.dec.Decode(m.m.Interface())
+ if err != nil {
+ return nil, err
+ }
+ return nil, nil
+ }
+
+ // We only want to use this if the map value is:
+ // *struct/struct/map/slice
+ // otherwise use standard decode
+ t, _ := m.valueBaseType()
+ switch t.Kind() {
+ case reflect.Struct, reflect.Map, reflect.Slice:
+ delim, err := m.dec.Token()
+ if err != nil {
+ return nil, err
+ }
+ // This indicates the value was set to JSON null.
+ if delim == nil {
+ return nil, nil
+ }
+ if !delimIs(delim, '{') {
+ return nil, fmt.Errorf("Unmarshal expected opening {, received %v", delim)
+ }
+ return m.next, nil
+ case reflect.Ptr:
+ return nil, fmt.Errorf("do not support maps with values of '**type' or '*reference")
+ }
+
+ // This is a basic map type, so just use Decode().
+ if err := m.dec.Decode(m.m.Interface()); err != nil {
+ return nil, err
+ }
+
+ return nil, nil
+}
+
+func (m *mapWalk) next() (stateFn, error) {
+ if m.dec.More() {
+ key, err := m.dec.Token()
+ if err != nil {
+ return nil, err
+ }
+ m.key = key.(string)
+ return m.storeValue, nil
+ }
+ // No more entries, so remove final }.
+ _, err := m.dec.Token()
+ if err != nil {
+ return nil, err
+ }
+ return nil, nil
+}
+
+func (m *mapWalk) storeValue() (stateFn, error) {
+ v := m.valueType
+ for {
+ switch v.Kind() {
+ case reflect.Ptr:
+ v = v.Elem()
+ continue
+ case reflect.Struct:
+ return m.storeStruct, nil
+ case reflect.Map:
+ return m.storeMap, nil
+ case reflect.Slice:
+ return m.storeSlice, nil
+ }
+ return nil, fmt.Errorf("bug: mapWalk.storeValue() called on unsupported type: %v", v.Kind())
+ }
+}
+
+func (m *mapWalk) storeStruct() (stateFn, error) {
+ v := newValue(m.valueType)
+ if err := unmarshalStruct(m.dec, v.Interface()); err != nil {
+ return nil, err
+ }
+
+ if m.valueType.Kind() == reflect.Ptr {
+ m.m.Elem().SetMapIndex(reflect.ValueOf(m.key), v)
+ return m.next, nil
+ }
+ m.m.Elem().SetMapIndex(reflect.ValueOf(m.key), v.Elem())
+
+ return m.next, nil
+}
+
+func (m *mapWalk) storeMap() (stateFn, error) {
+ v := reflect.MakeMap(m.valueType)
+ ptr := newValue(v.Type())
+ ptr.Elem().Set(v)
+ if err := unmarshalMap(m.dec, ptr); err != nil {
+ return nil, err
+ }
+
+ m.m.Elem().SetMapIndex(reflect.ValueOf(m.key), v)
+
+ return m.next, nil
+}
+
+func (m *mapWalk) storeSlice() (stateFn, error) {
+ v := newValue(m.valueType)
+ if err := unmarshalSlice(m.dec, v); err != nil {
+ return nil, err
+ }
+
+ m.m.Elem().SetMapIndex(reflect.ValueOf(m.key), v.Elem())
+
+ return m.next, nil
+}
+
+// valueType returns the underlying Type. So a *struct would yield
+// struct, etc...
+func (m *mapWalk) valueBaseType() (reflect.Type, bool) {
+ ptr := false
+ v := m.valueType
+ if v.Kind() == reflect.Ptr {
+ ptr = true
+ v = v.Elem()
+ }
+ return v, ptr
+}
+
+// unmarshalSlice unmarshal's the next value, which must be a slice, into
+// ptrSlice, which must be a pointer to a slice. newValue() can be use to
+// create the slice.
+func unmarshalSlice(dec *json.Decoder, ptrSlice reflect.Value) error {
+ if ptrSlice.Kind() != reflect.Ptr || ptrSlice.Elem().Kind() != reflect.Slice {
+ panic("unmarshalSlice called on non-*[]slice value")
+ }
+ sliceValueType := ptrSlice.Elem().Type().Elem()
+ walk := sliceWalk{
+ dec: dec,
+ s: ptrSlice,
+ valueType: sliceValueType,
+ }
+ if err := walk.run(); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+type sliceWalk struct {
+ dec *json.Decoder
+ s reflect.Value // *[]slice
+ valueType reflect.Type
+}
+
+// run runs our decoder state machine.
+func (s *sliceWalk) run() error {
+ var state = s.start
+ var err error
+ for {
+ state, err = state()
+ if err != nil {
+ return err
+ }
+ if state == nil {
+ return nil
+ }
+ }
+}
+
+func (s *sliceWalk) start() (stateFn, error) {
+ // slices can have custom unmarshaler's.
+ if hasUnmarshalJSON(s.s) {
+ err := s.dec.Decode(s.s.Interface())
+ if err != nil {
+ return nil, err
+ }
+ return nil, nil
+ }
+
+ // We only want to use this if the slice value is:
+ // []*struct/[]struct/[]map/[]slice
+ // otherwise use standard decode
+ t := s.valueBaseType()
+
+ switch t.Kind() {
+ case reflect.Ptr:
+ return nil, fmt.Errorf("cannot unmarshal into a ** or *")
+ case reflect.Struct, reflect.Map, reflect.Slice:
+ delim, err := s.dec.Token()
+ if err != nil {
+ return nil, err
+ }
+ // This indicates the value was set to nil.
+ if delim == nil {
+ return nil, nil
+ }
+ if !delimIs(delim, '[') {
+ return nil, fmt.Errorf("Unmarshal expected opening [, received %v", delim)
+ }
+ return s.next, nil
+ }
+
+ if err := s.dec.Decode(s.s.Interface()); err != nil {
+ return nil, err
+ }
+ return nil, nil
+}
+
+func (s *sliceWalk) next() (stateFn, error) {
+ if s.dec.More() {
+ return s.storeValue, nil
+ }
+ // Nothing left in the slice, remove closing ]
+ _, err := s.dec.Token()
+ return nil, err
+}
+
+func (s *sliceWalk) storeValue() (stateFn, error) {
+ t := s.valueBaseType()
+ switch t.Kind() {
+ case reflect.Ptr:
+ return nil, fmt.Errorf("do not support 'pointer to pointer' or 'pointer to reference' types")
+ case reflect.Struct:
+ return s.storeStruct, nil
+ case reflect.Map:
+ return s.storeMap, nil
+ case reflect.Slice:
+ return s.storeSlice, nil
+ }
+ return nil, fmt.Errorf("bug: sliceWalk.storeValue() called on unsupported type: %v", t.Kind())
+}
+
+func (s *sliceWalk) storeStruct() (stateFn, error) {
+ v := newValue(s.valueType)
+ if err := unmarshalStruct(s.dec, v.Interface()); err != nil {
+ return nil, err
+ }
+
+ if s.valueType.Kind() == reflect.Ptr {
+ s.s.Elem().Set(reflect.Append(s.s.Elem(), v))
+ return s.next, nil
+ }
+
+ s.s.Elem().Set(reflect.Append(s.s.Elem(), v.Elem()))
+ return s.next, nil
+}
+
+func (s *sliceWalk) storeMap() (stateFn, error) {
+ v := reflect.MakeMap(s.valueType)
+ ptr := newValue(v.Type())
+ ptr.Elem().Set(v)
+
+ if err := unmarshalMap(s.dec, ptr); err != nil {
+ return nil, err
+ }
+
+ s.s.Elem().Set(reflect.Append(s.s.Elem(), v))
+
+ return s.next, nil
+}
+
+func (s *sliceWalk) storeSlice() (stateFn, error) {
+ v := newValue(s.valueType)
+ if err := unmarshalSlice(s.dec, v); err != nil {
+ return nil, err
+ }
+
+ s.s.Elem().Set(reflect.Append(s.s.Elem(), v.Elem()))
+
+ return s.next, nil
+}
+
+// valueType returns the underlying Type. So a *struct would yield
+// struct, etc...
+func (s *sliceWalk) valueBaseType() reflect.Type {
+ v := s.valueType
+ if v.Kind() == reflect.Ptr {
+ v = v.Elem()
+ }
+ return v
+}
+
+// newValue() returns a new *type that represents type passed.
+func newValue(valueType reflect.Type) reflect.Value {
+ if valueType.Kind() == reflect.Ptr {
+ return reflect.New(valueType.Elem())
+ }
+ return reflect.New(valueType)
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/marshal.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/marshal.go
new file mode 100644
index 000000000..df5dc6e11
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/marshal.go
@@ -0,0 +1,346 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package json
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "reflect"
+ "unicode"
+)
+
+// marshalStruct takes in i, which must be a *struct or struct and marshals its content
+// as JSON into buff (sometimes with writes to buff directly, sometimes via enc).
+// This call is recursive for all fields of *struct or struct type.
+func marshalStruct(v reflect.Value, buff *bytes.Buffer, enc *json.Encoder) error {
+ if v.Kind() == reflect.Ptr {
+ v = v.Elem()
+ }
+ // We only care about custom Marshalling a struct.
+ if v.Kind() != reflect.Struct {
+ return fmt.Errorf("bug: marshal() received a non *struct or struct, received type %T", v.Interface())
+ }
+
+ if hasMarshalJSON(v) {
+ b, err := callMarshalJSON(v)
+ if err != nil {
+ return err
+ }
+ buff.Write(b)
+ return nil
+ }
+
+ t := v.Type()
+
+ // If it has an AdditionalFields field make sure its the right type.
+ f := v.FieldByName(addField)
+ if f.Kind() != reflect.Invalid {
+ if f.Kind() != reflect.Map {
+ return fmt.Errorf("type %T has field 'AdditionalFields' that is not a map[string]interface{}", v.Interface())
+ }
+ if !f.Type().AssignableTo(mapStrInterType) {
+ return fmt.Errorf("type %T has field 'AdditionalFields' that is not a map[string]interface{}", v.Interface())
+ }
+ }
+
+ translator, err := findFields(v)
+ if err != nil {
+ return err
+ }
+
+ buff.WriteByte(leftBrace)
+ for x := 0; x < v.NumField(); x++ {
+ field := v.Field(x)
+
+ // We don't access private fields.
+ if unicode.IsLower(rune(t.Field(x).Name[0])) {
+ continue
+ }
+
+ if t.Field(x).Name == addField {
+ if v.Field(x).Len() > 0 {
+ if err := writeAddFields(field.Interface(), buff, enc); err != nil {
+ return err
+ }
+ buff.WriteByte(comma)
+ }
+ continue
+ }
+
+ // If they have omitempty set, we don't write out the field if
+ // it is the zero value.
+ if hasOmitEmpty(t.Field(x).Tag.Get("json")) {
+ if v.Field(x).IsZero() {
+ continue
+ }
+ }
+
+ // Write out the field name part.
+ jsonName := translator.jsonName(t.Field(x).Name)
+ buff.WriteString(fmt.Sprintf("%q:", jsonName))
+
+ if field.Kind() == reflect.Ptr {
+ field = field.Elem()
+ }
+
+ if err := marshalStructField(field, buff, enc); err != nil {
+ return err
+ }
+ }
+
+ buff.Truncate(buff.Len() - 1) // Remove final comma
+ buff.WriteByte(rightBrace)
+
+ return nil
+}
+
+func marshalStructField(field reflect.Value, buff *bytes.Buffer, enc *json.Encoder) error {
+ // Determine if we need a trailing comma.
+ defer buff.WriteByte(comma)
+
+ switch field.Kind() {
+ // If it was a *struct or struct, we need to recursively all marshal().
+ case reflect.Struct:
+ if field.CanAddr() {
+ field = field.Addr()
+ }
+ return marshalStruct(field, buff, enc)
+ case reflect.Map:
+ return marshalMap(field, buff, enc)
+ case reflect.Slice:
+ return marshalSlice(field, buff, enc)
+ }
+
+ // It is just a basic type, so encode it.
+ if err := enc.Encode(field.Interface()); err != nil {
+ return err
+ }
+ buff.Truncate(buff.Len() - 1) // Remove Encode() added \n
+
+ return nil
+}
+
+func marshalMap(v reflect.Value, buff *bytes.Buffer, enc *json.Encoder) error {
+ if v.Kind() != reflect.Map {
+ return fmt.Errorf("bug: marshalMap() called on %T", v.Interface())
+ }
+ if v.Len() == 0 {
+ buff.WriteByte(leftBrace)
+ buff.WriteByte(rightBrace)
+ return nil
+ }
+ encoder := mapEncode{m: v, buff: buff, enc: enc}
+ return encoder.run()
+}
+
+type mapEncode struct {
+ m reflect.Value
+ buff *bytes.Buffer
+ enc *json.Encoder
+
+ valueBaseType reflect.Type
+}
+
+// run runs our encoder state machine.
+func (m *mapEncode) run() error {
+ var state = m.start
+ var err error
+ for {
+ state, err = state()
+ if err != nil {
+ return err
+ }
+ if state == nil {
+ return nil
+ }
+ }
+}
+
+func (m *mapEncode) start() (stateFn, error) {
+ if hasMarshalJSON(m.m) {
+ b, err := callMarshalJSON(m.m)
+ if err != nil {
+ return nil, err
+ }
+ m.buff.Write(b)
+ return nil, nil
+ }
+
+ valueBaseType := m.m.Type().Elem()
+ if valueBaseType.Kind() == reflect.Ptr {
+ valueBaseType = valueBaseType.Elem()
+ }
+ m.valueBaseType = valueBaseType
+
+ switch valueBaseType.Kind() {
+ case reflect.Ptr:
+ return nil, fmt.Errorf("Marshal does not support ** or *")
+ case reflect.Struct, reflect.Map, reflect.Slice:
+ return m.encode, nil
+ }
+
+ // If the map value doesn't have a struct/map/slice, just Encode() it.
+ if err := m.enc.Encode(m.m.Interface()); err != nil {
+ return nil, err
+ }
+ m.buff.Truncate(m.buff.Len() - 1) // Remove Encode() added \n
+ return nil, nil
+}
+
+func (m *mapEncode) encode() (stateFn, error) {
+ m.buff.WriteByte(leftBrace)
+
+ iter := m.m.MapRange()
+ for iter.Next() {
+ // Write the key.
+ k := iter.Key()
+ m.buff.WriteString(fmt.Sprintf("%q:", k.String()))
+
+ v := iter.Value()
+ switch m.valueBaseType.Kind() {
+ case reflect.Struct:
+ if v.CanAddr() {
+ v = v.Addr()
+ }
+ if err := marshalStruct(v, m.buff, m.enc); err != nil {
+ return nil, err
+ }
+ case reflect.Map:
+ if err := marshalMap(v, m.buff, m.enc); err != nil {
+ return nil, err
+ }
+ case reflect.Slice:
+ if err := marshalSlice(v, m.buff, m.enc); err != nil {
+ return nil, err
+ }
+ default:
+ panic(fmt.Sprintf("critical bug: mapEncode.encode() called with value base type: %v", m.valueBaseType.Kind()))
+ }
+ m.buff.WriteByte(comma)
+ }
+ m.buff.Truncate(m.buff.Len() - 1) // Remove final comma
+ m.buff.WriteByte(rightBrace)
+
+ return nil, nil
+}
+
+func marshalSlice(v reflect.Value, buff *bytes.Buffer, enc *json.Encoder) error {
+ if v.Kind() != reflect.Slice {
+ return fmt.Errorf("bug: marshalSlice() called on %T", v.Interface())
+ }
+ if v.Len() == 0 {
+ buff.WriteByte(leftParen)
+ buff.WriteByte(rightParen)
+ return nil
+ }
+ encoder := sliceEncode{s: v, buff: buff, enc: enc}
+ return encoder.run()
+}
+
+type sliceEncode struct {
+ s reflect.Value
+ buff *bytes.Buffer
+ enc *json.Encoder
+
+ valueBaseType reflect.Type
+}
+
+// run runs our encoder state machine.
+func (s *sliceEncode) run() error {
+ var state = s.start
+ var err error
+ for {
+ state, err = state()
+ if err != nil {
+ return err
+ }
+ if state == nil {
+ return nil
+ }
+ }
+}
+
+func (s *sliceEncode) start() (stateFn, error) {
+ if hasMarshalJSON(s.s) {
+ b, err := callMarshalJSON(s.s)
+ if err != nil {
+ return nil, err
+ }
+ s.buff.Write(b)
+ return nil, nil
+ }
+
+ valueBaseType := s.s.Type().Elem()
+ if valueBaseType.Kind() == reflect.Ptr {
+ valueBaseType = valueBaseType.Elem()
+ }
+ s.valueBaseType = valueBaseType
+
+ switch valueBaseType.Kind() {
+ case reflect.Ptr:
+ return nil, fmt.Errorf("Marshal does not support ** or *")
+ case reflect.Struct, reflect.Map, reflect.Slice:
+ return s.encode, nil
+ }
+
+ // If the map value doesn't have a struct/map/slice, just Encode() it.
+ if err := s.enc.Encode(s.s.Interface()); err != nil {
+ return nil, err
+ }
+ s.buff.Truncate(s.buff.Len() - 1) // Remove Encode added \n
+
+ return nil, nil
+}
+
+func (s *sliceEncode) encode() (stateFn, error) {
+ s.buff.WriteByte(leftParen)
+ for i := 0; i < s.s.Len(); i++ {
+ v := s.s.Index(i)
+ switch s.valueBaseType.Kind() {
+ case reflect.Struct:
+ if v.CanAddr() {
+ v = v.Addr()
+ }
+ if err := marshalStruct(v, s.buff, s.enc); err != nil {
+ return nil, err
+ }
+ case reflect.Map:
+ if err := marshalMap(v, s.buff, s.enc); err != nil {
+ return nil, err
+ }
+ case reflect.Slice:
+ if err := marshalSlice(v, s.buff, s.enc); err != nil {
+ return nil, err
+ }
+ default:
+ panic(fmt.Sprintf("critical bug: mapEncode.encode() called with value base type: %v", s.valueBaseType.Kind()))
+ }
+ s.buff.WriteByte(comma)
+ }
+ s.buff.Truncate(s.buff.Len() - 1) // Remove final comma
+ s.buff.WriteByte(rightParen)
+ return nil, nil
+}
+
+// writeAddFields writes the AdditionalFields struct field out to JSON as field
+// values. i must be a map[string]interface{} or this will panic.
+func writeAddFields(i interface{}, buff *bytes.Buffer, enc *json.Encoder) error {
+ m := i.(map[string]interface{})
+
+ x := 0
+ for k, v := range m {
+ buff.WriteString(fmt.Sprintf("%q:", k))
+ if err := enc.Encode(v); err != nil {
+ return err
+ }
+ buff.Truncate(buff.Len() - 1) // Remove Encode() added \n
+
+ if x+1 != len(m) {
+ buff.WriteByte(comma)
+ }
+ x++
+ }
+ return nil
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/struct.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/struct.go
new file mode 100644
index 000000000..07751544a
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/struct.go
@@ -0,0 +1,290 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package json
+
+import (
+ "encoding/json"
+ "fmt"
+ "reflect"
+ "strings"
+)
+
+func unmarshalStruct(jdec *json.Decoder, i interface{}) error {
+ v := reflect.ValueOf(i)
+ if v.Kind() != reflect.Ptr {
+ return fmt.Errorf("Unmarshal() received type %T, which is not a *struct", i)
+ }
+ v = v.Elem()
+ if v.Kind() != reflect.Struct {
+ return fmt.Errorf("Unmarshal() received type %T, which is not a *struct", i)
+ }
+
+ if hasUnmarshalJSON(v) {
+ // Indicates that this type has a custom Unmarshaler.
+ return jdec.Decode(v.Addr().Interface())
+ }
+
+ f := v.FieldByName(addField)
+ if f.Kind() == reflect.Invalid {
+ return fmt.Errorf("Unmarshal(%T) only supports structs that have the field AdditionalFields or implements json.Unmarshaler", i)
+ }
+
+ if f.Kind() != reflect.Map || !f.Type().AssignableTo(mapStrInterType) {
+ return fmt.Errorf("type %T has field 'AdditionalFields' that is not a map[string]interface{}", i)
+ }
+
+ dec := newDecoder(jdec, v)
+ return dec.run()
+}
+
+type decoder struct {
+ dec *json.Decoder
+ value reflect.Value // This will be a reflect.Struct
+ translator translateFields
+ key string
+}
+
+func newDecoder(dec *json.Decoder, value reflect.Value) *decoder {
+ return &decoder{value: value, dec: dec}
+}
+
+// run runs our decoder state machine.
+func (d *decoder) run() error {
+ var state = d.start
+ var err error
+ for {
+ state, err = state()
+ if err != nil {
+ return err
+ }
+ if state == nil {
+ return nil
+ }
+ }
+}
+
+// start looks for our opening delimeter '{' and then transitions to looping through our fields.
+func (d *decoder) start() (stateFn, error) {
+ var err error
+ d.translator, err = findFields(d.value)
+ if err != nil {
+ return nil, err
+ }
+
+ delim, err := d.dec.Token()
+ if err != nil {
+ return nil, err
+ }
+ if !delimIs(delim, '{') {
+ return nil, fmt.Errorf("Unmarshal expected opening {, received %v", delim)
+ }
+
+ return d.next, nil
+}
+
+// next gets the next struct field name from the raw json or stops the machine if we get our closing }.
+func (d *decoder) next() (stateFn, error) {
+ if !d.dec.More() {
+ // Remove the closing }.
+ if _, err := d.dec.Token(); err != nil {
+ return nil, err
+ }
+ return nil, nil
+ }
+
+ key, err := d.dec.Token()
+ if err != nil {
+ return nil, err
+ }
+
+ d.key = key.(string)
+ return d.storeValue, nil
+}
+
+// storeValue takes the next value and stores it our struct. If the field can't be found
+// in the struct, it pushes the operation to storeAdditional().
+func (d *decoder) storeValue() (stateFn, error) {
+ goName := d.translator.goName(d.key)
+ if goName == "" {
+ goName = d.key
+ }
+
+ // We don't have the field in the struct, so it goes in AdditionalFields.
+ f := d.value.FieldByName(goName)
+ if f.Kind() == reflect.Invalid {
+ return d.storeAdditional, nil
+ }
+
+ // Indicates that this type has a custom Unmarshaler.
+ if hasUnmarshalJSON(f) {
+ err := d.dec.Decode(f.Addr().Interface())
+ if err != nil {
+ return nil, err
+ }
+ return d.next, nil
+ }
+
+ t, isPtr, err := fieldBaseType(d.value, goName)
+ if err != nil {
+ return nil, fmt.Errorf("type(%s) had field(%s) %w", d.value.Type().Name(), goName, err)
+ }
+
+ switch t.Kind() {
+ // We need to recursively call ourselves on any *struct or struct.
+ case reflect.Struct:
+ if isPtr {
+ if f.IsNil() {
+ f.Set(reflect.New(t))
+ }
+ } else {
+ f = f.Addr()
+ }
+ if err := unmarshalStruct(d.dec, f.Interface()); err != nil {
+ return nil, err
+ }
+ return d.next, nil
+ case reflect.Map:
+ v := reflect.MakeMap(f.Type())
+ ptr := newValue(f.Type())
+ ptr.Elem().Set(v)
+ if err := unmarshalMap(d.dec, ptr); err != nil {
+ return nil, err
+ }
+ f.Set(ptr.Elem())
+ return d.next, nil
+ case reflect.Slice:
+ v := reflect.MakeSlice(f.Type(), 0, 0)
+ ptr := newValue(f.Type())
+ ptr.Elem().Set(v)
+ if err := unmarshalSlice(d.dec, ptr); err != nil {
+ return nil, err
+ }
+ f.Set(ptr.Elem())
+ return d.next, nil
+ }
+
+ if !isPtr {
+ f = f.Addr()
+ }
+
+ // For values that are pointers, we need them to be non-nil in order
+ // to decode into them.
+ if f.IsNil() {
+ f.Set(reflect.New(t))
+ }
+
+ if err := d.dec.Decode(f.Interface()); err != nil {
+ return nil, err
+ }
+
+ return d.next, nil
+}
+
+// storeAdditional pushes the key/value into our .AdditionalFields map.
+func (d *decoder) storeAdditional() (stateFn, error) {
+ rw := json.RawMessage{}
+ if err := d.dec.Decode(&rw); err != nil {
+ return nil, err
+ }
+ field := d.value.FieldByName(addField)
+ if field.IsNil() {
+ field.Set(reflect.MakeMap(field.Type()))
+ }
+ field.SetMapIndex(reflect.ValueOf(d.key), reflect.ValueOf(rw))
+ return d.next, nil
+}
+
+func fieldBaseType(v reflect.Value, fieldName string) (t reflect.Type, isPtr bool, err error) {
+ sf, ok := v.Type().FieldByName(fieldName)
+ if !ok {
+ return nil, false, fmt.Errorf("bug: fieldBaseType() lookup of field(%s) on type(%s): do not have field", fieldName, v.Type().Name())
+ }
+ t = sf.Type
+ if t.Kind() == reflect.Ptr {
+ t = t.Elem()
+ isPtr = true
+ }
+ if t.Kind() == reflect.Ptr {
+ return nil, isPtr, fmt.Errorf("received pointer to pointer type, not supported")
+ }
+ return t, isPtr, nil
+}
+
+type translateField struct {
+ jsonName string
+ goName string
+}
+
+// translateFields is a list of translateFields with a handy lookup method.
+type translateFields []translateField
+
+// goName loops through a list of fields looking for one contaning the jsonName and
+// returning the goName. If not found, returns the empty string.
+// Note: not a map because at this size slices are faster even in tight loops.
+func (t translateFields) goName(jsonName string) string {
+ for _, entry := range t {
+ if entry.jsonName == jsonName {
+ return entry.goName
+ }
+ }
+ return ""
+}
+
+// jsonName loops through a list of fields looking for one contaning the goName and
+// returning the jsonName. If not found, returns the empty string.
+// Note: not a map because at this size slices are faster even in tight loops.
+func (t translateFields) jsonName(goName string) string {
+ for _, entry := range t {
+ if entry.goName == goName {
+ return entry.jsonName
+ }
+ }
+ return ""
+}
+
+var umarshalerType = reflect.TypeOf((*json.Unmarshaler)(nil)).Elem()
+
+// findFields parses a struct and writes the field tags for lookup. It will return an error
+// if any field has a type of *struct or struct that does not implement json.Marshaler.
+func findFields(v reflect.Value) (translateFields, error) {
+ if v.Kind() == reflect.Ptr {
+ v = v.Elem()
+ }
+ if v.Kind() != reflect.Struct {
+ return nil, fmt.Errorf("findFields received a %s type, expected *struct or struct", v.Type().Name())
+ }
+ tfs := make([]translateField, 0, v.NumField())
+ for i := 0; i < v.NumField(); i++ {
+ tf := translateField{
+ goName: v.Type().Field(i).Name,
+ jsonName: parseTag(v.Type().Field(i).Tag.Get("json")),
+ }
+ switch tf.jsonName {
+ case "", "-":
+ tf.jsonName = tf.goName
+ }
+ tfs = append(tfs, tf)
+
+ f := v.Field(i)
+ if f.Kind() == reflect.Ptr {
+ f = f.Elem()
+ }
+ if f.Kind() == reflect.Struct {
+ if f.Type().Implements(umarshalerType) {
+ return nil, fmt.Errorf("struct type %q which has field %q which "+
+ "doesn't implement json.Unmarshaler", v.Type().Name(), v.Type().Field(i).Name)
+ }
+ }
+ }
+ return tfs, nil
+}
+
+// parseTag just returns the first entry in the tag. tag is the string
+// returned by reflect.StructField.Tag().Get().
+func parseTag(tag string) string {
+ if idx := strings.Index(tag, ","); idx != -1 {
+ return tag[:idx]
+ }
+ return tag
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time/time.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time/time.go
new file mode 100644
index 000000000..a1c99621e
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time/time.go
@@ -0,0 +1,70 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+// Package time provides for custom types to translate time from JSON and other formats
+// into time.Time objects.
+package time
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+ "time"
+)
+
+// Unix provides a type that can marshal and unmarshal a string representation
+// of the unix epoch into a time.Time object.
+type Unix struct {
+ T time.Time
+}
+
+// MarshalJSON implements encoding/json.MarshalJSON().
+func (u Unix) MarshalJSON() ([]byte, error) {
+ if u.T.IsZero() {
+ return []byte(""), nil
+ }
+ return []byte(fmt.Sprintf("%q", strconv.FormatInt(u.T.Unix(), 10))), nil
+}
+
+// UnmarshalJSON implements encoding/json.UnmarshalJSON().
+func (u *Unix) UnmarshalJSON(b []byte) error {
+ i, err := strconv.Atoi(strings.Trim(string(b), `"`))
+ if err != nil {
+ return fmt.Errorf("unix time(%s) could not be converted from string to int: %w", string(b), err)
+ }
+ u.T = time.Unix(int64(i), 0)
+ return nil
+}
+
+// DurationTime provides a type that can marshal and unmarshal a string representation
+// of a duration from now into a time.Time object.
+// Note: I'm not sure this is the best way to do this. What happens is we get a field
+// called "expires_in" that represents the seconds from now that this expires. We
+// turn that into a time we call .ExpiresOn. But maybe we should be recording
+// when the token was received at .TokenRecieved and .ExpiresIn should remain as a duration.
+// Then we could have a method called ExpiresOn(). Honestly, the whole thing is
+// bad because the server doesn't return a concrete time. I think this is
+// cleaner, but its not great either.
+type DurationTime struct {
+ T time.Time
+}
+
+// MarshalJSON implements encoding/json.MarshalJSON().
+func (d DurationTime) MarshalJSON() ([]byte, error) {
+ if d.T.IsZero() {
+ return []byte(""), nil
+ }
+
+ dt := time.Until(d.T)
+ return []byte(fmt.Sprintf("%d", int64(dt*time.Second))), nil
+}
+
+// UnmarshalJSON implements encoding/json.UnmarshalJSON().
+func (d *DurationTime) UnmarshalJSON(b []byte) error {
+ i, err := strconv.Atoi(strings.Trim(string(b), `"`))
+ if err != nil {
+ return fmt.Errorf("unix time(%s) could not be converted from string to int: %w", string(b), err)
+ }
+ d.T = time.Now().Add(time.Duration(i) * time.Second)
+ return nil
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go
new file mode 100644
index 000000000..04236ff31
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go
@@ -0,0 +1,177 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+// Package local contains a local HTTP server used with interactive authentication.
+package local
+
+import (
+ "context"
+ "fmt"
+ "net"
+ "net/http"
+ "strconv"
+ "strings"
+ "time"
+)
+
+var okPage = []byte(`
+
+
+
+
+ Authentication Complete
+
+
+ Authentication complete. You can return to the application. Feel free to close this browser tab.
+
+
+`)
+
+const failPage = `
+
+
+
+
+ Authentication Failed
+
+
+ Authentication failed. You can return to the application. Feel free to close this browser tab.
+ Error details: error %s error_description: %s
+
+
+`
+
+// Result is the result from the redirect.
+type Result struct {
+ // Code is the code sent by the authority server.
+ Code string
+ // Err is set if there was an error.
+ Err error
+}
+
+// Server is an HTTP server.
+type Server struct {
+ // Addr is the address the server is listening on.
+ Addr string
+ resultCh chan Result
+ s *http.Server
+ reqState string
+}
+
+// New creates a local HTTP server and starts it.
+func New(reqState string, port int) (*Server, error) {
+ var l net.Listener
+ var err error
+ var portStr string
+ if port > 0 {
+ // use port provided by caller
+ l, err = net.Listen("tcp", fmt.Sprintf("localhost:%d", port))
+ portStr = strconv.FormatInt(int64(port), 10)
+ } else {
+ // find a free port
+ for i := 0; i < 10; i++ {
+ l, err = net.Listen("tcp", "localhost:0")
+ if err != nil {
+ continue
+ }
+ addr := l.Addr().String()
+ portStr = addr[strings.LastIndex(addr, ":")+1:]
+ break
+ }
+ }
+ if err != nil {
+ return nil, err
+ }
+
+ serv := &Server{
+ Addr: fmt.Sprintf("http://localhost:%s", portStr),
+ s: &http.Server{Addr: "localhost:0", ReadHeaderTimeout: time.Second},
+ reqState: reqState,
+ resultCh: make(chan Result, 1),
+ }
+ serv.s.Handler = http.HandlerFunc(serv.handler)
+
+ if err := serv.start(l); err != nil {
+ return nil, err
+ }
+
+ return serv, nil
+}
+
+func (s *Server) start(l net.Listener) error {
+ go func() {
+ err := s.s.Serve(l)
+ if err != nil {
+ select {
+ case s.resultCh <- Result{Err: err}:
+ default:
+ }
+ }
+ }()
+
+ return nil
+}
+
+// Result gets the result of the redirect operation. Once a single result is returned, the server
+// is shutdown. ctx deadline will be honored.
+func (s *Server) Result(ctx context.Context) Result {
+ select {
+ case <-ctx.Done():
+ return Result{Err: ctx.Err()}
+ case r := <-s.resultCh:
+ return r
+ }
+}
+
+// Shutdown shuts down the server.
+func (s *Server) Shutdown() {
+ // Note: You might get clever and think you can do this in handler() as a defer, you can't.
+ _ = s.s.Shutdown(context.Background())
+}
+
+func (s *Server) putResult(r Result) {
+ select {
+ case s.resultCh <- r:
+ default:
+ }
+}
+
+func (s *Server) handler(w http.ResponseWriter, r *http.Request) {
+ q := r.URL.Query()
+
+ headerErr := q.Get("error")
+ if headerErr != "" {
+ desc := q.Get("error_description")
+ // Note: It is a little weird we handle some errors by not going to the failPage. If they all should,
+ // change this to s.error() and make s.error() write the failPage instead of an error code.
+ _, _ = w.Write([]byte(fmt.Sprintf(failPage, headerErr, desc)))
+ s.putResult(Result{Err: fmt.Errorf(desc)})
+ return
+ }
+
+ respState := q.Get("state")
+ switch respState {
+ case s.reqState:
+ case "":
+ s.error(w, http.StatusInternalServerError, "server didn't send OAuth state")
+ return
+ default:
+ s.error(w, http.StatusInternalServerError, "mismatched OAuth state, req(%s), resp(%s)", s.reqState, respState)
+ return
+ }
+
+ code := q.Get("code")
+ if code == "" {
+ s.error(w, http.StatusInternalServerError, "authorization code missing in query string")
+ return
+ }
+
+ _, _ = w.Write(okPage)
+ s.putResult(Result{Code: code})
+}
+
+func (s *Server) error(w http.ResponseWriter, code int, str string, i ...interface{}) {
+ err := fmt.Errorf(str, i...)
+ http.Error(w, err.Error(), code)
+ s.putResult(Result{Err: err})
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go
new file mode 100644
index 000000000..ebd86e2ba
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go
@@ -0,0 +1,353 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package oauth
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "io"
+ "time"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported"
+ internalTime "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs"
+ "github.com/google/uuid"
+)
+
+// ResolveEndpointer contains the methods for resolving authority endpoints.
+type ResolveEndpointer interface {
+ ResolveEndpoints(ctx context.Context, authorityInfo authority.Info, userPrincipalName string) (authority.Endpoints, error)
+}
+
+// AccessTokens contains the methods for fetching tokens from different sources.
+type AccessTokens interface {
+ DeviceCodeResult(ctx context.Context, authParameters authority.AuthParams) (accesstokens.DeviceCodeResult, error)
+ FromUsernamePassword(ctx context.Context, authParameters authority.AuthParams) (accesstokens.TokenResponse, error)
+ FromAuthCode(ctx context.Context, req accesstokens.AuthCodeRequest) (accesstokens.TokenResponse, error)
+ FromRefreshToken(ctx context.Context, appType accesstokens.AppType, authParams authority.AuthParams, cc *accesstokens.Credential, refreshToken string) (accesstokens.TokenResponse, error)
+ FromClientSecret(ctx context.Context, authParameters authority.AuthParams, clientSecret string) (accesstokens.TokenResponse, error)
+ FromAssertion(ctx context.Context, authParameters authority.AuthParams, assertion string) (accesstokens.TokenResponse, error)
+ FromUserAssertionClientSecret(ctx context.Context, authParameters authority.AuthParams, userAssertion string, clientSecret string) (accesstokens.TokenResponse, error)
+ FromUserAssertionClientCertificate(ctx context.Context, authParameters authority.AuthParams, userAssertion string, assertion string) (accesstokens.TokenResponse, error)
+ FromDeviceCodeResult(ctx context.Context, authParameters authority.AuthParams, deviceCodeResult accesstokens.DeviceCodeResult) (accesstokens.TokenResponse, error)
+ FromSamlGrant(ctx context.Context, authParameters authority.AuthParams, samlGrant wstrust.SamlTokenInfo) (accesstokens.TokenResponse, error)
+}
+
+// FetchAuthority will be implemented by authority.Authority.
+type FetchAuthority interface {
+ UserRealm(context.Context, authority.AuthParams) (authority.UserRealm, error)
+ AADInstanceDiscovery(context.Context, authority.Info) (authority.InstanceDiscoveryResponse, error)
+}
+
+// FetchWSTrust contains the methods for interacting with WSTrust endpoints.
+type FetchWSTrust interface {
+ Mex(ctx context.Context, federationMetadataURL string) (defs.MexDocument, error)
+ SAMLTokenInfo(ctx context.Context, authParameters authority.AuthParams, cloudAudienceURN string, endpoint defs.Endpoint) (wstrust.SamlTokenInfo, error)
+}
+
+// Client provides tokens for various types of token requests.
+type Client struct {
+ Resolver ResolveEndpointer
+ AccessTokens AccessTokens
+ Authority FetchAuthority
+ WSTrust FetchWSTrust
+}
+
+// New is the constructor for Token.
+func New(httpClient ops.HTTPClient) *Client {
+ r := ops.New(httpClient)
+ return &Client{
+ Resolver: newAuthorityEndpoint(r),
+ AccessTokens: r.AccessTokens(),
+ Authority: r.Authority(),
+ WSTrust: r.WSTrust(),
+ }
+}
+
+// ResolveEndpoints gets the authorization and token endpoints and creates an AuthorityEndpoints instance.
+func (t *Client) ResolveEndpoints(ctx context.Context, authorityInfo authority.Info, userPrincipalName string) (authority.Endpoints, error) {
+ return t.Resolver.ResolveEndpoints(ctx, authorityInfo, userPrincipalName)
+}
+
+// AADInstanceDiscovery attempts to discover a tenant endpoint (used in OIDC auth with an authorization endpoint).
+// This is done by AAD which allows for aliasing of tenants (windows.sts.net is the same as login.windows.com).
+func (t *Client) AADInstanceDiscovery(ctx context.Context, authorityInfo authority.Info) (authority.InstanceDiscoveryResponse, error) {
+ return t.Authority.AADInstanceDiscovery(ctx, authorityInfo)
+}
+
+// AuthCode returns a token based on an authorization code.
+func (t *Client) AuthCode(ctx context.Context, req accesstokens.AuthCodeRequest) (accesstokens.TokenResponse, error) {
+ if err := scopeError(req.AuthParams); err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+ if err := t.resolveEndpoint(ctx, &req.AuthParams, ""); err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+
+ tResp, err := t.AccessTokens.FromAuthCode(ctx, req)
+ if err != nil {
+ return accesstokens.TokenResponse{}, fmt.Errorf("could not retrieve token from auth code: %w", err)
+ }
+ return tResp, nil
+}
+
+// Credential acquires a token from the authority using a client credentials grant.
+func (t *Client) Credential(ctx context.Context, authParams authority.AuthParams, cred *accesstokens.Credential) (accesstokens.TokenResponse, error) {
+ if cred.TokenProvider != nil {
+ now := time.Now()
+ scopes := make([]string, len(authParams.Scopes))
+ copy(scopes, authParams.Scopes)
+ params := exported.TokenProviderParameters{
+ Claims: authParams.Claims,
+ CorrelationID: uuid.New().String(),
+ Scopes: scopes,
+ TenantID: authParams.AuthorityInfo.Tenant,
+ }
+ tr, err := cred.TokenProvider(ctx, params)
+ if err != nil {
+ if len(scopes) == 0 {
+ err = fmt.Errorf("token request had an empty authority.AuthParams.Scopes, which may cause the following error: %w", err)
+ return accesstokens.TokenResponse{}, err
+ }
+ return accesstokens.TokenResponse{}, err
+ }
+ return accesstokens.TokenResponse{
+ AccessToken: tr.AccessToken,
+ ExpiresOn: internalTime.DurationTime{
+ T: now.Add(time.Duration(tr.ExpiresInSeconds) * time.Second),
+ },
+ GrantedScopes: accesstokens.Scopes{Slice: authParams.Scopes},
+ }, nil
+ }
+
+ if err := t.resolveEndpoint(ctx, &authParams, ""); err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+
+ if cred.Secret != "" {
+ return t.AccessTokens.FromClientSecret(ctx, authParams, cred.Secret)
+ }
+ jwt, err := cred.JWT(ctx, authParams)
+ if err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+ return t.AccessTokens.FromAssertion(ctx, authParams, jwt)
+}
+
+// Credential acquires a token from the authority using a client credentials grant.
+func (t *Client) OnBehalfOf(ctx context.Context, authParams authority.AuthParams, cred *accesstokens.Credential) (accesstokens.TokenResponse, error) {
+ if err := scopeError(authParams); err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+ if err := t.resolveEndpoint(ctx, &authParams, ""); err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+
+ if cred.Secret != "" {
+ return t.AccessTokens.FromUserAssertionClientSecret(ctx, authParams, authParams.UserAssertion, cred.Secret)
+ }
+ jwt, err := cred.JWT(ctx, authParams)
+ if err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+ tr, err := t.AccessTokens.FromUserAssertionClientCertificate(ctx, authParams, authParams.UserAssertion, jwt)
+ if err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+ return tr, nil
+}
+
+func (t *Client) Refresh(ctx context.Context, reqType accesstokens.AppType, authParams authority.AuthParams, cc *accesstokens.Credential, refreshToken accesstokens.RefreshToken) (accesstokens.TokenResponse, error) {
+ if err := scopeError(authParams); err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+ if err := t.resolveEndpoint(ctx, &authParams, ""); err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+
+ tr, err := t.AccessTokens.FromRefreshToken(ctx, reqType, authParams, cc, refreshToken.Secret)
+ if err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+ return tr, nil
+}
+
+// UsernamePassword retrieves a token where a username and password is used. However, if this is
+// a user realm of "Federated", this uses SAML tokens. If "Managed", uses normal username/password.
+func (t *Client) UsernamePassword(ctx context.Context, authParams authority.AuthParams) (accesstokens.TokenResponse, error) {
+ if err := scopeError(authParams); err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+
+ if authParams.AuthorityInfo.AuthorityType == authority.ADFS {
+ if err := t.resolveEndpoint(ctx, &authParams, authParams.Username); err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+ return t.AccessTokens.FromUsernamePassword(ctx, authParams)
+ }
+ if err := t.resolveEndpoint(ctx, &authParams, ""); err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+
+ userRealm, err := t.Authority.UserRealm(ctx, authParams)
+ if err != nil {
+ return accesstokens.TokenResponse{}, fmt.Errorf("problem getting user realm from authority: %w", err)
+ }
+
+ switch userRealm.AccountType {
+ case authority.Federated:
+ mexDoc, err := t.WSTrust.Mex(ctx, userRealm.FederationMetadataURL)
+ if err != nil {
+ err = fmt.Errorf("problem getting mex doc from federated url(%s): %w", userRealm.FederationMetadataURL, err)
+ return accesstokens.TokenResponse{}, err
+ }
+
+ saml, err := t.WSTrust.SAMLTokenInfo(ctx, authParams, userRealm.CloudAudienceURN, mexDoc.UsernamePasswordEndpoint)
+ if err != nil {
+ err = fmt.Errorf("problem getting SAML token info: %w", err)
+ return accesstokens.TokenResponse{}, err
+ }
+ tr, err := t.AccessTokens.FromSamlGrant(ctx, authParams, saml)
+ if err != nil {
+ return accesstokens.TokenResponse{}, err
+ }
+ return tr, nil
+ case authority.Managed:
+ if len(authParams.Scopes) == 0 {
+ err = fmt.Errorf("token request had an empty authority.AuthParams.Scopes, which may cause the following error: %w", err)
+ return accesstokens.TokenResponse{}, err
+ }
+ return t.AccessTokens.FromUsernamePassword(ctx, authParams)
+ }
+ return accesstokens.TokenResponse{}, errors.New("unknown account type")
+}
+
+// DeviceCode is the result of a call to Token.DeviceCode().
+type DeviceCode struct {
+ // Result is the device code result from the first call in the device code flow. This allows
+ // the caller to retrieve the displayed code that is used to authorize on the second device.
+ Result accesstokens.DeviceCodeResult
+ authParams authority.AuthParams
+
+ accessTokens AccessTokens
+}
+
+// Token returns a token AFTER the user uses the user code on the second device. This will block
+// until either: (1) the code is input by the user and the service releases a token, (2) the token
+// expires, (3) the Context passed to .DeviceCode() is cancelled or expires, (4) some other service
+// error occurs.
+func (d DeviceCode) Token(ctx context.Context) (accesstokens.TokenResponse, error) {
+ if d.accessTokens == nil {
+ return accesstokens.TokenResponse{}, fmt.Errorf("DeviceCode was either created outside its package or the creating method had an error. DeviceCode is not valid")
+ }
+
+ var cancel context.CancelFunc
+ if deadline, ok := ctx.Deadline(); !ok || d.Result.ExpiresOn.Before(deadline) {
+ ctx, cancel = context.WithDeadline(ctx, d.Result.ExpiresOn)
+ } else {
+ ctx, cancel = context.WithCancel(ctx)
+ }
+ defer cancel()
+
+ var interval = 50 * time.Millisecond
+ timer := time.NewTimer(interval)
+ defer timer.Stop()
+
+ for {
+ timer.Reset(interval)
+ select {
+ case <-ctx.Done():
+ return accesstokens.TokenResponse{}, ctx.Err()
+ case <-timer.C:
+ interval += interval * 2
+ if interval > 5*time.Second {
+ interval = 5 * time.Second
+ }
+ }
+
+ token, err := d.accessTokens.FromDeviceCodeResult(ctx, d.authParams, d.Result)
+ if err != nil && isWaitDeviceCodeErr(err) {
+ continue
+ }
+ return token, err // This handles if it was a non-wait error or success
+ }
+}
+
+type deviceCodeError struct {
+ Error string `json:"error"`
+}
+
+func isWaitDeviceCodeErr(err error) bool {
+ var c errors.CallErr
+ if !errors.As(err, &c) {
+ return false
+ }
+ if c.Resp.StatusCode != 400 {
+ return false
+ }
+ var dCErr deviceCodeError
+ defer c.Resp.Body.Close()
+ body, err := io.ReadAll(c.Resp.Body)
+ if err != nil {
+ return false
+ }
+ err = json.Unmarshal(body, &dCErr)
+ if err != nil {
+ return false
+ }
+ if dCErr.Error == "authorization_pending" || dCErr.Error == "slow_down" {
+ return true
+ }
+ return false
+}
+
+// DeviceCode returns a DeviceCode object that can be used to get the code that must be entered on the second
+// device and optionally the token once the code has been entered on the second device.
+func (t *Client) DeviceCode(ctx context.Context, authParams authority.AuthParams) (DeviceCode, error) {
+ if err := scopeError(authParams); err != nil {
+ return DeviceCode{}, err
+ }
+
+ if err := t.resolveEndpoint(ctx, &authParams, ""); err != nil {
+ return DeviceCode{}, err
+ }
+
+ dcr, err := t.AccessTokens.DeviceCodeResult(ctx, authParams)
+ if err != nil {
+ return DeviceCode{}, err
+ }
+
+ return DeviceCode{Result: dcr, authParams: authParams, accessTokens: t.AccessTokens}, nil
+}
+
+func (t *Client) resolveEndpoint(ctx context.Context, authParams *authority.AuthParams, userPrincipalName string) error {
+ endpoints, err := t.Resolver.ResolveEndpoints(ctx, authParams.AuthorityInfo, userPrincipalName)
+ if err != nil {
+ return fmt.Errorf("unable to resolve an endpoint: %s", err)
+ }
+ authParams.Endpoints = endpoints
+ return nil
+}
+
+// scopeError takes an authority.AuthParams and returns an error
+// if len(AuthParams.Scope) == 0.
+func scopeError(a authority.AuthParams) error {
+ // TODO(someone): we could look deeper at the message to determine if
+ // it's a scope error, but this is a good start.
+ /*
+ {error":"invalid_scope","error_description":"AADSTS1002012: The provided value for scope
+ openid offline_access profile is not valid. Client credential flows must have a scope value
+ with /.default suffixed to the resource identifier (application ID URI)...}
+ */
+ if len(a.Scopes) == 0 {
+ return fmt.Errorf("token request had an empty authority.AuthParams.Scopes, which is invalid")
+ }
+ return nil
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go
new file mode 100644
index 000000000..003d38648
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go
@@ -0,0 +1,451 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+/*
+Package accesstokens exposes a REST client for querying backend systems to get various types of
+access tokens (oauth) for use in authentication.
+
+These calls are of type "application/x-www-form-urlencoded". This means we use url.Values to
+represent arguments and then encode them into the POST body message. We receive JSON in
+return for the requests. The request definition is defined in https://tools.ietf.org/html/rfc7521#section-4.2 .
+*/
+package accesstokens
+
+import (
+ "context"
+ "crypto"
+
+ /* #nosec */
+ "crypto/sha1"
+ "crypto/x509"
+ "encoding/base64"
+ "encoding/json"
+ "fmt"
+ "net/url"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/grant"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust"
+ "github.com/golang-jwt/jwt/v5"
+ "github.com/google/uuid"
+)
+
+const (
+ grantType = "grant_type"
+ deviceCode = "device_code"
+ clientID = "client_id"
+ clientInfo = "client_info"
+ clientInfoVal = "1"
+ username = "username"
+ password = "password"
+)
+
+//go:generate stringer -type=AppType
+
+// AppType is whether the authorization code flow is for a public or confidential client.
+type AppType int8
+
+const (
+ // ATUnknown is the zero value when the type hasn't been set.
+ ATUnknown AppType = iota
+ // ATPublic indicates this if for the Public.Client.
+ ATPublic
+ // ATConfidential indicates this if for the Confidential.Client.
+ ATConfidential
+)
+
+type urlFormCaller interface {
+ URLFormCall(ctx context.Context, endpoint string, qv url.Values, resp interface{}) error
+}
+
+// DeviceCodeResponse represents the HTTP response received from the device code endpoint
+type DeviceCodeResponse struct {
+ authority.OAuthResponseBase
+
+ UserCode string `json:"user_code"`
+ DeviceCode string `json:"device_code"`
+ VerificationURL string `json:"verification_url"`
+ ExpiresIn int `json:"expires_in"`
+ Interval int `json:"interval"`
+ Message string `json:"message"`
+
+ AdditionalFields map[string]interface{}
+}
+
+// Convert converts the DeviceCodeResponse to a DeviceCodeResult
+func (dcr DeviceCodeResponse) Convert(clientID string, scopes []string) DeviceCodeResult {
+ expiresOn := time.Now().UTC().Add(time.Duration(dcr.ExpiresIn) * time.Second)
+ return NewDeviceCodeResult(dcr.UserCode, dcr.DeviceCode, dcr.VerificationURL, expiresOn, dcr.Interval, dcr.Message, clientID, scopes)
+}
+
+// Credential represents the credential used in confidential client flows. This can be either
+// a Secret or Cert/Key.
+type Credential struct {
+ // Secret contains the credential secret if we are doing auth by secret.
+ Secret string
+
+ // Cert is the public certificate, if we're authenticating by certificate.
+ Cert *x509.Certificate
+ // Key is the private key for signing, if we're authenticating by certificate.
+ Key crypto.PrivateKey
+ // X5c is the JWT assertion's x5c header value, required for SN/I authentication.
+ X5c []string
+
+ // AssertionCallback is a function provided by the application, if we're authenticating by assertion.
+ AssertionCallback func(context.Context, exported.AssertionRequestOptions) (string, error)
+
+ // TokenProvider is a function provided by the application that implements custom authentication
+ // logic for a confidential client
+ TokenProvider func(context.Context, exported.TokenProviderParameters) (exported.TokenProviderResult, error)
+}
+
+// JWT gets the jwt assertion when the credential is not using a secret.
+func (c *Credential) JWT(ctx context.Context, authParams authority.AuthParams) (string, error) {
+ if c.AssertionCallback != nil {
+ options := exported.AssertionRequestOptions{
+ ClientID: authParams.ClientID,
+ TokenEndpoint: authParams.Endpoints.TokenEndpoint,
+ }
+ return c.AssertionCallback(ctx, options)
+ }
+
+ token := jwt.NewWithClaims(jwt.SigningMethodRS256, jwt.MapClaims{
+ "aud": authParams.Endpoints.TokenEndpoint,
+ "exp": json.Number(strconv.FormatInt(time.Now().Add(10*time.Minute).Unix(), 10)),
+ "iss": authParams.ClientID,
+ "jti": uuid.New().String(),
+ "nbf": json.Number(strconv.FormatInt(time.Now().Unix(), 10)),
+ "sub": authParams.ClientID,
+ })
+ token.Header = map[string]interface{}{
+ "alg": "RS256",
+ "typ": "JWT",
+ "x5t": base64.StdEncoding.EncodeToString(thumbprint(c.Cert)),
+ }
+
+ if authParams.SendX5C {
+ token.Header["x5c"] = c.X5c
+ }
+
+ assertion, err := token.SignedString(c.Key)
+ if err != nil {
+ return "", fmt.Errorf("unable to sign a JWT token using private key: %w", err)
+ }
+ return assertion, nil
+}
+
+// thumbprint runs the asn1.Der bytes through sha1 for use in the x5t parameter of JWT.
+// https://tools.ietf.org/html/rfc7517#section-4.8
+func thumbprint(cert *x509.Certificate) []byte {
+ /* #nosec */
+ a := sha1.Sum(cert.Raw)
+ return a[:]
+}
+
+// Client represents the REST calls to get tokens from token generator backends.
+type Client struct {
+ // Comm provides the HTTP transport client.
+ Comm urlFormCaller
+
+ testing bool
+}
+
+// FromUsernamePassword uses a username and password to get an access token.
+func (c Client) FromUsernamePassword(ctx context.Context, authParameters authority.AuthParams) (TokenResponse, error) {
+ qv := url.Values{}
+ if err := addClaims(qv, authParameters); err != nil {
+ return TokenResponse{}, err
+ }
+ qv.Set(grantType, grant.Password)
+ qv.Set(username, authParameters.Username)
+ qv.Set(password, authParameters.Password)
+ qv.Set(clientID, authParameters.ClientID)
+ qv.Set(clientInfo, clientInfoVal)
+ addScopeQueryParam(qv, authParameters)
+
+ return c.doTokenResp(ctx, authParameters, qv)
+}
+
+// AuthCodeRequest stores the values required to request a token from the authority using an authorization code
+type AuthCodeRequest struct {
+ AuthParams authority.AuthParams
+ Code string
+ CodeChallenge string
+ Credential *Credential
+ AppType AppType
+}
+
+// NewCodeChallengeRequest returns an AuthCodeRequest that uses a code challenge..
+func NewCodeChallengeRequest(params authority.AuthParams, appType AppType, cc *Credential, code, challenge string) (AuthCodeRequest, error) {
+ if appType == ATUnknown {
+ return AuthCodeRequest{}, fmt.Errorf("bug: NewCodeChallengeRequest() called with AppType == ATUnknown")
+ }
+ return AuthCodeRequest{
+ AuthParams: params,
+ AppType: appType,
+ Code: code,
+ CodeChallenge: challenge,
+ Credential: cc,
+ }, nil
+}
+
+// FromAuthCode uses an authorization code to retrieve an access token.
+func (c Client) FromAuthCode(ctx context.Context, req AuthCodeRequest) (TokenResponse, error) {
+ var qv url.Values
+
+ switch req.AppType {
+ case ATUnknown:
+ return TokenResponse{}, fmt.Errorf("bug: Token.AuthCode() received request with AppType == ATUnknown")
+ case ATConfidential:
+ var err error
+ if req.Credential == nil {
+ return TokenResponse{}, fmt.Errorf("AuthCodeRequest had nil Credential for Confidential app")
+ }
+ qv, err = prepURLVals(ctx, req.Credential, req.AuthParams)
+ if err != nil {
+ return TokenResponse{}, err
+ }
+ case ATPublic:
+ qv = url.Values{}
+ default:
+ return TokenResponse{}, fmt.Errorf("bug: Token.AuthCode() received request with AppType == %v, which we do not recongnize", req.AppType)
+ }
+
+ qv.Set(grantType, grant.AuthCode)
+ qv.Set("code", req.Code)
+ qv.Set("code_verifier", req.CodeChallenge)
+ qv.Set("redirect_uri", req.AuthParams.Redirecturi)
+ qv.Set(clientID, req.AuthParams.ClientID)
+ qv.Set(clientInfo, clientInfoVal)
+ addScopeQueryParam(qv, req.AuthParams)
+ if err := addClaims(qv, req.AuthParams); err != nil {
+ return TokenResponse{}, err
+ }
+
+ return c.doTokenResp(ctx, req.AuthParams, qv)
+}
+
+// FromRefreshToken uses a refresh token (for refreshing credentials) to get a new access token.
+func (c Client) FromRefreshToken(ctx context.Context, appType AppType, authParams authority.AuthParams, cc *Credential, refreshToken string) (TokenResponse, error) {
+ qv := url.Values{}
+ if appType == ATConfidential {
+ var err error
+ qv, err = prepURLVals(ctx, cc, authParams)
+ if err != nil {
+ return TokenResponse{}, err
+ }
+ }
+ if err := addClaims(qv, authParams); err != nil {
+ return TokenResponse{}, err
+ }
+ qv.Set(grantType, grant.RefreshToken)
+ qv.Set(clientID, authParams.ClientID)
+ qv.Set(clientInfo, clientInfoVal)
+ qv.Set("refresh_token", refreshToken)
+ addScopeQueryParam(qv, authParams)
+
+ return c.doTokenResp(ctx, authParams, qv)
+}
+
+// FromClientSecret uses a client's secret (aka password) to get a new token.
+func (c Client) FromClientSecret(ctx context.Context, authParameters authority.AuthParams, clientSecret string) (TokenResponse, error) {
+ qv := url.Values{}
+ if err := addClaims(qv, authParameters); err != nil {
+ return TokenResponse{}, err
+ }
+ qv.Set(grantType, grant.ClientCredential)
+ qv.Set("client_secret", clientSecret)
+ qv.Set(clientID, authParameters.ClientID)
+ addScopeQueryParam(qv, authParameters)
+
+ token, err := c.doTokenResp(ctx, authParameters, qv)
+ if err != nil {
+ return token, fmt.Errorf("FromClientSecret(): %w", err)
+ }
+ return token, nil
+}
+
+func (c Client) FromAssertion(ctx context.Context, authParameters authority.AuthParams, assertion string) (TokenResponse, error) {
+ qv := url.Values{}
+ if err := addClaims(qv, authParameters); err != nil {
+ return TokenResponse{}, err
+ }
+ qv.Set(grantType, grant.ClientCredential)
+ qv.Set("client_assertion_type", grant.ClientAssertion)
+ qv.Set("client_assertion", assertion)
+ qv.Set(clientID, authParameters.ClientID)
+ qv.Set(clientInfo, clientInfoVal)
+ addScopeQueryParam(qv, authParameters)
+
+ token, err := c.doTokenResp(ctx, authParameters, qv)
+ if err != nil {
+ return token, fmt.Errorf("FromAssertion(): %w", err)
+ }
+ return token, nil
+}
+
+func (c Client) FromUserAssertionClientSecret(ctx context.Context, authParameters authority.AuthParams, userAssertion string, clientSecret string) (TokenResponse, error) {
+ qv := url.Values{}
+ if err := addClaims(qv, authParameters); err != nil {
+ return TokenResponse{}, err
+ }
+ qv.Set(grantType, grant.JWT)
+ qv.Set(clientID, authParameters.ClientID)
+ qv.Set("client_secret", clientSecret)
+ qv.Set("assertion", userAssertion)
+ qv.Set(clientInfo, clientInfoVal)
+ qv.Set("requested_token_use", "on_behalf_of")
+ addScopeQueryParam(qv, authParameters)
+
+ return c.doTokenResp(ctx, authParameters, qv)
+}
+
+func (c Client) FromUserAssertionClientCertificate(ctx context.Context, authParameters authority.AuthParams, userAssertion string, assertion string) (TokenResponse, error) {
+ qv := url.Values{}
+ if err := addClaims(qv, authParameters); err != nil {
+ return TokenResponse{}, err
+ }
+ qv.Set(grantType, grant.JWT)
+ qv.Set("client_assertion_type", grant.ClientAssertion)
+ qv.Set("client_assertion", assertion)
+ qv.Set(clientID, authParameters.ClientID)
+ qv.Set("assertion", userAssertion)
+ qv.Set(clientInfo, clientInfoVal)
+ qv.Set("requested_token_use", "on_behalf_of")
+ addScopeQueryParam(qv, authParameters)
+
+ return c.doTokenResp(ctx, authParameters, qv)
+}
+
+func (c Client) DeviceCodeResult(ctx context.Context, authParameters authority.AuthParams) (DeviceCodeResult, error) {
+ qv := url.Values{}
+ if err := addClaims(qv, authParameters); err != nil {
+ return DeviceCodeResult{}, err
+ }
+ qv.Set(clientID, authParameters.ClientID)
+ addScopeQueryParam(qv, authParameters)
+
+ endpoint := strings.Replace(authParameters.Endpoints.TokenEndpoint, "token", "devicecode", -1)
+
+ resp := DeviceCodeResponse{}
+ err := c.Comm.URLFormCall(ctx, endpoint, qv, &resp)
+ if err != nil {
+ return DeviceCodeResult{}, err
+ }
+
+ return resp.Convert(authParameters.ClientID, authParameters.Scopes), nil
+}
+
+func (c Client) FromDeviceCodeResult(ctx context.Context, authParameters authority.AuthParams, deviceCodeResult DeviceCodeResult) (TokenResponse, error) {
+ qv := url.Values{}
+ if err := addClaims(qv, authParameters); err != nil {
+ return TokenResponse{}, err
+ }
+ qv.Set(grantType, grant.DeviceCode)
+ qv.Set(deviceCode, deviceCodeResult.DeviceCode)
+ qv.Set(clientID, authParameters.ClientID)
+ qv.Set(clientInfo, clientInfoVal)
+ addScopeQueryParam(qv, authParameters)
+
+ return c.doTokenResp(ctx, authParameters, qv)
+}
+
+func (c Client) FromSamlGrant(ctx context.Context, authParameters authority.AuthParams, samlGrant wstrust.SamlTokenInfo) (TokenResponse, error) {
+ qv := url.Values{}
+ if err := addClaims(qv, authParameters); err != nil {
+ return TokenResponse{}, err
+ }
+ qv.Set(username, authParameters.Username)
+ qv.Set(password, authParameters.Password)
+ qv.Set(clientID, authParameters.ClientID)
+ qv.Set(clientInfo, clientInfoVal)
+ qv.Set("assertion", base64.StdEncoding.WithPadding(base64.StdPadding).EncodeToString([]byte(samlGrant.Assertion)))
+ addScopeQueryParam(qv, authParameters)
+
+ switch samlGrant.AssertionType {
+ case grant.SAMLV1:
+ qv.Set(grantType, grant.SAMLV1)
+ case grant.SAMLV2:
+ qv.Set(grantType, grant.SAMLV2)
+ default:
+ return TokenResponse{}, fmt.Errorf("GetAccessTokenFromSamlGrant returned unknown SAML assertion type: %q", samlGrant.AssertionType)
+ }
+
+ return c.doTokenResp(ctx, authParameters, qv)
+}
+
+func (c Client) doTokenResp(ctx context.Context, authParams authority.AuthParams, qv url.Values) (TokenResponse, error) {
+ resp := TokenResponse{}
+ err := c.Comm.URLFormCall(ctx, authParams.Endpoints.TokenEndpoint, qv, &resp)
+ if err != nil {
+ return resp, err
+ }
+ resp.ComputeScope(authParams)
+ if c.testing {
+ return resp, nil
+ }
+ return resp, resp.Validate()
+}
+
+// prepURLVals returns an url.Values that sets various key/values if we are doing secrets
+// or JWT assertions.
+func prepURLVals(ctx context.Context, cc *Credential, authParams authority.AuthParams) (url.Values, error) {
+ params := url.Values{}
+ if cc.Secret != "" {
+ params.Set("client_secret", cc.Secret)
+ return params, nil
+ }
+
+ jwt, err := cc.JWT(ctx, authParams)
+ if err != nil {
+ return nil, err
+ }
+ params.Set("client_assertion", jwt)
+ params.Set("client_assertion_type", grant.ClientAssertion)
+ return params, nil
+}
+
+// openid required to get an id token
+// offline_access required to get a refresh token
+// profile required to get the client_info field back
+var detectDefaultScopes = map[string]bool{
+ "openid": true,
+ "offline_access": true,
+ "profile": true,
+}
+
+var defaultScopes = []string{"openid", "offline_access", "profile"}
+
+func AppendDefaultScopes(authParameters authority.AuthParams) []string {
+ scopes := make([]string, 0, len(authParameters.Scopes)+len(defaultScopes))
+ for _, scope := range authParameters.Scopes {
+ s := strings.TrimSpace(scope)
+ if s == "" {
+ continue
+ }
+ if detectDefaultScopes[scope] {
+ continue
+ }
+ scopes = append(scopes, scope)
+ }
+ scopes = append(scopes, defaultScopes...)
+ return scopes
+}
+
+// addClaims adds client capabilities and claims from AuthParams to the given url.Values
+func addClaims(v url.Values, ap authority.AuthParams) error {
+ claims, err := ap.MergeCapabilitiesAndClaims()
+ if err == nil && claims != "" {
+ v.Set("claims", claims)
+ }
+ return err
+}
+
+func addScopeQueryParam(queryParams url.Values, authParameters authority.AuthParams) {
+ scopes := AppendDefaultScopes(authParameters)
+ queryParams.Set("scope", strings.Join(scopes, " "))
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/apptype_string.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/apptype_string.go
new file mode 100644
index 000000000..3bec4a67c
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/apptype_string.go
@@ -0,0 +1,25 @@
+// Code generated by "stringer -type=AppType"; DO NOT EDIT.
+
+package accesstokens
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[ATUnknown-0]
+ _ = x[ATPublic-1]
+ _ = x[ATConfidential-2]
+}
+
+const _AppType_name = "ATUnknownATPublicATConfidential"
+
+var _AppType_index = [...]uint8{0, 9, 17, 31}
+
+func (i AppType) String() string {
+ if i < 0 || i >= AppType(len(_AppType_index)-1) {
+ return "AppType(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _AppType_name[_AppType_index[i]:_AppType_index[i+1]]
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/tokens.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/tokens.go
new file mode 100644
index 000000000..3dd61d5b5
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/tokens.go
@@ -0,0 +1,338 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package accesstokens
+
+import (
+ "bytes"
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "reflect"
+ "strings"
+ "time"
+
+ internalTime "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared"
+)
+
+// IDToken consists of all the information used to validate a user.
+// https://docs.microsoft.com/azure/active-directory/develop/id-tokens .
+type IDToken struct {
+ PreferredUsername string `json:"preferred_username,omitempty"`
+ GivenName string `json:"given_name,omitempty"`
+ FamilyName string `json:"family_name,omitempty"`
+ MiddleName string `json:"middle_name,omitempty"`
+ Name string `json:"name,omitempty"`
+ Oid string `json:"oid,omitempty"`
+ TenantID string `json:"tid,omitempty"`
+ Subject string `json:"sub,omitempty"`
+ UPN string `json:"upn,omitempty"`
+ Email string `json:"email,omitempty"`
+ AlternativeID string `json:"alternative_id,omitempty"`
+ Issuer string `json:"iss,omitempty"`
+ Audience string `json:"aud,omitempty"`
+ ExpirationTime int64 `json:"exp,omitempty"`
+ IssuedAt int64 `json:"iat,omitempty"`
+ NotBefore int64 `json:"nbf,omitempty"`
+ RawToken string
+
+ AdditionalFields map[string]interface{}
+}
+
+var null = []byte("null")
+
+// UnmarshalJSON implements json.Unmarshaler.
+func (i *IDToken) UnmarshalJSON(b []byte) error {
+ if bytes.Equal(null, b) {
+ return nil
+ }
+
+ // Because we have a custom unmarshaler, you
+ // cannot directly call json.Unmarshal here. If you do, it will call this function
+ // recursively until reach our recursion limit. We have to create a new type
+ // that doesn't have this method in order to use json.Unmarshal.
+ type idToken2 IDToken
+
+ jwt := strings.Trim(string(b), `"`)
+ jwtArr := strings.Split(jwt, ".")
+ if len(jwtArr) < 2 {
+ return errors.New("IDToken returned from server is invalid")
+ }
+
+ jwtPart := jwtArr[1]
+ jwtDecoded, err := decodeJWT(jwtPart)
+ if err != nil {
+ return fmt.Errorf("unable to unmarshal IDToken, problem decoding JWT: %w", err)
+ }
+
+ token := idToken2{}
+ err = json.Unmarshal(jwtDecoded, &token)
+ if err != nil {
+ return fmt.Errorf("unable to unmarshal IDToken: %w", err)
+ }
+ token.RawToken = jwt
+
+ *i = IDToken(token)
+ return nil
+}
+
+// IsZero indicates if the IDToken is the zero value.
+func (i IDToken) IsZero() bool {
+ v := reflect.ValueOf(i)
+ for i := 0; i < v.NumField(); i++ {
+ field := v.Field(i)
+ if !field.IsZero() {
+ switch field.Kind() {
+ case reflect.Map, reflect.Slice:
+ if field.Len() == 0 {
+ continue
+ }
+ }
+ return false
+ }
+ }
+ return true
+}
+
+// LocalAccountID extracts an account's local account ID from an ID token.
+func (i IDToken) LocalAccountID() string {
+ if i.Oid != "" {
+ return i.Oid
+ }
+ return i.Subject
+}
+
+// jwtDecoder is provided to allow tests to provide their own.
+var jwtDecoder = decodeJWT
+
+// ClientInfo is used to create a Home Account ID for an account.
+type ClientInfo struct {
+ UID string `json:"uid"`
+ UTID string `json:"utid"`
+
+ AdditionalFields map[string]interface{}
+}
+
+// UnmarshalJSON implements json.Unmarshaler.s
+func (c *ClientInfo) UnmarshalJSON(b []byte) error {
+ s := strings.Trim(string(b), `"`)
+ // Client info may be empty in some flows, e.g. certificate exchange.
+ if len(s) == 0 {
+ return nil
+ }
+
+ // Because we have a custom unmarshaler, you
+ // cannot directly call json.Unmarshal here. If you do, it will call this function
+ // recursively until reach our recursion limit. We have to create a new type
+ // that doesn't have this method in order to use json.Unmarshal.
+ type clientInfo2 ClientInfo
+
+ raw, err := jwtDecoder(s)
+ if err != nil {
+ return fmt.Errorf("TokenResponse client_info field had JWT decode error: %w", err)
+ }
+
+ var c2 clientInfo2
+
+ err = json.Unmarshal(raw, &c2)
+ if err != nil {
+ return fmt.Errorf("was unable to unmarshal decoded JWT in TokenRespone to ClientInfo: %w", err)
+ }
+
+ *c = ClientInfo(c2)
+ return nil
+}
+
+// Scopes represents scopes in a TokenResponse.
+type Scopes struct {
+ Slice []string
+}
+
+// UnmarshalJSON implements json.Unmarshal.
+func (s *Scopes) UnmarshalJSON(b []byte) error {
+ str := strings.Trim(string(b), `"`)
+ if len(str) == 0 {
+ return nil
+ }
+ sl := strings.Split(str, " ")
+ s.Slice = sl
+ return nil
+}
+
+// TokenResponse is the information that is returned from a token endpoint during a token acquisition flow.
+type TokenResponse struct {
+ authority.OAuthResponseBase
+
+ AccessToken string `json:"access_token"`
+ RefreshToken string `json:"refresh_token"`
+
+ FamilyID string `json:"foci"`
+ IDToken IDToken `json:"id_token"`
+ ClientInfo ClientInfo `json:"client_info"`
+ ExpiresOn internalTime.DurationTime `json:"expires_in"`
+ ExtExpiresOn internalTime.DurationTime `json:"ext_expires_in"`
+ GrantedScopes Scopes `json:"scope"`
+ DeclinedScopes []string // This is derived
+
+ AdditionalFields map[string]interface{}
+
+ scopesComputed bool
+}
+
+// ComputeScope computes the final scopes based on what was granted by the server and
+// what our AuthParams were from the authority server. Per OAuth spec, if no scopes are returned, the response should be treated as if all scopes were granted
+// This behavior can be observed in client assertion flows, but can happen at any time, this check ensures we treat
+// those special responses properly Link to spec: https://tools.ietf.org/html/rfc6749#section-3.3
+func (tr *TokenResponse) ComputeScope(authParams authority.AuthParams) {
+ if len(tr.GrantedScopes.Slice) == 0 {
+ tr.GrantedScopes = Scopes{Slice: authParams.Scopes}
+ } else {
+ tr.DeclinedScopes = findDeclinedScopes(authParams.Scopes, tr.GrantedScopes.Slice)
+ }
+ tr.scopesComputed = true
+}
+
+// HomeAccountID uniquely identifies the authenticated account, if any. It's "" when the token is an app token.
+func (tr *TokenResponse) HomeAccountID() string {
+ id := tr.IDToken.Subject
+ if uid := tr.ClientInfo.UID; uid != "" {
+ utid := tr.ClientInfo.UTID
+ if utid == "" {
+ utid = uid
+ }
+ id = fmt.Sprintf("%s.%s", uid, utid)
+ }
+ return id
+}
+
+// Validate validates the TokenResponse has basic valid values. It must be called
+// after ComputeScopes() is called.
+func (tr *TokenResponse) Validate() error {
+ if tr.Error != "" {
+ return fmt.Errorf("%s: %s", tr.Error, tr.ErrorDescription)
+ }
+
+ if tr.AccessToken == "" {
+ return errors.New("response is missing access_token")
+ }
+
+ if !tr.scopesComputed {
+ return fmt.Errorf("TokenResponse hasn't had ScopesComputed() called")
+ }
+ return nil
+}
+
+func (tr *TokenResponse) CacheKey(authParams authority.AuthParams) string {
+ if authParams.AuthorizationType == authority.ATOnBehalfOf {
+ return authParams.AssertionHash()
+ }
+ if authParams.AuthorizationType == authority.ATClientCredentials {
+ return authParams.AppKey()
+ }
+ if authParams.IsConfidentialClient || authParams.AuthorizationType == authority.ATRefreshToken {
+ return tr.HomeAccountID()
+ }
+ return ""
+}
+
+func findDeclinedScopes(requestedScopes []string, grantedScopes []string) []string {
+ declined := []string{}
+ grantedMap := map[string]bool{}
+ for _, s := range grantedScopes {
+ grantedMap[strings.ToLower(s)] = true
+ }
+ // Comparing the requested scopes with the granted scopes to see if there are any scopes that have been declined.
+ for _, r := range requestedScopes {
+ if !grantedMap[strings.ToLower(r)] {
+ declined = append(declined, r)
+ }
+ }
+ return declined
+}
+
+// decodeJWT decodes a JWT and converts it to a byte array representing a JSON object
+// JWT has headers and payload base64url encoded without padding
+// https://tools.ietf.org/html/rfc7519#section-3 and
+// https://tools.ietf.org/html/rfc7515#section-2
+func decodeJWT(data string) ([]byte, error) {
+ // https://tools.ietf.org/html/rfc7515#appendix-C
+ return base64.RawURLEncoding.DecodeString(data)
+}
+
+// RefreshToken is the JSON representation of a MSAL refresh token for encoding to storage.
+type RefreshToken struct {
+ HomeAccountID string `json:"home_account_id,omitempty"`
+ Environment string `json:"environment,omitempty"`
+ CredentialType string `json:"credential_type,omitempty"`
+ ClientID string `json:"client_id,omitempty"`
+ FamilyID string `json:"family_id,omitempty"`
+ Secret string `json:"secret,omitempty"`
+ Realm string `json:"realm,omitempty"`
+ Target string `json:"target,omitempty"`
+ UserAssertionHash string `json:"user_assertion_hash,omitempty"`
+
+ AdditionalFields map[string]interface{}
+}
+
+// NewRefreshToken is the constructor for RefreshToken.
+func NewRefreshToken(homeID, env, clientID, refreshToken, familyID string) RefreshToken {
+ return RefreshToken{
+ HomeAccountID: homeID,
+ Environment: env,
+ CredentialType: "RefreshToken",
+ ClientID: clientID,
+ FamilyID: familyID,
+ Secret: refreshToken,
+ }
+}
+
+// Key outputs the key that can be used to uniquely look up this entry in a map.
+func (rt RefreshToken) Key() string {
+ var fourth = rt.FamilyID
+ if fourth == "" {
+ fourth = rt.ClientID
+ }
+
+ key := strings.Join(
+ []string{rt.HomeAccountID, rt.Environment, rt.CredentialType, fourth},
+ shared.CacheKeySeparator,
+ )
+ return strings.ToLower(key)
+}
+
+func (rt RefreshToken) GetSecret() string {
+ return rt.Secret
+}
+
+// DeviceCodeResult stores the response from the STS device code endpoint.
+type DeviceCodeResult struct {
+ // UserCode is the code the user needs to provide when authentication at the verification URI.
+ UserCode string
+ // DeviceCode is the code used in the access token request.
+ DeviceCode string
+ // VerificationURL is the the URL where user can authenticate.
+ VerificationURL string
+ // ExpiresOn is the expiration time of device code in seconds.
+ ExpiresOn time.Time
+ // Interval is the interval at which the STS should be polled at.
+ Interval int
+ // Message is the message which should be displayed to the user.
+ Message string
+ // ClientID is the UUID issued by the authorization server for your application.
+ ClientID string
+ // Scopes is the OpenID scopes used to request access a protected API.
+ Scopes []string
+}
+
+// NewDeviceCodeResult creates a DeviceCodeResult instance.
+func NewDeviceCodeResult(userCode, deviceCode, verificationURL string, expiresOn time.Time, interval int, message, clientID string, scopes []string) DeviceCodeResult {
+ return DeviceCodeResult{userCode, deviceCode, verificationURL, expiresOn, interval, message, clientID, scopes}
+}
+
+func (dcr DeviceCodeResult) String() string {
+ return fmt.Sprintf("UserCode: (%v)\nDeviceCode: (%v)\nURL: (%v)\nMessage: (%v)\n", dcr.UserCode, dcr.DeviceCode, dcr.VerificationURL, dcr.Message)
+
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go
new file mode 100644
index 000000000..7b2ccb4f5
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go
@@ -0,0 +1,552 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package authority
+
+import (
+ "context"
+ "crypto/sha256"
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "net/url"
+ "os"
+ "path"
+ "strings"
+ "time"
+
+ "github.com/google/uuid"
+)
+
+const (
+ authorizationEndpoint = "https://%v/%v/oauth2/v2.0/authorize"
+ instanceDiscoveryEndpoint = "https://%v/common/discovery/instance"
+ tenantDiscoveryEndpointWithRegion = "https://%s.%s/%s/v2.0/.well-known/openid-configuration"
+ regionName = "REGION_NAME"
+ defaultAPIVersion = "2021-10-01"
+ imdsEndpoint = "http://169.254.169.254/metadata/instance/compute/location?format=text&api-version=" + defaultAPIVersion
+ autoDetectRegion = "TryAutoDetect"
+)
+
+// These are various hosts that host AAD Instance discovery endpoints.
+const (
+ defaultHost = "login.microsoftonline.com"
+ loginMicrosoft = "login.microsoft.com"
+ loginWindows = "login.windows.net"
+ loginSTSWindows = "sts.windows.net"
+ loginMicrosoftOnline = defaultHost
+)
+
+// jsonCaller is an interface that allows us to mock the JSONCall method.
+type jsonCaller interface {
+ JSONCall(ctx context.Context, endpoint string, headers http.Header, qv url.Values, body, resp interface{}) error
+}
+
+var aadTrustedHostList = map[string]bool{
+ "login.windows.net": true, // Microsoft Azure Worldwide - Used in validation scenarios where host is not this list
+ "login.chinacloudapi.cn": true, // Microsoft Azure China
+ "login.microsoftonline.de": true, // Microsoft Azure Blackforest
+ "login-us.microsoftonline.com": true, // Microsoft Azure US Government - Legacy
+ "login.microsoftonline.us": true, // Microsoft Azure US Government
+ "login.microsoftonline.com": true, // Microsoft Azure Worldwide
+ "login.cloudgovapi.us": true, // Microsoft Azure US Government
+}
+
+// TrustedHost checks if an AAD host is trusted/valid.
+func TrustedHost(host string) bool {
+ if _, ok := aadTrustedHostList[host]; ok {
+ return true
+ }
+ return false
+}
+
+// OAuthResponseBase is the base JSON return message for an OAuth call.
+// This is embedded in other calls to get the base fields from every response.
+type OAuthResponseBase struct {
+ Error string `json:"error"`
+ SubError string `json:"suberror"`
+ ErrorDescription string `json:"error_description"`
+ ErrorCodes []int `json:"error_codes"`
+ CorrelationID string `json:"correlation_id"`
+ Claims string `json:"claims"`
+}
+
+// TenantDiscoveryResponse is the tenant endpoints from the OpenID configuration endpoint.
+type TenantDiscoveryResponse struct {
+ OAuthResponseBase
+
+ AuthorizationEndpoint string `json:"authorization_endpoint"`
+ TokenEndpoint string `json:"token_endpoint"`
+ Issuer string `json:"issuer"`
+
+ AdditionalFields map[string]interface{}
+}
+
+// Validate validates that the response had the correct values required.
+func (r *TenantDiscoveryResponse) Validate() error {
+ switch "" {
+ case r.AuthorizationEndpoint:
+ return errors.New("TenantDiscoveryResponse: authorize endpoint was not found in the openid configuration")
+ case r.TokenEndpoint:
+ return errors.New("TenantDiscoveryResponse: token endpoint was not found in the openid configuration")
+ case r.Issuer:
+ return errors.New("TenantDiscoveryResponse: issuer was not found in the openid configuration")
+ }
+ return nil
+}
+
+type InstanceDiscoveryMetadata struct {
+ PreferredNetwork string `json:"preferred_network"`
+ PreferredCache string `json:"preferred_cache"`
+ Aliases []string `json:"aliases"`
+
+ AdditionalFields map[string]interface{}
+}
+
+type InstanceDiscoveryResponse struct {
+ TenantDiscoveryEndpoint string `json:"tenant_discovery_endpoint"`
+ Metadata []InstanceDiscoveryMetadata `json:"metadata"`
+
+ AdditionalFields map[string]interface{}
+}
+
+//go:generate stringer -type=AuthorizeType
+
+// AuthorizeType represents the type of token flow.
+type AuthorizeType int
+
+// These are all the types of token flows.
+const (
+ ATUnknown AuthorizeType = iota
+ ATUsernamePassword
+ ATWindowsIntegrated
+ ATAuthCode
+ ATInteractive
+ ATClientCredentials
+ ATDeviceCode
+ ATRefreshToken
+ AccountByID
+ ATOnBehalfOf
+)
+
+// These are all authority types
+const (
+ AAD = "MSSTS"
+ ADFS = "ADFS"
+)
+
+// AuthParams represents the parameters used for authorization for token acquisition.
+type AuthParams struct {
+ AuthorityInfo Info
+ CorrelationID string
+ Endpoints Endpoints
+ ClientID string
+ // Redirecturi is used for auth flows that specify a redirect URI (e.g. local server for interactive auth flow).
+ Redirecturi string
+ HomeAccountID string
+ // Username is the user-name portion for username/password auth flow.
+ Username string
+ // Password is the password portion for username/password auth flow.
+ Password string
+ // Scopes is the list of scopes the user consents to.
+ Scopes []string
+ // AuthorizationType specifies the auth flow being used.
+ AuthorizationType AuthorizeType
+ // State is a random value used to prevent cross-site request forgery attacks.
+ State string
+ // CodeChallenge is derived from a code verifier and is sent in the auth request.
+ CodeChallenge string
+ // CodeChallengeMethod describes the method used to create the CodeChallenge.
+ CodeChallengeMethod string
+ // Prompt specifies the user prompt type during interactive auth.
+ Prompt string
+ // IsConfidentialClient specifies if it is a confidential client.
+ IsConfidentialClient bool
+ // SendX5C specifies if x5c claim(public key of the certificate) should be sent to STS.
+ SendX5C bool
+ // UserAssertion is the access token used to acquire token on behalf of user
+ UserAssertion string
+ // Capabilities the client will include with each token request, for example "CP1".
+ // Call [NewClientCapabilities] to construct a value for this field.
+ Capabilities ClientCapabilities
+ // Claims required for an access token to satisfy a conditional access policy
+ Claims string
+ // KnownAuthorityHosts don't require metadata discovery because they're known to the user
+ KnownAuthorityHosts []string
+ // LoginHint is a username with which to pre-populate account selection during interactive auth
+ LoginHint string
+ // DomainHint is a directive that can be used to accelerate the user to their federated IdP sign-in page
+ DomainHint string
+}
+
+// NewAuthParams creates an authorization parameters object.
+func NewAuthParams(clientID string, authorityInfo Info) AuthParams {
+ return AuthParams{
+ ClientID: clientID,
+ AuthorityInfo: authorityInfo,
+ CorrelationID: uuid.New().String(),
+ }
+}
+
+// WithTenant returns a copy of the AuthParams having the specified tenant ID. If the given
+// ID is empty, the copy is identical to the original. This function returns an error in
+// several cases:
+// - ID isn't specific (for example, it's "common")
+// - ID is non-empty and the authority doesn't support tenants (for example, it's an ADFS authority)
+// - the client is configured to authenticate only Microsoft accounts via the "consumers" endpoint
+// - the resulting authority URL is invalid
+func (p AuthParams) WithTenant(ID string) (AuthParams, error) {
+ switch ID {
+ case "", p.AuthorityInfo.Tenant:
+ // keep the default tenant because the caller didn't override it
+ return p, nil
+ case "common", "consumers", "organizations":
+ if p.AuthorityInfo.AuthorityType == AAD {
+ return p, fmt.Errorf(`tenant ID must be a specific tenant, not "%s"`, ID)
+ }
+ // else we'll return a better error below
+ }
+ if p.AuthorityInfo.AuthorityType != AAD {
+ return p, errors.New("the authority doesn't support tenants")
+ }
+ if p.AuthorityInfo.Tenant == "consumers" {
+ return p, errors.New(`client is configured to authenticate only personal Microsoft accounts, via the "consumers" endpoint`)
+ }
+ authority := "https://" + path.Join(p.AuthorityInfo.Host, ID)
+ info, err := NewInfoFromAuthorityURI(authority, p.AuthorityInfo.ValidateAuthority, p.AuthorityInfo.InstanceDiscoveryDisabled)
+ if err == nil {
+ info.Region = p.AuthorityInfo.Region
+ p.AuthorityInfo = info
+ }
+ return p, err
+}
+
+// MergeCapabilitiesAndClaims combines client capabilities and challenge claims into a value suitable for an authentication request's "claims" parameter.
+func (p AuthParams) MergeCapabilitiesAndClaims() (string, error) {
+ claims := p.Claims
+ if len(p.Capabilities.asMap) > 0 {
+ if claims == "" {
+ // without claims the result is simply the capabilities
+ return p.Capabilities.asJSON, nil
+ }
+ // Otherwise, merge claims and capabilties into a single JSON object.
+ // We handle the claims challenge as a map because we don't know its structure.
+ var challenge map[string]any
+ if err := json.Unmarshal([]byte(claims), &challenge); err != nil {
+ return "", fmt.Errorf(`claims must be JSON. Are they base64 encoded? json.Unmarshal returned "%v"`, err)
+ }
+ if err := merge(p.Capabilities.asMap, challenge); err != nil {
+ return "", err
+ }
+ b, err := json.Marshal(challenge)
+ if err != nil {
+ return "", err
+ }
+ claims = string(b)
+ }
+ return claims, nil
+}
+
+// merges a into b without overwriting b's values. Returns an error when a and b share a key for which either has a non-object value.
+func merge(a, b map[string]any) error {
+ for k, av := range a {
+ if bv, ok := b[k]; !ok {
+ // b doesn't contain this key => simply set it to a's value
+ b[k] = av
+ } else {
+ // b does contain this key => recursively merge a[k] into b[k], provided both are maps. If a[k] or b[k] isn't
+ // a map, return an error because merging would overwrite some value in b. Errors shouldn't occur in practice
+ // because the challenge will be from AAD, which knows the capabilities format.
+ if A, ok := av.(map[string]any); ok {
+ if B, ok := bv.(map[string]any); ok {
+ return merge(A, B)
+ } else {
+ // b[k] isn't a map
+ return errors.New("challenge claims conflict with client capabilities")
+ }
+ } else {
+ // a[k] isn't a map
+ return errors.New("challenge claims conflict with client capabilities")
+ }
+ }
+ }
+ return nil
+}
+
+// ClientCapabilities stores capabilities in the formats used by AuthParams.MergeCapabilitiesAndClaims.
+// [NewClientCapabilities] precomputes these representations because capabilities are static for the
+// lifetime of a client and are included with every authentication request i.e., these computations
+// always have the same result and would otherwise have to be repeated for every request.
+type ClientCapabilities struct {
+ // asJSON is for the common case: adding the capabilities to an auth request with no challenge claims
+ asJSON string
+ // asMap is for merging the capabilities with challenge claims
+ asMap map[string]any
+}
+
+func NewClientCapabilities(capabilities []string) (ClientCapabilities, error) {
+ c := ClientCapabilities{}
+ var err error
+ if len(capabilities) > 0 {
+ cpbs := make([]string, len(capabilities))
+ for i := 0; i < len(cpbs); i++ {
+ cpbs[i] = fmt.Sprintf(`"%s"`, capabilities[i])
+ }
+ c.asJSON = fmt.Sprintf(`{"access_token":{"xms_cc":{"values":[%s]}}}`, strings.Join(cpbs, ","))
+ // note our JSON is valid but we can't stop users breaking it with garbage like "}"
+ err = json.Unmarshal([]byte(c.asJSON), &c.asMap)
+ }
+ return c, err
+}
+
+// Info consists of information about the authority.
+type Info struct {
+ Host string
+ CanonicalAuthorityURI string
+ AuthorityType string
+ UserRealmURIPrefix string
+ ValidateAuthority bool
+ Tenant string
+ Region string
+ InstanceDiscoveryDisabled bool
+}
+
+func firstPathSegment(u *url.URL) (string, error) {
+ pathParts := strings.Split(u.EscapedPath(), "/")
+ if len(pathParts) >= 2 {
+ return pathParts[1], nil
+ }
+
+ return "", errors.New(`authority must be an https URL such as "https://login.microsoftonline.com/"`)
+}
+
+// NewInfoFromAuthorityURI creates an AuthorityInfo instance from the authority URL provided.
+func NewInfoFromAuthorityURI(authority string, validateAuthority bool, instanceDiscoveryDisabled bool) (Info, error) {
+ u, err := url.Parse(strings.ToLower(authority))
+ if err != nil || u.Scheme != "https" {
+ return Info{}, errors.New(`authority must be an https URL such as "https://login.microsoftonline.com/"`)
+ }
+
+ tenant, err := firstPathSegment(u)
+ if err != nil {
+ return Info{}, err
+ }
+ authorityType := AAD
+ if tenant == "adfs" {
+ authorityType = ADFS
+ }
+
+ // u.Host includes the port, if any, which is required for private cloud deployments
+ return Info{
+ Host: u.Host,
+ CanonicalAuthorityURI: fmt.Sprintf("https://%v/%v/", u.Host, tenant),
+ AuthorityType: authorityType,
+ UserRealmURIPrefix: fmt.Sprintf("https://%v/common/userrealm/", u.Hostname()),
+ ValidateAuthority: validateAuthority,
+ Tenant: tenant,
+ InstanceDiscoveryDisabled: instanceDiscoveryDisabled,
+ }, nil
+}
+
+// Endpoints consists of the endpoints from the tenant discovery response.
+type Endpoints struct {
+ AuthorizationEndpoint string
+ TokenEndpoint string
+ selfSignedJwtAudience string
+ authorityHost string
+}
+
+// NewEndpoints creates an Endpoints object.
+func NewEndpoints(authorizationEndpoint string, tokenEndpoint string, selfSignedJwtAudience string, authorityHost string) Endpoints {
+ return Endpoints{authorizationEndpoint, tokenEndpoint, selfSignedJwtAudience, authorityHost}
+}
+
+// UserRealmAccountType refers to the type of user realm.
+type UserRealmAccountType string
+
+// These are the different types of user realms.
+const (
+ Unknown UserRealmAccountType = ""
+ Federated UserRealmAccountType = "Federated"
+ Managed UserRealmAccountType = "Managed"
+)
+
+// UserRealm is used for the username password request to determine user type
+type UserRealm struct {
+ AccountType UserRealmAccountType `json:"account_type"`
+ DomainName string `json:"domain_name"`
+ CloudInstanceName string `json:"cloud_instance_name"`
+ CloudAudienceURN string `json:"cloud_audience_urn"`
+
+ // required if accountType is Federated
+ FederationProtocol string `json:"federation_protocol"`
+ FederationMetadataURL string `json:"federation_metadata_url"`
+
+ AdditionalFields map[string]interface{}
+}
+
+func (u UserRealm) validate() error {
+ switch "" {
+ case string(u.AccountType):
+ return errors.New("the account type (Federated or Managed) is missing")
+ case u.DomainName:
+ return errors.New("domain name of user realm is missing")
+ case u.CloudInstanceName:
+ return errors.New("cloud instance name of user realm is missing")
+ case u.CloudAudienceURN:
+ return errors.New("cloud Instance URN is missing")
+ }
+
+ if u.AccountType == Federated {
+ switch "" {
+ case u.FederationProtocol:
+ return errors.New("federation protocol of user realm is missing")
+ case u.FederationMetadataURL:
+ return errors.New("federation metadata URL of user realm is missing")
+ }
+ }
+ return nil
+}
+
+// Client represents the REST calls to authority backends.
+type Client struct {
+ // Comm provides the HTTP transport client.
+ Comm jsonCaller // *comm.Client
+}
+
+func (c Client) UserRealm(ctx context.Context, authParams AuthParams) (UserRealm, error) {
+ endpoint := fmt.Sprintf("https://%s/common/UserRealm/%s", authParams.Endpoints.authorityHost, url.PathEscape(authParams.Username))
+ qv := url.Values{
+ "api-version": []string{"1.0"},
+ }
+
+ resp := UserRealm{}
+ err := c.Comm.JSONCall(
+ ctx,
+ endpoint,
+ http.Header{"client-request-id": []string{authParams.CorrelationID}},
+ qv,
+ nil,
+ &resp,
+ )
+ if err != nil {
+ return resp, err
+ }
+
+ return resp, resp.validate()
+}
+
+func (c Client) GetTenantDiscoveryResponse(ctx context.Context, openIDConfigurationEndpoint string) (TenantDiscoveryResponse, error) {
+ resp := TenantDiscoveryResponse{}
+ err := c.Comm.JSONCall(
+ ctx,
+ openIDConfigurationEndpoint,
+ http.Header{},
+ nil,
+ nil,
+ &resp,
+ )
+
+ return resp, err
+}
+
+// AADInstanceDiscovery attempts to discover a tenant endpoint (used in OIDC auth with an authorization endpoint).
+// This is done by AAD which allows for aliasing of tenants (windows.sts.net is the same as login.windows.com).
+func (c Client) AADInstanceDiscovery(ctx context.Context, authorityInfo Info) (InstanceDiscoveryResponse, error) {
+ region := ""
+ var err error
+ resp := InstanceDiscoveryResponse{}
+ if authorityInfo.Region != "" && authorityInfo.Region != autoDetectRegion {
+ region = authorityInfo.Region
+ } else if authorityInfo.Region == autoDetectRegion {
+ region = detectRegion(ctx)
+ }
+ if region != "" {
+ environment := authorityInfo.Host
+ switch environment {
+ case loginMicrosoft, loginWindows, loginSTSWindows, defaultHost:
+ environment = loginMicrosoft
+ }
+
+ resp.TenantDiscoveryEndpoint = fmt.Sprintf(tenantDiscoveryEndpointWithRegion, region, environment, authorityInfo.Tenant)
+ metadata := InstanceDiscoveryMetadata{
+ PreferredNetwork: fmt.Sprintf("%v.%v", region, authorityInfo.Host),
+ PreferredCache: authorityInfo.Host,
+ Aliases: []string{fmt.Sprintf("%v.%v", region, authorityInfo.Host), authorityInfo.Host},
+ }
+ resp.Metadata = []InstanceDiscoveryMetadata{metadata}
+ } else {
+ qv := url.Values{}
+ qv.Set("api-version", "1.1")
+ qv.Set("authorization_endpoint", fmt.Sprintf(authorizationEndpoint, authorityInfo.Host, authorityInfo.Tenant))
+
+ discoveryHost := defaultHost
+ if TrustedHost(authorityInfo.Host) {
+ discoveryHost = authorityInfo.Host
+ }
+
+ endpoint := fmt.Sprintf(instanceDiscoveryEndpoint, discoveryHost)
+ err = c.Comm.JSONCall(ctx, endpoint, http.Header{}, qv, nil, &resp)
+ }
+ return resp, err
+}
+
+func detectRegion(ctx context.Context) string {
+ region := os.Getenv(regionName)
+ if region != "" {
+ region = strings.ReplaceAll(region, " ", "")
+ return strings.ToLower(region)
+ }
+ // HTTP call to IMDS endpoint to get region
+ // Refer : https://identitydivision.visualstudio.com/DevEx/_git/AuthLibrariesApiReview?path=%2FPinAuthToRegion%2FAAD%20SDK%20Proposal%20to%20Pin%20Auth%20to%20region.md&_a=preview&version=GBdev
+ // Set a 2 second timeout for this http client which only does calls to IMDS endpoint
+ client := http.Client{
+ Timeout: time.Duration(2 * time.Second),
+ }
+ req, _ := http.NewRequest("GET", imdsEndpoint, nil)
+ req.Header.Set("Metadata", "true")
+ resp, err := client.Do(req)
+ // If the request times out or there is an error, it is retried once
+ if err != nil || resp.StatusCode != 200 {
+ resp, err = client.Do(req)
+ if err != nil || resp.StatusCode != 200 {
+ return ""
+ }
+ }
+ defer resp.Body.Close()
+ response, err := io.ReadAll(resp.Body)
+ if err != nil {
+ return ""
+ }
+ return string(response)
+}
+
+func (a *AuthParams) CacheKey(isAppCache bool) string {
+ if a.AuthorizationType == ATOnBehalfOf {
+ return a.AssertionHash()
+ }
+ if a.AuthorizationType == ATClientCredentials || isAppCache {
+ return a.AppKey()
+ }
+ if a.AuthorizationType == ATRefreshToken || a.AuthorizationType == AccountByID {
+ return a.HomeAccountID
+ }
+ return ""
+}
+func (a *AuthParams) AssertionHash() string {
+ hasher := sha256.New()
+ // Per documentation this never returns an error : https://pkg.go.dev/hash#pkg-types
+ _, _ = hasher.Write([]byte(a.UserAssertion))
+ sha := base64.URLEncoding.EncodeToString(hasher.Sum(nil))
+ return sha
+}
+
+func (a *AuthParams) AppKey() string {
+ if a.AuthorityInfo.Tenant != "" {
+ return fmt.Sprintf("%s_%s_AppTokenCache", a.ClientID, a.AuthorityInfo.Tenant)
+ }
+ return fmt.Sprintf("%s__AppTokenCache", a.ClientID)
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authorizetype_string.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authorizetype_string.go
new file mode 100644
index 000000000..10039773b
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authorizetype_string.go
@@ -0,0 +1,30 @@
+// Code generated by "stringer -type=AuthorizeType"; DO NOT EDIT.
+
+package authority
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[ATUnknown-0]
+ _ = x[ATUsernamePassword-1]
+ _ = x[ATWindowsIntegrated-2]
+ _ = x[ATAuthCode-3]
+ _ = x[ATInteractive-4]
+ _ = x[ATClientCredentials-5]
+ _ = x[ATDeviceCode-6]
+ _ = x[ATRefreshToken-7]
+}
+
+const _AuthorizeType_name = "ATUnknownATUsernamePasswordATWindowsIntegratedATAuthCodeATInteractiveATClientCredentialsATDeviceCodeATRefreshToken"
+
+var _AuthorizeType_index = [...]uint8{0, 9, 27, 46, 56, 69, 88, 100, 114}
+
+func (i AuthorizeType) String() string {
+ if i < 0 || i >= AuthorizeType(len(_AuthorizeType_index)-1) {
+ return "AuthorizeType(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _AuthorizeType_name[_AuthorizeType_index[i]:_AuthorizeType_index[i+1]]
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go
new file mode 100644
index 000000000..7d9ec7cd3
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go
@@ -0,0 +1,320 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+// Package comm provides helpers for communicating with HTTP backends.
+package comm
+
+import (
+ "bytes"
+ "context"
+ "encoding/json"
+ "encoding/xml"
+ "fmt"
+ "io"
+ "net/http"
+ "net/url"
+ "reflect"
+ "runtime"
+ "strings"
+ "time"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
+ customJSON "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version"
+ "github.com/google/uuid"
+)
+
+// HTTPClient represents an HTTP client.
+// It's usually an *http.Client from the standard library.
+type HTTPClient interface {
+ // Do sends an HTTP request and returns an HTTP response.
+ Do(req *http.Request) (*http.Response, error)
+
+ // CloseIdleConnections closes any idle connections in a "keep-alive" state.
+ CloseIdleConnections()
+}
+
+// Client provides a wrapper to our *http.Client that handles compression and serialization needs.
+type Client struct {
+ client HTTPClient
+}
+
+// New returns a new Client object.
+func New(httpClient HTTPClient) *Client {
+ if httpClient == nil {
+ panic("http.Client cannot == nil")
+ }
+
+ return &Client{client: httpClient}
+}
+
+// JSONCall connects to the REST endpoint passing the HTTP query values, headers and JSON conversion
+// of body in the HTTP body. It automatically handles compression and decompression with gzip. The response is JSON
+// unmarshalled into resp. resp must be a pointer to a struct. If the body struct contains a field called
+// "AdditionalFields" we use a custom marshal/unmarshal engine.
+func (c *Client) JSONCall(ctx context.Context, endpoint string, headers http.Header, qv url.Values, body, resp interface{}) error {
+ if qv == nil {
+ qv = url.Values{}
+ }
+
+ v := reflect.ValueOf(resp)
+ if err := c.checkResp(v); err != nil {
+ return err
+ }
+
+ // Choose a JSON marshal/unmarshal depending on if we have AdditionalFields attribute.
+ var marshal = json.Marshal
+ var unmarshal = json.Unmarshal
+ if _, ok := v.Elem().Type().FieldByName("AdditionalFields"); ok {
+ marshal = customJSON.Marshal
+ unmarshal = customJSON.Unmarshal
+ }
+
+ u, err := url.Parse(endpoint)
+ if err != nil {
+ return fmt.Errorf("could not parse path URL(%s): %w", endpoint, err)
+ }
+ u.RawQuery = qv.Encode()
+
+ addStdHeaders(headers)
+
+ req := &http.Request{Method: http.MethodGet, URL: u, Header: headers}
+
+ if body != nil {
+ // Note: In case your wondering why we are not gzip encoding....
+ // I'm not sure if these various services support gzip on send.
+ headers.Add("Content-Type", "application/json; charset=utf-8")
+ data, err := marshal(body)
+ if err != nil {
+ return fmt.Errorf("bug: conn.Call(): could not marshal the body object: %w", err)
+ }
+ req.Body = io.NopCloser(bytes.NewBuffer(data))
+ req.Method = http.MethodPost
+ }
+
+ data, err := c.do(ctx, req)
+ if err != nil {
+ return err
+ }
+
+ if resp != nil {
+ if err := unmarshal(data, resp); err != nil {
+ return fmt.Errorf("json decode error: %w\njson message bytes were: %s", err, string(data))
+ }
+ }
+ return nil
+}
+
+// XMLCall connects to an endpoint and decodes the XML response into resp. This is used when
+// sending application/xml . If sending XML via SOAP, use SOAPCall().
+func (c *Client) XMLCall(ctx context.Context, endpoint string, headers http.Header, qv url.Values, resp interface{}) error {
+ if err := c.checkResp(reflect.ValueOf(resp)); err != nil {
+ return err
+ }
+
+ if qv == nil {
+ qv = url.Values{}
+ }
+
+ u, err := url.Parse(endpoint)
+ if err != nil {
+ return fmt.Errorf("could not parse path URL(%s): %w", endpoint, err)
+ }
+ u.RawQuery = qv.Encode()
+
+ headers.Set("Content-Type", "application/xml; charset=utf-8") // This was not set in he original Mex(), but...
+ addStdHeaders(headers)
+
+ return c.xmlCall(ctx, u, headers, "", resp)
+}
+
+// SOAPCall returns the SOAP message given an endpoint, action, body of the request and the response object to marshal into.
+func (c *Client) SOAPCall(ctx context.Context, endpoint, action string, headers http.Header, qv url.Values, body string, resp interface{}) error {
+ if body == "" {
+ return fmt.Errorf("cannot make a SOAP call with body set to empty string")
+ }
+
+ if err := c.checkResp(reflect.ValueOf(resp)); err != nil {
+ return err
+ }
+
+ if qv == nil {
+ qv = url.Values{}
+ }
+
+ u, err := url.Parse(endpoint)
+ if err != nil {
+ return fmt.Errorf("could not parse path URL(%s): %w", endpoint, err)
+ }
+ u.RawQuery = qv.Encode()
+
+ headers.Set("Content-Type", "application/soap+xml; charset=utf-8")
+ headers.Set("SOAPAction", action)
+ addStdHeaders(headers)
+
+ return c.xmlCall(ctx, u, headers, body, resp)
+}
+
+// xmlCall sends an XML in body and decodes into resp. This simply does the transport and relies on
+// an upper level call to set things such as SOAP parameters and Content-Type, if required.
+func (c *Client) xmlCall(ctx context.Context, u *url.URL, headers http.Header, body string, resp interface{}) error {
+ req := &http.Request{Method: http.MethodGet, URL: u, Header: headers}
+
+ if len(body) > 0 {
+ req.Method = http.MethodPost
+ req.Body = io.NopCloser(strings.NewReader(body))
+ }
+
+ data, err := c.do(ctx, req)
+ if err != nil {
+ return err
+ }
+
+ return xml.Unmarshal(data, resp)
+}
+
+// URLFormCall is used to make a call where we need to send application/x-www-form-urlencoded data
+// to the backend and receive JSON back. qv will be encoded into the request body.
+func (c *Client) URLFormCall(ctx context.Context, endpoint string, qv url.Values, resp interface{}) error {
+ if len(qv) == 0 {
+ return fmt.Errorf("URLFormCall() requires qv to have non-zero length")
+ }
+
+ if err := c.checkResp(reflect.ValueOf(resp)); err != nil {
+ return err
+ }
+
+ u, err := url.Parse(endpoint)
+ if err != nil {
+ return fmt.Errorf("could not parse path URL(%s): %w", endpoint, err)
+ }
+
+ headers := http.Header{}
+ headers.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
+ addStdHeaders(headers)
+
+ enc := qv.Encode()
+
+ req := &http.Request{
+ Method: http.MethodPost,
+ URL: u,
+ Header: headers,
+ ContentLength: int64(len(enc)),
+ Body: io.NopCloser(strings.NewReader(enc)),
+ GetBody: func() (io.ReadCloser, error) {
+ return io.NopCloser(strings.NewReader(enc)), nil
+ },
+ }
+
+ data, err := c.do(ctx, req)
+ if err != nil {
+ return err
+ }
+
+ v := reflect.ValueOf(resp)
+ if err := c.checkResp(v); err != nil {
+ return err
+ }
+
+ var unmarshal = json.Unmarshal
+ if _, ok := v.Elem().Type().FieldByName("AdditionalFields"); ok {
+ unmarshal = customJSON.Unmarshal
+ }
+ if resp != nil {
+ if err := unmarshal(data, resp); err != nil {
+ return fmt.Errorf("json decode error: %w\nraw message was: %s", err, string(data))
+ }
+ }
+ return nil
+}
+
+// do makes the HTTP call to the server and returns the contents of the body.
+func (c *Client) do(ctx context.Context, req *http.Request) ([]byte, error) {
+ if _, ok := ctx.Deadline(); !ok {
+ var cancel context.CancelFunc
+ ctx, cancel = context.WithTimeout(ctx, 30*time.Second)
+ defer cancel()
+ }
+ req = req.WithContext(ctx)
+
+ reply, err := c.client.Do(req)
+ if err != nil {
+ return nil, fmt.Errorf("server response error:\n %w", err)
+ }
+ defer reply.Body.Close()
+
+ data, err := c.readBody(reply)
+ if err != nil {
+ return nil, fmt.Errorf("could not read the body of an HTTP Response: %w", err)
+ }
+ reply.Body = io.NopCloser(bytes.NewBuffer(data))
+
+ // NOTE: This doesn't happen immediately after the call so that we can get an error message
+ // from the server and include it in our error.
+ switch reply.StatusCode {
+ case 200, 201:
+ default:
+ sd := strings.TrimSpace(string(data))
+ if sd != "" {
+ // We probably have the error in the body.
+ return nil, errors.CallErr{
+ Req: req,
+ Resp: reply,
+ Err: fmt.Errorf("http call(%s)(%s) error: reply status code was %d:\n%s", req.URL.String(), req.Method, reply.StatusCode, sd),
+ }
+ }
+ return nil, errors.CallErr{
+ Req: req,
+ Resp: reply,
+ Err: fmt.Errorf("http call(%s)(%s) error: reply status code was %d", req.URL.String(), req.Method, reply.StatusCode),
+ }
+ }
+
+ return data, nil
+}
+
+// checkResp checks a response object o make sure it is a pointer to a struct.
+func (c *Client) checkResp(v reflect.Value) error {
+ if v.Kind() != reflect.Ptr {
+ return fmt.Errorf("bug: resp argument must a *struct, was %T", v.Interface())
+ }
+ v = v.Elem()
+ if v.Kind() != reflect.Struct {
+ return fmt.Errorf("bug: resp argument must be a *struct, was %T", v.Interface())
+ }
+ return nil
+}
+
+// readBody reads the body out of an *http.Response. It supports gzip encoded responses.
+func (c *Client) readBody(resp *http.Response) ([]byte, error) {
+ var reader io.Reader = resp.Body
+ switch resp.Header.Get("Content-Encoding") {
+ case "":
+ // Do nothing
+ case "gzip":
+ reader = gzipDecompress(resp.Body)
+ default:
+ return nil, fmt.Errorf("bug: comm.Client.JSONCall(): content was send with unsupported content-encoding %s", resp.Header.Get("Content-Encoding"))
+ }
+ return io.ReadAll(reader)
+}
+
+var testID string
+
+// addStdHeaders adds the standard headers we use on all calls.
+func addStdHeaders(headers http.Header) http.Header {
+ headers.Set("Accept-Encoding", "gzip")
+ // So that I can have a static id for tests.
+ if testID != "" {
+ headers.Set("client-request-id", testID)
+ headers.Set("Return-Client-Request-Id", "false")
+ } else {
+ headers.Set("client-request-id", uuid.New().String())
+ headers.Set("Return-Client-Request-Id", "false")
+ }
+ headers.Set("x-client-sku", "MSAL.Go")
+ headers.Set("x-client-os", runtime.GOOS)
+ headers.Set("x-client-cpu", runtime.GOARCH)
+ headers.Set("x-client-ver", version.Version)
+ return headers
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/compress.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/compress.go
new file mode 100644
index 000000000..4d3dbfcf0
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/compress.go
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package comm
+
+import (
+ "compress/gzip"
+ "io"
+)
+
+func gzipDecompress(r io.Reader) io.Reader {
+ gzipReader, _ := gzip.NewReader(r)
+
+ pipeOut, pipeIn := io.Pipe()
+ go func() {
+ // decompression bomb would have to come from Azure services.
+ // If we want to limit, we should do that in comm.do().
+ _, err := io.Copy(pipeIn, gzipReader) //nolint
+ if err != nil {
+ // don't need the error.
+ pipeIn.CloseWithError(err) //nolint
+ gzipReader.Close()
+ return
+ }
+ if err := gzipReader.Close(); err != nil {
+ // don't need the error.
+ pipeIn.CloseWithError(err) //nolint
+ return
+ }
+ pipeIn.Close()
+ }()
+ return pipeOut
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/grant/grant.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/grant/grant.go
new file mode 100644
index 000000000..b628f61ac
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/grant/grant.go
@@ -0,0 +1,17 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+// Package grant holds types of grants issued by authorization services.
+package grant
+
+const (
+ Password = "password"
+ JWT = "urn:ietf:params:oauth:grant-type:jwt-bearer"
+ SAMLV1 = "urn:ietf:params:oauth:grant-type:saml1_1-bearer"
+ SAMLV2 = "urn:ietf:params:oauth:grant-type:saml2-bearer"
+ DeviceCode = "device_code"
+ AuthCode = "authorization_code"
+ RefreshToken = "refresh_token"
+ ClientCredential = "client_credentials"
+ ClientAssertion = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
+)
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/ops.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/ops.go
new file mode 100644
index 000000000..1f9c543fa
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/ops.go
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+/*
+Package ops provides operations to various backend services using REST clients.
+
+The REST type provides several clients that can be used to communicate to backends.
+Usage is simple:
+
+ rest := ops.New()
+
+ // Creates an authority client and calls the UserRealm() method.
+ userRealm, err := rest.Authority().UserRealm(ctx, authParameters)
+ if err != nil {
+ // Do something
+ }
+*/
+package ops
+
+import (
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust"
+)
+
+// HTTPClient represents an HTTP client.
+// It's usually an *http.Client from the standard library.
+type HTTPClient = comm.HTTPClient
+
+// REST provides REST clients for communicating with various backends used by MSAL.
+type REST struct {
+ client *comm.Client
+}
+
+// New is the constructor for REST.
+func New(httpClient HTTPClient) *REST {
+ return &REST{client: comm.New(httpClient)}
+}
+
+// Authority returns a client for querying information about various authorities.
+func (r *REST) Authority() authority.Client {
+ return authority.Client{Comm: r.client}
+}
+
+// AccessTokens returns a client that can be used to get various access tokens for
+// authorization purposes.
+func (r *REST) AccessTokens() accesstokens.Client {
+ return accesstokens.Client{Comm: r.client}
+}
+
+// WSTrust provides access to various metadata in a WSTrust service. This data can
+// be used to gain tokens based on SAML data using the client provided by AccessTokens().
+func (r *REST) WSTrust() wstrust.Client {
+ return wstrust.Client{Comm: r.client}
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/endpointtype_string.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/endpointtype_string.go
new file mode 100644
index 000000000..a2bb6278a
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/endpointtype_string.go
@@ -0,0 +1,25 @@
+// Code generated by "stringer -type=endpointType"; DO NOT EDIT.
+
+package defs
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[etUnknown-0]
+ _ = x[etUsernamePassword-1]
+ _ = x[etWindowsTransport-2]
+}
+
+const _endpointType_name = "etUnknownetUsernamePasswordetWindowsTransport"
+
+var _endpointType_index = [...]uint8{0, 9, 27, 45}
+
+func (i endpointType) String() string {
+ if i < 0 || i >= endpointType(len(_endpointType_index)-1) {
+ return "endpointType(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _endpointType_name[_endpointType_index[i]:_endpointType_index[i+1]]
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/mex_document_definitions.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/mex_document_definitions.go
new file mode 100644
index 000000000..649727002
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/mex_document_definitions.go
@@ -0,0 +1,394 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package defs
+
+import "encoding/xml"
+
+type Definitions struct {
+ XMLName xml.Name `xml:"definitions"`
+ Text string `xml:",chardata"`
+ Name string `xml:"name,attr"`
+ TargetNamespace string `xml:"targetNamespace,attr"`
+ WSDL string `xml:"wsdl,attr"`
+ XSD string `xml:"xsd,attr"`
+ T string `xml:"t,attr"`
+ SOAPENC string `xml:"soapenc,attr"`
+ SOAP string `xml:"soap,attr"`
+ TNS string `xml:"tns,attr"`
+ MSC string `xml:"msc,attr"`
+ WSAM string `xml:"wsam,attr"`
+ SOAP12 string `xml:"soap12,attr"`
+ WSA10 string `xml:"wsa10,attr"`
+ WSA string `xml:"wsa,attr"`
+ WSAW string `xml:"wsaw,attr"`
+ WSX string `xml:"wsx,attr"`
+ WSAP string `xml:"wsap,attr"`
+ WSU string `xml:"wsu,attr"`
+ Trust string `xml:"trust,attr"`
+ WSP string `xml:"wsp,attr"`
+ Policy []Policy `xml:"Policy"`
+ Types Types `xml:"types"`
+ Message []Message `xml:"message"`
+ PortType []PortType `xml:"portType"`
+ Binding []Binding `xml:"binding"`
+ Service Service `xml:"service"`
+}
+
+type Policy struct {
+ Text string `xml:",chardata"`
+ ID string `xml:"Id,attr"`
+ ExactlyOne ExactlyOne `xml:"ExactlyOne"`
+}
+
+type ExactlyOne struct {
+ Text string `xml:",chardata"`
+ All All `xml:"All"`
+}
+
+type All struct {
+ Text string `xml:",chardata"`
+ NegotiateAuthentication NegotiateAuthentication `xml:"NegotiateAuthentication"`
+ TransportBinding TransportBinding `xml:"TransportBinding"`
+ UsingAddressing Text `xml:"UsingAddressing"`
+ EndorsingSupportingTokens EndorsingSupportingTokens `xml:"EndorsingSupportingTokens"`
+ WSS11 WSS11 `xml:"Wss11"`
+ Trust10 Trust10 `xml:"Trust10"`
+ SignedSupportingTokens SignedSupportingTokens `xml:"SignedSupportingTokens"`
+ Trust13 WSTrust13 `xml:"Trust13"`
+ SignedEncryptedSupportingTokens SignedEncryptedSupportingTokens `xml:"SignedEncryptedSupportingTokens"`
+}
+
+type NegotiateAuthentication struct {
+ Text string `xml:",chardata"`
+ HTTP string `xml:"http,attr"`
+ XMLName xml.Name
+}
+
+type TransportBinding struct {
+ Text string `xml:",chardata"`
+ SP string `xml:"sp,attr"`
+ Policy TransportBindingPolicy `xml:"Policy"`
+}
+
+type TransportBindingPolicy struct {
+ Text string `xml:",chardata"`
+ TransportToken TransportToken `xml:"TransportToken"`
+ AlgorithmSuite AlgorithmSuite `xml:"AlgorithmSuite"`
+ Layout Layout `xml:"Layout"`
+ IncludeTimestamp Text `xml:"IncludeTimestamp"`
+}
+
+type TransportToken struct {
+ Text string `xml:",chardata"`
+ Policy TransportTokenPolicy `xml:"Policy"`
+}
+
+type TransportTokenPolicy struct {
+ Text string `xml:",chardata"`
+ HTTPSToken HTTPSToken `xml:"HttpsToken"`
+}
+
+type HTTPSToken struct {
+ Text string `xml:",chardata"`
+ RequireClientCertificate string `xml:"RequireClientCertificate,attr"`
+}
+
+type AlgorithmSuite struct {
+ Text string `xml:",chardata"`
+ Policy AlgorithmSuitePolicy `xml:"Policy"`
+}
+
+type AlgorithmSuitePolicy struct {
+ Text string `xml:",chardata"`
+ Basic256 Text `xml:"Basic256"`
+ Basic128 Text `xml:"Basic128"`
+}
+
+type Layout struct {
+ Text string `xml:",chardata"`
+ Policy LayoutPolicy `xml:"Policy"`
+}
+
+type LayoutPolicy struct {
+ Text string `xml:",chardata"`
+ Strict Text `xml:"Strict"`
+}
+
+type EndorsingSupportingTokens struct {
+ Text string `xml:",chardata"`
+ SP string `xml:"sp,attr"`
+ Policy EndorsingSupportingTokensPolicy `xml:"Policy"`
+}
+
+type EndorsingSupportingTokensPolicy struct {
+ Text string `xml:",chardata"`
+ X509Token X509Token `xml:"X509Token"`
+ RSAToken RSAToken `xml:"RsaToken"`
+ SignedParts SignedParts `xml:"SignedParts"`
+ KerberosToken KerberosToken `xml:"KerberosToken"`
+ IssuedToken IssuedToken `xml:"IssuedToken"`
+ KeyValueToken KeyValueToken `xml:"KeyValueToken"`
+}
+
+type X509Token struct {
+ Text string `xml:",chardata"`
+ IncludeToken string `xml:"IncludeToken,attr"`
+ Policy X509TokenPolicy `xml:"Policy"`
+}
+
+type X509TokenPolicy struct {
+ Text string `xml:",chardata"`
+ RequireThumbprintReference Text `xml:"RequireThumbprintReference"`
+ WSSX509V3Token10 Text `xml:"WssX509V3Token10"`
+}
+
+type RSAToken struct {
+ Text string `xml:",chardata"`
+ IncludeToken string `xml:"IncludeToken,attr"`
+ Optional string `xml:"Optional,attr"`
+ MSSP string `xml:"mssp,attr"`
+}
+
+type SignedParts struct {
+ Text string `xml:",chardata"`
+ Header SignedPartsHeader `xml:"Header"`
+}
+
+type SignedPartsHeader struct {
+ Text string `xml:",chardata"`
+ Name string `xml:"Name,attr"`
+ Namespace string `xml:"Namespace,attr"`
+}
+
+type KerberosToken struct {
+ Text string `xml:",chardata"`
+ IncludeToken string `xml:"IncludeToken,attr"`
+ Policy KerberosTokenPolicy `xml:"Policy"`
+}
+
+type KerberosTokenPolicy struct {
+ Text string `xml:",chardata"`
+ WSSGSSKerberosV5ApReqToken11 Text `xml:"WssGssKerberosV5ApReqToken11"`
+}
+
+type IssuedToken struct {
+ Text string `xml:",chardata"`
+ IncludeToken string `xml:"IncludeToken,attr"`
+ RequestSecurityTokenTemplate RequestSecurityTokenTemplate `xml:"RequestSecurityTokenTemplate"`
+ Policy IssuedTokenPolicy `xml:"Policy"`
+}
+
+type RequestSecurityTokenTemplate struct {
+ Text string `xml:",chardata"`
+ KeyType Text `xml:"KeyType"`
+ EncryptWith Text `xml:"EncryptWith"`
+ SignatureAlgorithm Text `xml:"SignatureAlgorithm"`
+ CanonicalizationAlgorithm Text `xml:"CanonicalizationAlgorithm"`
+ EncryptionAlgorithm Text `xml:"EncryptionAlgorithm"`
+ KeySize Text `xml:"KeySize"`
+ KeyWrapAlgorithm Text `xml:"KeyWrapAlgorithm"`
+}
+
+type IssuedTokenPolicy struct {
+ Text string `xml:",chardata"`
+ RequireInternalReference Text `xml:"RequireInternalReference"`
+}
+
+type KeyValueToken struct {
+ Text string `xml:",chardata"`
+ IncludeToken string `xml:"IncludeToken,attr"`
+ Optional string `xml:"Optional,attr"`
+}
+
+type WSS11 struct {
+ Text string `xml:",chardata"`
+ SP string `xml:"sp,attr"`
+ Policy Wss11Policy `xml:"Policy"`
+}
+
+type Wss11Policy struct {
+ Text string `xml:",chardata"`
+ MustSupportRefThumbprint Text `xml:"MustSupportRefThumbprint"`
+}
+
+type Trust10 struct {
+ Text string `xml:",chardata"`
+ SP string `xml:"sp,attr"`
+ Policy Trust10Policy `xml:"Policy"`
+}
+
+type Trust10Policy struct {
+ Text string `xml:",chardata"`
+ MustSupportIssuedTokens Text `xml:"MustSupportIssuedTokens"`
+ RequireClientEntropy Text `xml:"RequireClientEntropy"`
+ RequireServerEntropy Text `xml:"RequireServerEntropy"`
+}
+
+type SignedSupportingTokens struct {
+ Text string `xml:",chardata"`
+ SP string `xml:"sp,attr"`
+ Policy SupportingTokensPolicy `xml:"Policy"`
+}
+
+type SupportingTokensPolicy struct {
+ Text string `xml:",chardata"`
+ UsernameToken UsernameToken `xml:"UsernameToken"`
+}
+type UsernameToken struct {
+ Text string `xml:",chardata"`
+ IncludeToken string `xml:"IncludeToken,attr"`
+ Policy UsernameTokenPolicy `xml:"Policy"`
+}
+
+type UsernameTokenPolicy struct {
+ Text string `xml:",chardata"`
+ WSSUsernameToken10 WSSUsernameToken10 `xml:"WssUsernameToken10"`
+}
+
+type WSSUsernameToken10 struct {
+ Text string `xml:",chardata"`
+ XMLName xml.Name
+}
+
+type WSTrust13 struct {
+ Text string `xml:",chardata"`
+ SP string `xml:"sp,attr"`
+ Policy WSTrust13Policy `xml:"Policy"`
+}
+
+type WSTrust13Policy struct {
+ Text string `xml:",chardata"`
+ MustSupportIssuedTokens Text `xml:"MustSupportIssuedTokens"`
+ RequireClientEntropy Text `xml:"RequireClientEntropy"`
+ RequireServerEntropy Text `xml:"RequireServerEntropy"`
+}
+
+type SignedEncryptedSupportingTokens struct {
+ Text string `xml:",chardata"`
+ SP string `xml:"sp,attr"`
+ Policy SupportingTokensPolicy `xml:"Policy"`
+}
+
+type Types struct {
+ Text string `xml:",chardata"`
+ Schema Schema `xml:"schema"`
+}
+
+type Schema struct {
+ Text string `xml:",chardata"`
+ TargetNamespace string `xml:"targetNamespace,attr"`
+ Import []Import `xml:"import"`
+}
+
+type Import struct {
+ Text string `xml:",chardata"`
+ SchemaLocation string `xml:"schemaLocation,attr"`
+ Namespace string `xml:"namespace,attr"`
+}
+
+type Message struct {
+ Text string `xml:",chardata"`
+ Name string `xml:"name,attr"`
+ Part Part `xml:"part"`
+}
+
+type Part struct {
+ Text string `xml:",chardata"`
+ Name string `xml:"name,attr"`
+ Element string `xml:"element,attr"`
+}
+
+type PortType struct {
+ Text string `xml:",chardata"`
+ Name string `xml:"name,attr"`
+ Operation Operation `xml:"operation"`
+}
+
+type Operation struct {
+ Text string `xml:",chardata"`
+ Name string `xml:"name,attr"`
+ Input OperationIO `xml:"input"`
+ Output OperationIO `xml:"output"`
+}
+
+type OperationIO struct {
+ Text string `xml:",chardata"`
+ Action string `xml:"Action,attr"`
+ Message string `xml:"message,attr"`
+ Body OperationIOBody `xml:"body"`
+}
+
+type OperationIOBody struct {
+ Text string `xml:",chardata"`
+ Use string `xml:"use,attr"`
+}
+
+type Binding struct {
+ Text string `xml:",chardata"`
+ Name string `xml:"name,attr"`
+ Type string `xml:"type,attr"`
+ PolicyReference PolicyReference `xml:"PolicyReference"`
+ Binding DefinitionsBinding `xml:"binding"`
+ Operation BindingOperation `xml:"operation"`
+}
+
+type PolicyReference struct {
+ Text string `xml:",chardata"`
+ URI string `xml:"URI,attr"`
+}
+
+type DefinitionsBinding struct {
+ Text string `xml:",chardata"`
+ Transport string `xml:"transport,attr"`
+}
+
+type BindingOperation struct {
+ Text string `xml:",chardata"`
+ Name string `xml:"name,attr"`
+ Operation BindingOperationOperation `xml:"operation"`
+ Input BindingOperationIO `xml:"input"`
+ Output BindingOperationIO `xml:"output"`
+}
+
+type BindingOperationOperation struct {
+ Text string `xml:",chardata"`
+ SoapAction string `xml:"soapAction,attr"`
+ Style string `xml:"style,attr"`
+}
+
+type BindingOperationIO struct {
+ Text string `xml:",chardata"`
+ Body OperationIOBody `xml:"body"`
+}
+
+type Service struct {
+ Text string `xml:",chardata"`
+ Name string `xml:"name,attr"`
+ Port []Port `xml:"port"`
+}
+
+type Port struct {
+ Text string `xml:",chardata"`
+ Name string `xml:"name,attr"`
+ Binding string `xml:"binding,attr"`
+ Address Address `xml:"address"`
+ EndpointReference PortEndpointReference `xml:"EndpointReference"`
+}
+
+type Address struct {
+ Text string `xml:",chardata"`
+ Location string `xml:"location,attr"`
+}
+
+type PortEndpointReference struct {
+ Text string `xml:",chardata"`
+ Address Text `xml:"Address"`
+ Identity Identity `xml:"Identity"`
+}
+
+type Identity struct {
+ Text string `xml:",chardata"`
+ XMLNS string `xml:"xmlns,attr"`
+ SPN Text `xml:"Spn"`
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/saml_assertion_definitions.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/saml_assertion_definitions.go
new file mode 100644
index 000000000..7d0725565
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/saml_assertion_definitions.go
@@ -0,0 +1,230 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package defs
+
+import "encoding/xml"
+
+// TODO(msal): Someone (and it ain't gonna be me) needs to document these attributes or
+// at the least put a link to RFC.
+
+type SAMLDefinitions struct {
+ XMLName xml.Name `xml:"Envelope"`
+ Text string `xml:",chardata"`
+ S string `xml:"s,attr"`
+ A string `xml:"a,attr"`
+ U string `xml:"u,attr"`
+ Header Header `xml:"Header"`
+ Body Body `xml:"Body"`
+}
+
+type Header struct {
+ Text string `xml:",chardata"`
+ Action Action `xml:"Action"`
+ Security Security `xml:"Security"`
+}
+
+type Action struct {
+ Text string `xml:",chardata"`
+ MustUnderstand string `xml:"mustUnderstand,attr"`
+}
+
+type Security struct {
+ Text string `xml:",chardata"`
+ MustUnderstand string `xml:"mustUnderstand,attr"`
+ O string `xml:"o,attr"`
+ Timestamp Timestamp `xml:"Timestamp"`
+}
+
+type Timestamp struct {
+ Text string `xml:",chardata"`
+ ID string `xml:"Id,attr"`
+ Created Text `xml:"Created"`
+ Expires Text `xml:"Expires"`
+}
+
+type Text struct {
+ Text string `xml:",chardata"`
+}
+
+type Body struct {
+ Text string `xml:",chardata"`
+ RequestSecurityTokenResponseCollection RequestSecurityTokenResponseCollection `xml:"RequestSecurityTokenResponseCollection"`
+}
+
+type RequestSecurityTokenResponseCollection struct {
+ Text string `xml:",chardata"`
+ Trust string `xml:"trust,attr"`
+ RequestSecurityTokenResponse []RequestSecurityTokenResponse `xml:"RequestSecurityTokenResponse"`
+}
+
+type RequestSecurityTokenResponse struct {
+ Text string `xml:",chardata"`
+ Lifetime Lifetime `xml:"Lifetime"`
+ AppliesTo AppliesTo `xml:"AppliesTo"`
+ RequestedSecurityToken RequestedSecurityToken `xml:"RequestedSecurityToken"`
+ RequestedAttachedReference RequestedAttachedReference `xml:"RequestedAttachedReference"`
+ RequestedUnattachedReference RequestedUnattachedReference `xml:"RequestedUnattachedReference"`
+ TokenType Text `xml:"TokenType"`
+ RequestType Text `xml:"RequestType"`
+ KeyType Text `xml:"KeyType"`
+}
+
+type Lifetime struct {
+ Text string `xml:",chardata"`
+ Created WSUTimestamp `xml:"Created"`
+ Expires WSUTimestamp `xml:"Expires"`
+}
+
+type WSUTimestamp struct {
+ Text string `xml:",chardata"`
+ Wsu string `xml:"wsu,attr"`
+}
+
+type AppliesTo struct {
+ Text string `xml:",chardata"`
+ Wsp string `xml:"wsp,attr"`
+ EndpointReference EndpointReference `xml:"EndpointReference"`
+}
+
+type EndpointReference struct {
+ Text string `xml:",chardata"`
+ Wsa string `xml:"wsa,attr"`
+ Address Text `xml:"Address"`
+}
+
+type RequestedSecurityToken struct {
+ Text string `xml:",chardata"`
+ AssertionRawXML string `xml:",innerxml"`
+ Assertion Assertion `xml:"Assertion"`
+}
+
+type Assertion struct {
+ XMLName xml.Name // Normally its `xml:"Assertion"`, but I think they want to capture the xmlns
+ Text string `xml:",chardata"`
+ MajorVersion string `xml:"MajorVersion,attr"`
+ MinorVersion string `xml:"MinorVersion,attr"`
+ AssertionID string `xml:"AssertionID,attr"`
+ Issuer string `xml:"Issuer,attr"`
+ IssueInstant string `xml:"IssueInstant,attr"`
+ Saml string `xml:"saml,attr"`
+ Conditions Conditions `xml:"Conditions"`
+ AttributeStatement AttributeStatement `xml:"AttributeStatement"`
+ AuthenticationStatement AuthenticationStatement `xml:"AuthenticationStatement"`
+ Signature Signature `xml:"Signature"`
+}
+
+type Conditions struct {
+ Text string `xml:",chardata"`
+ NotBefore string `xml:"NotBefore,attr"`
+ NotOnOrAfter string `xml:"NotOnOrAfter,attr"`
+ AudienceRestrictionCondition AudienceRestrictionCondition `xml:"AudienceRestrictionCondition"`
+}
+
+type AudienceRestrictionCondition struct {
+ Text string `xml:",chardata"`
+ Audience Text `xml:"Audience"`
+}
+
+type AttributeStatement struct {
+ Text string `xml:",chardata"`
+ Subject Subject `xml:"Subject"`
+ Attribute []Attribute `xml:"Attribute"`
+}
+
+type Subject struct {
+ Text string `xml:",chardata"`
+ NameIdentifier NameIdentifier `xml:"NameIdentifier"`
+ SubjectConfirmation SubjectConfirmation `xml:"SubjectConfirmation"`
+}
+
+type NameIdentifier struct {
+ Text string `xml:",chardata"`
+ Format string `xml:"Format,attr"`
+}
+
+type SubjectConfirmation struct {
+ Text string `xml:",chardata"`
+ ConfirmationMethod Text `xml:"ConfirmationMethod"`
+}
+
+type Attribute struct {
+ Text string `xml:",chardata"`
+ AttributeName string `xml:"AttributeName,attr"`
+ AttributeNamespace string `xml:"AttributeNamespace,attr"`
+ AttributeValue Text `xml:"AttributeValue"`
+}
+
+type AuthenticationStatement struct {
+ Text string `xml:",chardata"`
+ AuthenticationMethod string `xml:"AuthenticationMethod,attr"`
+ AuthenticationInstant string `xml:"AuthenticationInstant,attr"`
+ Subject Subject `xml:"Subject"`
+}
+
+type Signature struct {
+ Text string `xml:",chardata"`
+ Ds string `xml:"ds,attr"`
+ SignedInfo SignedInfo `xml:"SignedInfo"`
+ SignatureValue Text `xml:"SignatureValue"`
+ KeyInfo KeyInfo `xml:"KeyInfo"`
+}
+
+type SignedInfo struct {
+ Text string `xml:",chardata"`
+ CanonicalizationMethod Method `xml:"CanonicalizationMethod"`
+ SignatureMethod Method `xml:"SignatureMethod"`
+ Reference Reference `xml:"Reference"`
+}
+
+type Method struct {
+ Text string `xml:",chardata"`
+ Algorithm string `xml:"Algorithm,attr"`
+}
+
+type Reference struct {
+ Text string `xml:",chardata"`
+ URI string `xml:"URI,attr"`
+ Transforms Transforms `xml:"Transforms"`
+ DigestMethod Method `xml:"DigestMethod"`
+ DigestValue Text `xml:"DigestValue"`
+}
+
+type Transforms struct {
+ Text string `xml:",chardata"`
+ Transform []Method `xml:"Transform"`
+}
+
+type KeyInfo struct {
+ Text string `xml:",chardata"`
+ Xmlns string `xml:"xmlns,attr"`
+ X509Data X509Data `xml:"X509Data"`
+}
+
+type X509Data struct {
+ Text string `xml:",chardata"`
+ X509Certificate Text `xml:"X509Certificate"`
+}
+
+type RequestedAttachedReference struct {
+ Text string `xml:",chardata"`
+ SecurityTokenReference SecurityTokenReference `xml:"SecurityTokenReference"`
+}
+
+type SecurityTokenReference struct {
+ Text string `xml:",chardata"`
+ TokenType string `xml:"TokenType,attr"`
+ O string `xml:"o,attr"`
+ K string `xml:"k,attr"`
+ KeyIdentifier KeyIdentifier `xml:"KeyIdentifier"`
+}
+
+type KeyIdentifier struct {
+ Text string `xml:",chardata"`
+ ValueType string `xml:"ValueType,attr"`
+}
+
+type RequestedUnattachedReference struct {
+ Text string `xml:",chardata"`
+ SecurityTokenReference SecurityTokenReference `xml:"SecurityTokenReference"`
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/version_string.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/version_string.go
new file mode 100644
index 000000000..6fe5efa8a
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/version_string.go
@@ -0,0 +1,25 @@
+// Code generated by "stringer -type=Version"; DO NOT EDIT.
+
+package defs
+
+import "strconv"
+
+func _() {
+ // An "invalid array index" compiler error signifies that the constant values have changed.
+ // Re-run the stringer command to generate them again.
+ var x [1]struct{}
+ _ = x[TrustUnknown-0]
+ _ = x[Trust2005-1]
+ _ = x[Trust13-2]
+}
+
+const _Version_name = "TrustUnknownTrust2005Trust13"
+
+var _Version_index = [...]uint8{0, 12, 21, 28}
+
+func (i Version) String() string {
+ if i < 0 || i >= Version(len(_Version_index)-1) {
+ return "Version(" + strconv.FormatInt(int64(i), 10) + ")"
+ }
+ return _Version_name[_Version_index[i]:_Version_index[i+1]]
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/wstrust_endpoint.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/wstrust_endpoint.go
new file mode 100644
index 000000000..8fad5efb5
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/wstrust_endpoint.go
@@ -0,0 +1,199 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package defs
+
+import (
+ "encoding/xml"
+ "fmt"
+ "time"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+ uuid "github.com/google/uuid"
+)
+
+//go:generate stringer -type=Version
+
+type Version int
+
+const (
+ TrustUnknown Version = iota
+ Trust2005
+ Trust13
+)
+
+// Endpoint represents a WSTrust endpoint.
+type Endpoint struct {
+ // Version is the version of the endpoint.
+ Version Version
+ // URL is the URL of the endpoint.
+ URL string
+}
+
+type wsTrustTokenRequestEnvelope struct {
+ XMLName xml.Name `xml:"s:Envelope"`
+ Text string `xml:",chardata"`
+ S string `xml:"xmlns:s,attr"`
+ Wsa string `xml:"xmlns:wsa,attr"`
+ Wsu string `xml:"xmlns:wsu,attr"`
+ Header struct {
+ Text string `xml:",chardata"`
+ Action struct {
+ Text string `xml:",chardata"`
+ MustUnderstand string `xml:"s:mustUnderstand,attr"`
+ } `xml:"wsa:Action"`
+ MessageID struct {
+ Text string `xml:",chardata"`
+ } `xml:"wsa:messageID"`
+ ReplyTo struct {
+ Text string `xml:",chardata"`
+ Address struct {
+ Text string `xml:",chardata"`
+ } `xml:"wsa:Address"`
+ } `xml:"wsa:ReplyTo"`
+ To struct {
+ Text string `xml:",chardata"`
+ MustUnderstand string `xml:"s:mustUnderstand,attr"`
+ } `xml:"wsa:To"`
+ Security struct {
+ Text string `xml:",chardata"`
+ MustUnderstand string `xml:"s:mustUnderstand,attr"`
+ Wsse string `xml:"xmlns:wsse,attr"`
+ Timestamp struct {
+ Text string `xml:",chardata"`
+ ID string `xml:"wsu:Id,attr"`
+ Created struct {
+ Text string `xml:",chardata"`
+ } `xml:"wsu:Created"`
+ Expires struct {
+ Text string `xml:",chardata"`
+ } `xml:"wsu:Expires"`
+ } `xml:"wsu:Timestamp"`
+ UsernameToken struct {
+ Text string `xml:",chardata"`
+ ID string `xml:"wsu:Id,attr"`
+ Username struct {
+ Text string `xml:",chardata"`
+ } `xml:"wsse:Username"`
+ Password struct {
+ Text string `xml:",chardata"`
+ } `xml:"wsse:Password"`
+ } `xml:"wsse:UsernameToken"`
+ } `xml:"wsse:Security"`
+ } `xml:"s:Header"`
+ Body struct {
+ Text string `xml:",chardata"`
+ RequestSecurityToken struct {
+ Text string `xml:",chardata"`
+ Wst string `xml:"xmlns:wst,attr"`
+ AppliesTo struct {
+ Text string `xml:",chardata"`
+ Wsp string `xml:"xmlns:wsp,attr"`
+ EndpointReference struct {
+ Text string `xml:",chardata"`
+ Address struct {
+ Text string `xml:",chardata"`
+ } `xml:"wsa:Address"`
+ } `xml:"wsa:EndpointReference"`
+ } `xml:"wsp:AppliesTo"`
+ KeyType struct {
+ Text string `xml:",chardata"`
+ } `xml:"wst:KeyType"`
+ RequestType struct {
+ Text string `xml:",chardata"`
+ } `xml:"wst:RequestType"`
+ } `xml:"wst:RequestSecurityToken"`
+ } `xml:"s:Body"`
+}
+
+func buildTimeString(t time.Time) string {
+ // Golang time formats are weird: https://stackoverflow.com/questions/20234104/how-to-format-current-time-using-a-yyyymmddhhmmss-format
+ return t.Format("2006-01-02T15:04:05.000Z")
+}
+
+func (wte *Endpoint) buildTokenRequestMessage(authType authority.AuthorizeType, cloudAudienceURN string, username string, password string) (string, error) {
+ var soapAction string
+ var trustNamespace string
+ var keyType string
+ var requestType string
+
+ createdTime := time.Now().UTC()
+ expiresTime := createdTime.Add(10 * time.Minute)
+
+ switch wte.Version {
+ case Trust2005:
+ soapAction = trust2005Spec
+ trustNamespace = "http://schemas.xmlsoap.org/ws/2005/02/trust"
+ keyType = "http://schemas.xmlsoap.org/ws/2005/05/identity/NoProofKey"
+ requestType = "http://schemas.xmlsoap.org/ws/2005/02/trust/Issue"
+ case Trust13:
+ soapAction = trust13Spec
+ trustNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512"
+ keyType = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer"
+ requestType = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue"
+ default:
+ return "", fmt.Errorf("buildTokenRequestMessage had Version == %q, which is not recognized", wte.Version)
+ }
+
+ var envelope wsTrustTokenRequestEnvelope
+
+ messageUUID := uuid.New()
+
+ envelope.S = "http://www.w3.org/2003/05/soap-envelope"
+ envelope.Wsa = "http://www.w3.org/2005/08/addressing"
+ envelope.Wsu = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+
+ envelope.Header.Action.MustUnderstand = "1"
+ envelope.Header.Action.Text = soapAction
+ envelope.Header.MessageID.Text = "urn:uuid:" + messageUUID.String()
+ envelope.Header.ReplyTo.Address.Text = "http://www.w3.org/2005/08/addressing/anonymous"
+ envelope.Header.To.MustUnderstand = "1"
+ envelope.Header.To.Text = wte.URL
+
+ switch authType {
+ case authority.ATUnknown:
+ return "", fmt.Errorf("buildTokenRequestMessage had no authority type(%v)", authType)
+ case authority.ATUsernamePassword:
+ endpointUUID := uuid.New()
+
+ var trustID string
+ if wte.Version == Trust2005 {
+ trustID = "UnPwSecTok2005-" + endpointUUID.String()
+ } else {
+ trustID = "UnPwSecTok13-" + endpointUUID.String()
+ }
+
+ envelope.Header.Security.MustUnderstand = "1"
+ envelope.Header.Security.Wsse = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
+ envelope.Header.Security.Timestamp.ID = "MSATimeStamp"
+ envelope.Header.Security.Timestamp.Created.Text = buildTimeString(createdTime)
+ envelope.Header.Security.Timestamp.Expires.Text = buildTimeString(expiresTime)
+ envelope.Header.Security.UsernameToken.ID = trustID
+ envelope.Header.Security.UsernameToken.Username.Text = username
+ envelope.Header.Security.UsernameToken.Password.Text = password
+ default:
+ // This is just to note that we don't do anything for other cases.
+ // We aren't missing anything I know of.
+ }
+
+ envelope.Body.RequestSecurityToken.Wst = trustNamespace
+ envelope.Body.RequestSecurityToken.AppliesTo.Wsp = "http://schemas.xmlsoap.org/ws/2004/09/policy"
+ envelope.Body.RequestSecurityToken.AppliesTo.EndpointReference.Address.Text = cloudAudienceURN
+ envelope.Body.RequestSecurityToken.KeyType.Text = keyType
+ envelope.Body.RequestSecurityToken.RequestType.Text = requestType
+
+ output, err := xml.Marshal(envelope)
+ if err != nil {
+ return "", err
+ }
+
+ return string(output), nil
+}
+
+func (wte *Endpoint) BuildTokenRequestMessageWIA(cloudAudienceURN string) (string, error) {
+ return wte.buildTokenRequestMessage(authority.ATWindowsIntegrated, cloudAudienceURN, "", "")
+}
+
+func (wte *Endpoint) BuildTokenRequestMessageUsernamePassword(cloudAudienceURN string, username string, password string) (string, error) {
+ return wte.buildTokenRequestMessage(authority.ATUsernamePassword, cloudAudienceURN, username, password)
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/wstrust_mex_document.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/wstrust_mex_document.go
new file mode 100644
index 000000000..e3d19886e
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/wstrust_mex_document.go
@@ -0,0 +1,159 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package defs
+
+import (
+ "errors"
+ "fmt"
+ "strings"
+)
+
+//go:generate stringer -type=endpointType
+
+type endpointType int
+
+const (
+ etUnknown endpointType = iota
+ etUsernamePassword
+ etWindowsTransport
+)
+
+type wsEndpointData struct {
+ Version Version
+ EndpointType endpointType
+}
+
+const trust13Spec string = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue"
+const trust2005Spec string = "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue"
+
+type MexDocument struct {
+ UsernamePasswordEndpoint Endpoint
+ WindowsTransportEndpoint Endpoint
+ policies map[string]endpointType
+ bindings map[string]wsEndpointData
+}
+
+func updateEndpoint(cached *Endpoint, found Endpoint) {
+ if cached == nil || cached.Version == TrustUnknown {
+ *cached = found
+ return
+ }
+ if (*cached).Version == Trust2005 && found.Version == Trust13 {
+ *cached = found
+ return
+ }
+}
+
+// TODO(msal): Someone needs to write tests for everything below.
+
+// NewFromDef creates a new MexDocument.
+func NewFromDef(defs Definitions) (MexDocument, error) {
+ policies, err := policies(defs)
+ if err != nil {
+ return MexDocument{}, err
+ }
+
+ bindings, err := bindings(defs, policies)
+ if err != nil {
+ return MexDocument{}, err
+ }
+
+ userPass, windows, err := endpoints(defs, bindings)
+ if err != nil {
+ return MexDocument{}, err
+ }
+
+ return MexDocument{
+ UsernamePasswordEndpoint: userPass,
+ WindowsTransportEndpoint: windows,
+ policies: policies,
+ bindings: bindings,
+ }, nil
+}
+
+func policies(defs Definitions) (map[string]endpointType, error) {
+ policies := make(map[string]endpointType, len(defs.Policy))
+
+ for _, policy := range defs.Policy {
+ if policy.ExactlyOne.All.NegotiateAuthentication.XMLName.Local != "" {
+ if policy.ExactlyOne.All.TransportBinding.SP != "" && policy.ID != "" {
+ policies["#"+policy.ID] = etWindowsTransport
+ }
+ }
+
+ if policy.ExactlyOne.All.SignedEncryptedSupportingTokens.Policy.UsernameToken.Policy.WSSUsernameToken10.XMLName.Local != "" {
+ if policy.ExactlyOne.All.TransportBinding.SP != "" && policy.ID != "" {
+ policies["#"+policy.ID] = etUsernamePassword
+ }
+ }
+ if policy.ExactlyOne.All.SignedSupportingTokens.Policy.UsernameToken.Policy.WSSUsernameToken10.XMLName.Local != "" {
+ if policy.ExactlyOne.All.TransportBinding.SP != "" && policy.ID != "" {
+ policies["#"+policy.ID] = etUsernamePassword
+ }
+ }
+ }
+
+ if len(policies) == 0 {
+ return policies, errors.New("no policies for mex document")
+ }
+
+ return policies, nil
+}
+
+func bindings(defs Definitions, policies map[string]endpointType) (map[string]wsEndpointData, error) {
+ bindings := make(map[string]wsEndpointData, len(defs.Binding))
+
+ for _, binding := range defs.Binding {
+ policyName := binding.PolicyReference.URI
+ transport := binding.Binding.Transport
+
+ if transport == "http://schemas.xmlsoap.org/soap/http" {
+ if policy, ok := policies[policyName]; ok {
+ bindingName := binding.Name
+ specVersion := binding.Operation.Operation.SoapAction
+
+ if specVersion == trust13Spec {
+ bindings[bindingName] = wsEndpointData{Trust13, policy}
+ } else if specVersion == trust2005Spec {
+ bindings[bindingName] = wsEndpointData{Trust2005, policy}
+ } else {
+ return nil, errors.New("found unknown spec version in mex document")
+ }
+ }
+ }
+ }
+ return bindings, nil
+}
+
+func endpoints(defs Definitions, bindings map[string]wsEndpointData) (userPass, windows Endpoint, err error) {
+ for _, port := range defs.Service.Port {
+ bindingName := port.Binding
+
+ index := strings.Index(bindingName, ":")
+ if index != -1 {
+ bindingName = bindingName[index+1:]
+ }
+
+ if binding, ok := bindings[bindingName]; ok {
+ url := strings.TrimSpace(port.EndpointReference.Address.Text)
+ if url == "" {
+ return Endpoint{}, Endpoint{}, fmt.Errorf("MexDocument cannot have blank URL endpoint")
+ }
+ if binding.Version == TrustUnknown {
+ return Endpoint{}, Endpoint{}, fmt.Errorf("endpoint version unknown")
+ }
+ endpoint := Endpoint{Version: binding.Version, URL: url}
+
+ switch binding.EndpointType {
+ case etUsernamePassword:
+ updateEndpoint(&userPass, endpoint)
+ case etWindowsTransport:
+ updateEndpoint(&windows, endpoint)
+ default:
+ return Endpoint{}, Endpoint{}, errors.New("found unknown port type in MEX document")
+ }
+ }
+ }
+ return userPass, windows, nil
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/wstrust.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/wstrust.go
new file mode 100644
index 000000000..47cd4c692
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/wstrust.go
@@ -0,0 +1,136 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+/*
+Package wstrust provides a client for communicating with a WSTrust (https://en.wikipedia.org/wiki/WS-Trust#:~:text=WS%2DTrust%20is%20a%20WS,in%20a%20secure%20message%20exchange.)
+for the purposes of extracting metadata from the service. This data can be used to acquire
+tokens using the accesstokens.Client.GetAccessTokenFromSamlGrant() call.
+*/
+package wstrust
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/grant"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs"
+)
+
+type xmlCaller interface {
+ XMLCall(ctx context.Context, endpoint string, headers http.Header, qv url.Values, resp interface{}) error
+ SOAPCall(ctx context.Context, endpoint, action string, headers http.Header, qv url.Values, body string, resp interface{}) error
+}
+
+type SamlTokenInfo struct {
+ AssertionType string // Should be either constants SAMLV1Grant or SAMLV2Grant.
+ Assertion string
+}
+
+// Client represents the REST calls to get tokens from token generator backends.
+type Client struct {
+ // Comm provides the HTTP transport client.
+ Comm xmlCaller
+}
+
+// TODO(msal): This allows me to call Mex without having a real Def file on line 45.
+// This would fail because policies() would not find a policy. This is easy enough to
+// fix in test data, but.... Definitions is defined with built in structs. That needs
+// to be pulled apart and until then I have this hack in.
+var newFromDef = defs.NewFromDef
+
+// Mex provides metadata about a wstrust service.
+func (c Client) Mex(ctx context.Context, federationMetadataURL string) (defs.MexDocument, error) {
+ resp := defs.Definitions{}
+ err := c.Comm.XMLCall(
+ ctx,
+ federationMetadataURL,
+ http.Header{},
+ nil,
+ &resp,
+ )
+ if err != nil {
+ return defs.MexDocument{}, err
+ }
+
+ return newFromDef(resp)
+}
+
+const (
+ SoapActionDefault = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue"
+
+ // Note: Commented out because this action is not supported. It was in the original code
+ // but only used in a switch where it errored. Since there was only one value, a default
+ // worked better. However, buildTokenRequestMessage() had 2005 support. I'm not actually
+ // sure what's going on here. It like we have half support. For now this is here just
+ // for documentation purposes in case we are going to add support.
+ //
+ // SoapActionWSTrust2005 = "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue"
+)
+
+// SAMLTokenInfo provides SAML information that is used to generate a SAML token.
+func (c Client) SAMLTokenInfo(ctx context.Context, authParameters authority.AuthParams, cloudAudienceURN string, endpoint defs.Endpoint) (SamlTokenInfo, error) {
+ var wsTrustRequestMessage string
+ var err error
+
+ switch authParameters.AuthorizationType {
+ case authority.ATWindowsIntegrated:
+ wsTrustRequestMessage, err = endpoint.BuildTokenRequestMessageWIA(cloudAudienceURN)
+ if err != nil {
+ return SamlTokenInfo{}, err
+ }
+ case authority.ATUsernamePassword:
+ wsTrustRequestMessage, err = endpoint.BuildTokenRequestMessageUsernamePassword(
+ cloudAudienceURN, authParameters.Username, authParameters.Password)
+ if err != nil {
+ return SamlTokenInfo{}, err
+ }
+ default:
+ return SamlTokenInfo{}, fmt.Errorf("unknown auth type %v", authParameters.AuthorizationType)
+ }
+
+ var soapAction string
+ switch endpoint.Version {
+ case defs.Trust13:
+ soapAction = SoapActionDefault
+ case defs.Trust2005:
+ return SamlTokenInfo{}, errors.New("WS Trust 2005 support is not implemented")
+ default:
+ return SamlTokenInfo{}, fmt.Errorf("the SOAP endpoint for a wstrust call had an invalid version: %v", endpoint.Version)
+ }
+
+ resp := defs.SAMLDefinitions{}
+ err = c.Comm.SOAPCall(ctx, endpoint.URL, soapAction, http.Header{}, nil, wsTrustRequestMessage, &resp)
+ if err != nil {
+ return SamlTokenInfo{}, err
+ }
+
+ return c.samlAssertion(resp)
+}
+
+const (
+ samlv1Assertion = "urn:oasis:names:tc:SAML:1.0:assertion"
+ samlv2Assertion = "urn:oasis:names:tc:SAML:2.0:assertion"
+)
+
+func (c Client) samlAssertion(def defs.SAMLDefinitions) (SamlTokenInfo, error) {
+ for _, tokenResponse := range def.Body.RequestSecurityTokenResponseCollection.RequestSecurityTokenResponse {
+ token := tokenResponse.RequestedSecurityToken
+ if token.Assertion.XMLName.Local != "" {
+ assertion := token.AssertionRawXML
+
+ samlVersion := token.Assertion.Saml
+ switch samlVersion {
+ case samlv1Assertion:
+ return SamlTokenInfo{AssertionType: grant.SAMLV1, Assertion: assertion}, nil
+ case samlv2Assertion:
+ return SamlTokenInfo{AssertionType: grant.SAMLV2, Assertion: assertion}, nil
+ }
+ return SamlTokenInfo{}, fmt.Errorf("couldn't parse SAML assertion, version unknown: %q", samlVersion)
+ }
+ }
+ return SamlTokenInfo{}, errors.New("unknown WS-Trust version")
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go
new file mode 100644
index 000000000..0ade41179
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go
@@ -0,0 +1,149 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+// TODO(msal): Write some tests. The original code this came from didn't have tests and I'm too
+// tired at this point to do it. It, like many other *Manager code I found was broken because
+// they didn't have mutex protection.
+
+package oauth
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "strings"
+ "sync"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+)
+
+// ADFS is an active directory federation service authority type.
+const ADFS = "ADFS"
+
+type cacheEntry struct {
+ Endpoints authority.Endpoints
+ ValidForDomainsInList map[string]bool
+}
+
+func createcacheEntry(endpoints authority.Endpoints) cacheEntry {
+ return cacheEntry{endpoints, map[string]bool{}}
+}
+
+// AuthorityEndpoint retrieves endpoints from an authority for auth and token acquisition.
+type authorityEndpoint struct {
+ rest *ops.REST
+
+ mu sync.Mutex
+ cache map[string]cacheEntry
+}
+
+// newAuthorityEndpoint is the constructor for AuthorityEndpoint.
+func newAuthorityEndpoint(rest *ops.REST) *authorityEndpoint {
+ m := &authorityEndpoint{rest: rest, cache: map[string]cacheEntry{}}
+ return m
+}
+
+// ResolveEndpoints gets the authorization and token endpoints and creates an AuthorityEndpoints instance
+func (m *authorityEndpoint) ResolveEndpoints(ctx context.Context, authorityInfo authority.Info, userPrincipalName string) (authority.Endpoints, error) {
+
+ if endpoints, found := m.cachedEndpoints(authorityInfo, userPrincipalName); found {
+ return endpoints, nil
+ }
+
+ endpoint, err := m.openIDConfigurationEndpoint(ctx, authorityInfo, userPrincipalName)
+ if err != nil {
+ return authority.Endpoints{}, err
+ }
+
+ resp, err := m.rest.Authority().GetTenantDiscoveryResponse(ctx, endpoint)
+ if err != nil {
+ return authority.Endpoints{}, err
+ }
+ if err := resp.Validate(); err != nil {
+ return authority.Endpoints{}, fmt.Errorf("ResolveEndpoints(): %w", err)
+ }
+
+ tenant := authorityInfo.Tenant
+
+ endpoints := authority.NewEndpoints(
+ strings.Replace(resp.AuthorizationEndpoint, "{tenant}", tenant, -1),
+ strings.Replace(resp.TokenEndpoint, "{tenant}", tenant, -1),
+ strings.Replace(resp.Issuer, "{tenant}", tenant, -1),
+ authorityInfo.Host)
+
+ m.addCachedEndpoints(authorityInfo, userPrincipalName, endpoints)
+
+ return endpoints, nil
+}
+
+// cachedEndpoints returns a the cached endpoints if they exists. If not, we return false.
+func (m *authorityEndpoint) cachedEndpoints(authorityInfo authority.Info, userPrincipalName string) (authority.Endpoints, bool) {
+ m.mu.Lock()
+ defer m.mu.Unlock()
+
+ if cacheEntry, ok := m.cache[authorityInfo.CanonicalAuthorityURI]; ok {
+ if authorityInfo.AuthorityType == ADFS {
+ domain, err := adfsDomainFromUpn(userPrincipalName)
+ if err == nil {
+ if _, ok := cacheEntry.ValidForDomainsInList[domain]; ok {
+ return cacheEntry.Endpoints, true
+ }
+ }
+ }
+ return cacheEntry.Endpoints, true
+ }
+ return authority.Endpoints{}, false
+}
+
+func (m *authorityEndpoint) addCachedEndpoints(authorityInfo authority.Info, userPrincipalName string, endpoints authority.Endpoints) {
+ m.mu.Lock()
+ defer m.mu.Unlock()
+
+ updatedCacheEntry := createcacheEntry(endpoints)
+
+ if authorityInfo.AuthorityType == ADFS {
+ // Since we're here, we've made a call to the backend. We want to ensure we're caching
+ // the latest values from the server.
+ if cacheEntry, ok := m.cache[authorityInfo.CanonicalAuthorityURI]; ok {
+ for k := range cacheEntry.ValidForDomainsInList {
+ updatedCacheEntry.ValidForDomainsInList[k] = true
+ }
+ }
+ domain, err := adfsDomainFromUpn(userPrincipalName)
+ if err == nil {
+ updatedCacheEntry.ValidForDomainsInList[domain] = true
+ }
+ }
+
+ m.cache[authorityInfo.CanonicalAuthorityURI] = updatedCacheEntry
+}
+
+func (m *authorityEndpoint) openIDConfigurationEndpoint(ctx context.Context, authorityInfo authority.Info, userPrincipalName string) (string, error) {
+ if authorityInfo.Tenant == "adfs" {
+ return fmt.Sprintf("https://%s/adfs/.well-known/openid-configuration", authorityInfo.Host), nil
+ } else if authorityInfo.ValidateAuthority && !authority.TrustedHost(authorityInfo.Host) {
+ resp, err := m.rest.Authority().AADInstanceDiscovery(ctx, authorityInfo)
+ if err != nil {
+ return "", err
+ }
+ return resp.TenantDiscoveryEndpoint, nil
+ } else if authorityInfo.Region != "" {
+ resp, err := m.rest.Authority().AADInstanceDiscovery(ctx, authorityInfo)
+ if err != nil {
+ return "", err
+ }
+ return resp.TenantDiscoveryEndpoint, nil
+
+ }
+
+ return authorityInfo.CanonicalAuthorityURI + "v2.0/.well-known/openid-configuration", nil
+}
+
+func adfsDomainFromUpn(userPrincipalName string) (string, error) {
+ parts := strings.Split(userPrincipalName, "@")
+ if len(parts) < 2 {
+ return "", errors.New("no @ present in user principal name")
+ }
+ return parts[1], nil
+}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/options/options.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/options/options.go
new file mode 100644
index 000000000..4561d72db
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/options/options.go
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package options
+
+import (
+ "errors"
+ "fmt"
+)
+
+// CallOption implements an optional argument to a method call. See
+// https://blog.devgenius.io/go-call-option-that-can-be-used-with-multiple-methods-6c81734f3dbe
+// for an explanation of the usage pattern.
+type CallOption interface {
+ Do(any) error
+ callOption()
+}
+
+// ApplyOptions applies all the callOptions to options. options must be a pointer to a struct and
+// callOptions must be a list of objects that implement CallOption.
+func ApplyOptions[O, C any](options O, callOptions []C) error {
+ for _, o := range callOptions {
+ if t, ok := any(o).(CallOption); !ok {
+ return fmt.Errorf("unexpected option type %T", o)
+ } else if err := t.Do(options); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// NewCallOption returns a new CallOption whose Do() method calls function "f".
+func NewCallOption(f func(any) error) CallOption {
+ if f == nil {
+ // This isn't a practical concern because only an MSAL maintainer can get
+ // us here, by implementing a do-nothing option. But if someone does that,
+ // the below ensures the method invoked with the option returns an error.
+ return callOption(func(any) error {
+ return errors.New("invalid option: missing implementation")
+ })
+ }
+ return callOption(f)
+}
+
+// callOption is an adapter for a function to a CallOption
+type callOption func(any) error
+
+func (c callOption) Do(a any) error {
+ return c(a)
+}
+
+func (callOption) callOption() {}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared/shared.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared/shared.go
new file mode 100644
index 000000000..d8ab71356
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared/shared.go
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+package shared
+
+import (
+ "net/http"
+ "reflect"
+ "strings"
+)
+
+const (
+ // CacheKeySeparator is used in creating the keys of the cache.
+ CacheKeySeparator = "-"
+)
+
+type Account struct {
+ HomeAccountID string `json:"home_account_id,omitempty"`
+ Environment string `json:"environment,omitempty"`
+ Realm string `json:"realm,omitempty"`
+ LocalAccountID string `json:"local_account_id,omitempty"`
+ AuthorityType string `json:"authority_type,omitempty"`
+ PreferredUsername string `json:"username,omitempty"`
+ GivenName string `json:"given_name,omitempty"`
+ FamilyName string `json:"family_name,omitempty"`
+ MiddleName string `json:"middle_name,omitempty"`
+ Name string `json:"name,omitempty"`
+ AlternativeID string `json:"alternative_account_id,omitempty"`
+ RawClientInfo string `json:"client_info,omitempty"`
+ UserAssertionHash string `json:"user_assertion_hash,omitempty"`
+
+ AdditionalFields map[string]interface{}
+}
+
+// NewAccount creates an account.
+func NewAccount(homeAccountID, env, realm, localAccountID, authorityType, username string) Account {
+ return Account{
+ HomeAccountID: homeAccountID,
+ Environment: env,
+ Realm: realm,
+ LocalAccountID: localAccountID,
+ AuthorityType: authorityType,
+ PreferredUsername: username,
+ }
+}
+
+// Key creates the key for storing accounts in the cache.
+func (acc Account) Key() string {
+ key := strings.Join([]string{acc.HomeAccountID, acc.Environment, acc.Realm}, CacheKeySeparator)
+ return strings.ToLower(key)
+}
+
+// IsZero checks the zero value of account.
+func (acc Account) IsZero() bool {
+ v := reflect.ValueOf(acc)
+ for i := 0; i < v.NumField(); i++ {
+ field := v.Field(i)
+ if !field.IsZero() {
+ switch field.Kind() {
+ case reflect.Map, reflect.Slice:
+ if field.Len() == 0 {
+ continue
+ }
+ }
+ return false
+ }
+ }
+ return true
+}
+
+// DefaultClient is our default shared HTTP client.
+var DefaultClient = &http.Client{}
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go
new file mode 100644
index 000000000..2ac2d09e4
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+// Package version keeps the version number of the client package.
+package version
+
+// Version is the version of this client package that is communicated to the server.
+const Version = "1.1.1"
diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go
new file mode 100644
index 000000000..88b217ded
--- /dev/null
+++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go
@@ -0,0 +1,713 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
+
+/*
+Package public provides a client for authentication of "public" applications. A "public"
+application is defined as an app that runs on client devices (android, ios, windows, linux, ...).
+These devices are "untrusted" and access resources via web APIs that must authenticate.
+*/
+package public
+
+/*
+Design note:
+
+public.Client uses client.Base as an embedded type. client.Base statically assigns its attributes
+during creation. As it doesn't have any pointers in it, anything borrowed from it, such as
+Base.AuthParams is a copy that is free to be manipulated here.
+*/
+
+// TODO(msal): This should have example code for each method on client using Go's example doc framework.
+// base usage details should be includee in the package documentation.
+
+import (
+ "context"
+ "crypto/rand"
+ "crypto/sha256"
+ "encoding/base64"
+ "errors"
+ "fmt"
+ "net/url"
+ "reflect"
+ "strconv"
+
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/options"
+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared"
+ "github.com/google/uuid"
+ "github.com/pkg/browser"
+)
+
+// AuthResult contains the results of one token acquisition operation.
+// For details see https://aka.ms/msal-net-authenticationresult
+type AuthResult = base.AuthResult
+
+type Account = shared.Account
+
+var errNoAccount = errors.New("no account was specified with public.WithAccount(), or the specified account is invalid")
+
+// clientOptions configures the Client's behavior.
+type clientOptions struct {
+ accessor cache.ExportReplace
+ authority string
+ capabilities []string
+ disableInstanceDiscovery bool
+ httpClient ops.HTTPClient
+}
+
+func (p *clientOptions) validate() error {
+ u, err := url.Parse(p.authority)
+ if err != nil {
+ return fmt.Errorf("Authority options cannot be URL parsed: %w", err)
+ }
+ if u.Scheme != "https" {
+ return fmt.Errorf("Authority(%s) did not start with https://", u.String())
+ }
+ return nil
+}
+
+// Option is an optional argument to the New constructor.
+type Option func(o *clientOptions)
+
+// WithAuthority allows for a custom authority to be set. This must be a valid https url.
+func WithAuthority(authority string) Option {
+ return func(o *clientOptions) {
+ o.authority = authority
+ }
+}
+
+// WithCache provides an accessor that will read and write authentication data to an externally managed cache.
+func WithCache(accessor cache.ExportReplace) Option {
+ return func(o *clientOptions) {
+ o.accessor = accessor
+ }
+}
+
+// WithClientCapabilities allows configuring one or more client capabilities such as "CP1"
+func WithClientCapabilities(capabilities []string) Option {
+ return func(o *clientOptions) {
+ // there's no danger of sharing the slice's underlying memory with the application because
+ // this slice is simply passed to base.WithClientCapabilities, which copies its data
+ o.capabilities = capabilities
+ }
+}
+
+// WithHTTPClient allows for a custom HTTP client to be set.
+func WithHTTPClient(httpClient ops.HTTPClient) Option {
+ return func(o *clientOptions) {
+ o.httpClient = httpClient
+ }
+}
+
+// WithInstanceDiscovery set to false to disable authority validation (to support private cloud scenarios)
+func WithInstanceDiscovery(enabled bool) Option {
+ return func(o *clientOptions) {
+ o.disableInstanceDiscovery = !enabled
+ }
+}
+
+// Client is a representation of authentication client for public applications as defined in the
+// package doc. For more information, visit https://docs.microsoft.com/azure/active-directory/develop/msal-client-applications.
+type Client struct {
+ base base.Client
+}
+
+// New is the constructor for Client.
+func New(clientID string, options ...Option) (Client, error) {
+ opts := clientOptions{
+ authority: base.AuthorityPublicCloud,
+ httpClient: shared.DefaultClient,
+ }
+
+ for _, o := range options {
+ o(&opts)
+ }
+ if err := opts.validate(); err != nil {
+ return Client{}, err
+ }
+
+ base, err := base.New(clientID, opts.authority, oauth.New(opts.httpClient), base.WithCacheAccessor(opts.accessor), base.WithClientCapabilities(opts.capabilities), base.WithInstanceDiscovery(!opts.disableInstanceDiscovery))
+ if err != nil {
+ return Client{}, err
+ }
+ return Client{base}, nil
+}
+
+// authCodeURLOptions contains options for AuthCodeURL
+type authCodeURLOptions struct {
+ claims, loginHint, tenantID, domainHint string
+}
+
+// AuthCodeURLOption is implemented by options for AuthCodeURL
+type AuthCodeURLOption interface {
+ authCodeURLOption()
+}
+
+// AuthCodeURL creates a URL used to acquire an authorization code.
+//
+// Options: [WithClaims], [WithDomainHint], [WithLoginHint], [WithTenantID]
+func (pca Client) AuthCodeURL(ctx context.Context, clientID, redirectURI string, scopes []string, opts ...AuthCodeURLOption) (string, error) {
+ o := authCodeURLOptions{}
+ if err := options.ApplyOptions(&o, opts); err != nil {
+ return "", err
+ }
+ ap, err := pca.base.AuthParams.WithTenant(o.tenantID)
+ if err != nil {
+ return "", err
+ }
+ ap.Claims = o.claims
+ ap.LoginHint = o.loginHint
+ ap.DomainHint = o.domainHint
+ return pca.base.AuthCodeURL(ctx, clientID, redirectURI, scopes, ap)
+}
+
+// WithClaims sets additional claims to request for the token, such as those required by conditional access policies.
+// Use this option when Azure AD returned a claims challenge for a prior request. The argument must be decoded.
+// This option is valid for any token acquisition method.
+func WithClaims(claims string) interface {
+ AcquireByAuthCodeOption
+ AcquireByDeviceCodeOption
+ AcquireByUsernamePasswordOption
+ AcquireInteractiveOption
+ AcquireSilentOption
+ AuthCodeURLOption
+ options.CallOption
+} {
+ return struct {
+ AcquireByAuthCodeOption
+ AcquireByDeviceCodeOption
+ AcquireByUsernamePasswordOption
+ AcquireInteractiveOption
+ AcquireSilentOption
+ AuthCodeURLOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *acquireTokenByAuthCodeOptions:
+ t.claims = claims
+ case *acquireTokenByDeviceCodeOptions:
+ t.claims = claims
+ case *acquireTokenByUsernamePasswordOptions:
+ t.claims = claims
+ case *acquireTokenSilentOptions:
+ t.claims = claims
+ case *authCodeURLOptions:
+ t.claims = claims
+ case *interactiveAuthOptions:
+ t.claims = claims
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// WithTenantID specifies a tenant for a single authentication. It may be different than the tenant set in [New] by [WithAuthority].
+// This option is valid for any token acquisition method.
+func WithTenantID(tenantID string) interface {
+ AcquireByAuthCodeOption
+ AcquireByDeviceCodeOption
+ AcquireByUsernamePasswordOption
+ AcquireInteractiveOption
+ AcquireSilentOption
+ AuthCodeURLOption
+ options.CallOption
+} {
+ return struct {
+ AcquireByAuthCodeOption
+ AcquireByDeviceCodeOption
+ AcquireByUsernamePasswordOption
+ AcquireInteractiveOption
+ AcquireSilentOption
+ AuthCodeURLOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *acquireTokenByAuthCodeOptions:
+ t.tenantID = tenantID
+ case *acquireTokenByDeviceCodeOptions:
+ t.tenantID = tenantID
+ case *acquireTokenByUsernamePasswordOptions:
+ t.tenantID = tenantID
+ case *acquireTokenSilentOptions:
+ t.tenantID = tenantID
+ case *authCodeURLOptions:
+ t.tenantID = tenantID
+ case *interactiveAuthOptions:
+ t.tenantID = tenantID
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// acquireTokenSilentOptions are all the optional settings to an AcquireTokenSilent() call.
+// These are set by using various AcquireTokenSilentOption functions.
+type acquireTokenSilentOptions struct {
+ account Account
+ claims, tenantID string
+}
+
+// AcquireSilentOption is implemented by options for AcquireTokenSilent
+type AcquireSilentOption interface {
+ acquireSilentOption()
+}
+
+// WithSilentAccount uses the passed account during an AcquireTokenSilent() call.
+func WithSilentAccount(account Account) interface {
+ AcquireSilentOption
+ options.CallOption
+} {
+ return struct {
+ AcquireSilentOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *acquireTokenSilentOptions:
+ t.account = account
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// AcquireTokenSilent acquires a token from either the cache or using a refresh token.
+//
+// Options: [WithClaims], [WithSilentAccount], [WithTenantID]
+func (pca Client) AcquireTokenSilent(ctx context.Context, scopes []string, opts ...AcquireSilentOption) (AuthResult, error) {
+ o := acquireTokenSilentOptions{}
+ if err := options.ApplyOptions(&o, opts); err != nil {
+ return AuthResult{}, err
+ }
+ // an account is required to find user tokens in the cache
+ if reflect.ValueOf(o.account).IsZero() {
+ return AuthResult{}, errNoAccount
+ }
+
+ silentParameters := base.AcquireTokenSilentParameters{
+ Scopes: scopes,
+ Account: o.account,
+ Claims: o.claims,
+ RequestType: accesstokens.ATPublic,
+ IsAppCache: false,
+ TenantID: o.tenantID,
+ }
+
+ return pca.base.AcquireTokenSilent(ctx, silentParameters)
+}
+
+// acquireTokenByUsernamePasswordOptions contains optional configuration for AcquireTokenByUsernamePassword
+type acquireTokenByUsernamePasswordOptions struct {
+ claims, tenantID string
+}
+
+// AcquireByUsernamePasswordOption is implemented by options for AcquireTokenByUsernamePassword
+type AcquireByUsernamePasswordOption interface {
+ acquireByUsernamePasswordOption()
+}
+
+// AcquireTokenByUsernamePassword acquires a security token from the authority, via Username/Password Authentication.
+// NOTE: this flow is NOT recommended.
+//
+// Options: [WithClaims], [WithTenantID]
+func (pca Client) AcquireTokenByUsernamePassword(ctx context.Context, scopes []string, username, password string, opts ...AcquireByUsernamePasswordOption) (AuthResult, error) {
+ o := acquireTokenByUsernamePasswordOptions{}
+ if err := options.ApplyOptions(&o, opts); err != nil {
+ return AuthResult{}, err
+ }
+ authParams, err := pca.base.AuthParams.WithTenant(o.tenantID)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ authParams.Scopes = scopes
+ authParams.AuthorizationType = authority.ATUsernamePassword
+ authParams.Claims = o.claims
+ authParams.Username = username
+ authParams.Password = password
+
+ token, err := pca.base.Token.UsernamePassword(ctx, authParams)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ return pca.base.AuthResultFromToken(ctx, authParams, token, true)
+}
+
+type DeviceCodeResult = accesstokens.DeviceCodeResult
+
+// DeviceCode provides the results of the device code flows first stage (containing the code)
+// that must be entered on the second device and provides a method to retrieve the AuthenticationResult
+// once that code has been entered and verified.
+type DeviceCode struct {
+ // Result holds the information about the device code (such as the code).
+ Result DeviceCodeResult
+
+ authParams authority.AuthParams
+ client Client
+ dc oauth.DeviceCode
+}
+
+// AuthenticationResult retreives the AuthenticationResult once the user enters the code
+// on the second device. Until then it blocks until the .AcquireTokenByDeviceCode() context
+// is cancelled or the token expires.
+func (d DeviceCode) AuthenticationResult(ctx context.Context) (AuthResult, error) {
+ token, err := d.dc.Token(ctx)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ return d.client.base.AuthResultFromToken(ctx, d.authParams, token, true)
+}
+
+// acquireTokenByDeviceCodeOptions contains optional configuration for AcquireTokenByDeviceCode
+type acquireTokenByDeviceCodeOptions struct {
+ claims, tenantID string
+}
+
+// AcquireByDeviceCodeOption is implemented by options for AcquireTokenByDeviceCode
+type AcquireByDeviceCodeOption interface {
+ acquireByDeviceCodeOptions()
+}
+
+// AcquireTokenByDeviceCode acquires a security token from the authority, by acquiring a device code and using that to acquire the token.
+// Users need to create an AcquireTokenDeviceCodeParameters instance and pass it in.
+//
+// Options: [WithClaims], [WithTenantID]
+func (pca Client) AcquireTokenByDeviceCode(ctx context.Context, scopes []string, opts ...AcquireByDeviceCodeOption) (DeviceCode, error) {
+ o := acquireTokenByDeviceCodeOptions{}
+ if err := options.ApplyOptions(&o, opts); err != nil {
+ return DeviceCode{}, err
+ }
+ authParams, err := pca.base.AuthParams.WithTenant(o.tenantID)
+ if err != nil {
+ return DeviceCode{}, err
+ }
+ authParams.Scopes = scopes
+ authParams.AuthorizationType = authority.ATDeviceCode
+ authParams.Claims = o.claims
+
+ dc, err := pca.base.Token.DeviceCode(ctx, authParams)
+ if err != nil {
+ return DeviceCode{}, err
+ }
+
+ return DeviceCode{Result: dc.Result, authParams: authParams, client: pca, dc: dc}, nil
+}
+
+// acquireTokenByAuthCodeOptions contains the optional parameters used to acquire an access token using the authorization code flow.
+type acquireTokenByAuthCodeOptions struct {
+ challenge, claims, tenantID string
+}
+
+// AcquireByAuthCodeOption is implemented by options for AcquireTokenByAuthCode
+type AcquireByAuthCodeOption interface {
+ acquireByAuthCodeOption()
+}
+
+// WithChallenge allows you to provide a code for the .AcquireTokenByAuthCode() call.
+func WithChallenge(challenge string) interface {
+ AcquireByAuthCodeOption
+ options.CallOption
+} {
+ return struct {
+ AcquireByAuthCodeOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *acquireTokenByAuthCodeOptions:
+ t.challenge = challenge
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// AcquireTokenByAuthCode is a request to acquire a security token from the authority, using an authorization code.
+// The specified redirect URI must be the same URI that was used when the authorization code was requested.
+//
+// Options: [WithChallenge], [WithClaims], [WithTenantID]
+func (pca Client) AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, opts ...AcquireByAuthCodeOption) (AuthResult, error) {
+ o := acquireTokenByAuthCodeOptions{}
+ if err := options.ApplyOptions(&o, opts); err != nil {
+ return AuthResult{}, err
+ }
+
+ params := base.AcquireTokenAuthCodeParameters{
+ Scopes: scopes,
+ Code: code,
+ Challenge: o.challenge,
+ Claims: o.claims,
+ AppType: accesstokens.ATPublic,
+ RedirectURI: redirectURI,
+ TenantID: o.tenantID,
+ }
+
+ return pca.base.AcquireTokenByAuthCode(ctx, params)
+}
+
+// Accounts gets all the accounts in the token cache.
+// If there are no accounts in the cache the returned slice is empty.
+func (pca Client) Accounts(ctx context.Context) ([]Account, error) {
+ return pca.base.AllAccounts(ctx)
+}
+
+// RemoveAccount signs the account out and forgets account from token cache.
+func (pca Client) RemoveAccount(ctx context.Context, account Account) error {
+ return pca.base.RemoveAccount(ctx, account)
+}
+
+// interactiveAuthOptions contains the optional parameters used to acquire an access token for interactive auth code flow.
+type interactiveAuthOptions struct {
+ claims, domainHint, loginHint, redirectURI, tenantID string
+ openURL func(url string) error
+}
+
+// AcquireInteractiveOption is implemented by options for AcquireTokenInteractive
+type AcquireInteractiveOption interface {
+ acquireInteractiveOption()
+}
+
+// WithLoginHint pre-populates the login prompt with a username.
+func WithLoginHint(username string) interface {
+ AcquireInteractiveOption
+ AuthCodeURLOption
+ options.CallOption
+} {
+ return struct {
+ AcquireInteractiveOption
+ AuthCodeURLOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *authCodeURLOptions:
+ t.loginHint = username
+ case *interactiveAuthOptions:
+ t.loginHint = username
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// WithDomainHint adds the IdP domain as domain_hint query parameter in the auth url.
+func WithDomainHint(domain string) interface {
+ AcquireInteractiveOption
+ AuthCodeURLOption
+ options.CallOption
+} {
+ return struct {
+ AcquireInteractiveOption
+ AuthCodeURLOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *authCodeURLOptions:
+ t.domainHint = domain
+ case *interactiveAuthOptions:
+ t.domainHint = domain
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// WithRedirectURI sets a port for the local server used in interactive authentication, for
+// example http://localhost:port. All URI components other than the port are ignored.
+func WithRedirectURI(redirectURI string) interface {
+ AcquireInteractiveOption
+ options.CallOption
+} {
+ return struct {
+ AcquireInteractiveOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *interactiveAuthOptions:
+ t.redirectURI = redirectURI
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// WithOpenURL allows you to provide a function to open the browser to complete the interactive login, instead of launching the system default browser.
+func WithOpenURL(openURL func(url string) error) interface {
+ AcquireInteractiveOption
+ options.CallOption
+} {
+ return struct {
+ AcquireInteractiveOption
+ options.CallOption
+ }{
+ CallOption: options.NewCallOption(
+ func(a any) error {
+ switch t := a.(type) {
+ case *interactiveAuthOptions:
+ t.openURL = openURL
+ default:
+ return fmt.Errorf("unexpected options type %T", a)
+ }
+ return nil
+ },
+ ),
+ }
+}
+
+// AcquireTokenInteractive acquires a security token from the authority using the default web browser to select the account.
+// https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#interactive-and-non-interactive-authentication
+//
+// Options: [WithDomainHint], [WithLoginHint], [WithOpenURL], [WithRedirectURI], [WithTenantID]
+func (pca Client) AcquireTokenInteractive(ctx context.Context, scopes []string, opts ...AcquireInteractiveOption) (AuthResult, error) {
+ o := interactiveAuthOptions{}
+ if err := options.ApplyOptions(&o, opts); err != nil {
+ return AuthResult{}, err
+ }
+ // the code verifier is a random 32-byte sequence that's been base-64 encoded without padding.
+ // it's used to prevent MitM attacks during auth code flow, see https://tools.ietf.org/html/rfc7636
+ cv, challenge, err := codeVerifier()
+ if err != nil {
+ return AuthResult{}, err
+ }
+ var redirectURL *url.URL
+ if o.redirectURI != "" {
+ redirectURL, err = url.Parse(o.redirectURI)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ }
+ if o.openURL == nil {
+ o.openURL = browser.OpenURL
+ }
+ authParams, err := pca.base.AuthParams.WithTenant(o.tenantID)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ authParams.Scopes = scopes
+ authParams.AuthorizationType = authority.ATInteractive
+ authParams.Claims = o.claims
+ authParams.CodeChallenge = challenge
+ authParams.CodeChallengeMethod = "S256"
+ authParams.LoginHint = o.loginHint
+ authParams.DomainHint = o.domainHint
+ authParams.State = uuid.New().String()
+ authParams.Prompt = "select_account"
+ res, err := pca.browserLogin(ctx, redirectURL, authParams, o.openURL)
+ if err != nil {
+ return AuthResult{}, err
+ }
+ authParams.Redirecturi = res.redirectURI
+
+ req, err := accesstokens.NewCodeChallengeRequest(authParams, accesstokens.ATPublic, nil, res.authCode, cv)
+ if err != nil {
+ return AuthResult{}, err
+ }
+
+ token, err := pca.base.Token.AuthCode(ctx, req)
+ if err != nil {
+ return AuthResult{}, err
+ }
+
+ return pca.base.AuthResultFromToken(ctx, authParams, token, true)
+}
+
+type interactiveAuthResult struct {
+ authCode string
+ redirectURI string
+}
+
+// parses the port number from the provided URL.
+// returns 0 if nil or no port is specified.
+func parsePort(u *url.URL) (int, error) {
+ if u == nil {
+ return 0, nil
+ }
+ p := u.Port()
+ if p == "" {
+ return 0, nil
+ }
+ return strconv.Atoi(p)
+}
+
+// browserLogin calls openURL and waits for a user to log in
+func (pca Client) browserLogin(ctx context.Context, redirectURI *url.URL, params authority.AuthParams, openURL func(string) error) (interactiveAuthResult, error) {
+ // start local redirect server so login can call us back
+ port, err := parsePort(redirectURI)
+ if err != nil {
+ return interactiveAuthResult{}, err
+ }
+ srv, err := local.New(params.State, port)
+ if err != nil {
+ return interactiveAuthResult{}, err
+ }
+ defer srv.Shutdown()
+ params.Scopes = accesstokens.AppendDefaultScopes(params)
+ authURL, err := pca.base.AuthCodeURL(ctx, params.ClientID, srv.Addr, params.Scopes, params)
+ if err != nil {
+ return interactiveAuthResult{}, err
+ }
+ // open browser window so user can select credentials
+ if err := openURL(authURL); err != nil {
+ return interactiveAuthResult{}, err
+ }
+ // now wait until the logic calls us back
+ res := srv.Result(ctx)
+ if res.Err != nil {
+ return interactiveAuthResult{}, res.Err
+ }
+ return interactiveAuthResult{
+ authCode: res.Code,
+ redirectURI: srv.Addr,
+ }, nil
+}
+
+// creates a code verifier string along with its SHA256 hash which
+// is used as the challenge when requesting an auth code.
+// used in interactive auth flow for PKCE.
+func codeVerifier() (codeVerifier string, challenge string, err error) {
+ cvBytes := make([]byte, 32)
+ if _, err = rand.Read(cvBytes); err != nil {
+ return
+ }
+ codeVerifier = base64.RawURLEncoding.EncodeToString(cvBytes)
+ // for PKCE, create a hash of the code verifier
+ cvh := sha256.Sum256([]byte(codeVerifier))
+ challenge = base64.RawURLEncoding.EncodeToString(cvh[:])
+ return
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/.gitignore b/vendor/github.com/golang-jwt/jwt/v5/.gitignore
new file mode 100644
index 000000000..09573e016
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/.gitignore
@@ -0,0 +1,4 @@
+.DS_Store
+bin
+.idea/
+
diff --git a/vendor/github.com/golang-jwt/jwt/v5/LICENSE b/vendor/github.com/golang-jwt/jwt/v5/LICENSE
new file mode 100644
index 000000000..35dbc2520
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/LICENSE
@@ -0,0 +1,9 @@
+Copyright (c) 2012 Dave Grijalva
+Copyright (c) 2021 golang-jwt maintainers
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md b/vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md
new file mode 100644
index 000000000..6ad1c22bb
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md
@@ -0,0 +1,185 @@
+# Migration Guide (v5.0.0)
+
+Version `v5` contains a major rework of core functionalities in the `jwt-go`
+library. This includes support for several validation options as well as a
+re-design of the `Claims` interface. Lastly, we reworked how errors work under
+the hood, which should provide a better overall developer experience.
+
+Starting from [v5.0.0](https://github.com/golang-jwt/jwt/releases/tag/v5.0.0),
+the import path will be:
+
+ "github.com/golang-jwt/jwt/v5"
+
+For most users, changing the import path *should* suffice. However, since we
+intentionally changed and cleaned some of the public API, existing programs
+might need to be updated. The following sections describe significant changes
+and corresponding updates for existing programs.
+
+## Parsing and Validation Options
+
+Under the hood, a new `validator` struct takes care of validating the claims. A
+long awaited feature has been the option to fine-tune the validation of tokens.
+This is now possible with several `ParserOption` functions that can be appended
+to most `Parse` functions, such as `ParseWithClaims`. The most important options
+and changes are:
+ * Added `WithLeeway` to support specifying the leeway that is allowed when
+ validating time-based claims, such as `exp` or `nbf`.
+ * Changed default behavior to not check the `iat` claim. Usage of this claim
+ is OPTIONAL according to the JWT RFC. The claim itself is also purely
+ informational according to the RFC, so a strict validation failure is not
+ recommended. If you want to check for sensible values in these claims,
+ please use the `WithIssuedAt` parser option.
+ * Added `WithAudience`, `WithSubject` and `WithIssuer` to support checking for
+ expected `aud`, `sub` and `iss`.
+ * Added `WithStrictDecoding` and `WithPaddingAllowed` options to allow
+ previously global settings to enable base64 strict encoding and the parsing
+ of base64 strings with padding. The latter is strictly speaking against the
+ standard, but unfortunately some of the major identity providers issue some
+ of these incorrect tokens. Both options are disabled by default.
+
+## Changes to the `Claims` interface
+
+### Complete Restructuring
+
+Previously, the claims interface was satisfied with an implementation of a
+`Valid() error` function. This had several issues:
+ * The different claim types (struct claims, map claims, etc.) then contained
+ similar (but not 100 % identical) code of how this validation was done. This
+ lead to a lot of (almost) duplicate code and was hard to maintain
+ * It was not really semantically close to what a "claim" (or a set of claims)
+ really is; which is a list of defined key/value pairs with a certain
+ semantic meaning.
+
+Since all the validation functionality is now extracted into the validator, all
+`VerifyXXX` and `Valid` functions have been removed from the `Claims` interface.
+Instead, the interface now represents a list of getters to retrieve values with
+a specific meaning. This allows us to completely decouple the validation logic
+with the underlying storage representation of the claim, which could be a
+struct, a map or even something stored in a database.
+
+```go
+type Claims interface {
+ GetExpirationTime() (*NumericDate, error)
+ GetIssuedAt() (*NumericDate, error)
+ GetNotBefore() (*NumericDate, error)
+ GetIssuer() (string, error)
+ GetSubject() (string, error)
+ GetAudience() (ClaimStrings, error)
+}
+```
+
+### Supported Claim Types and Removal of `StandardClaims`
+
+The two standard claim types supported by this library, `MapClaims` and
+`RegisteredClaims` both implement the necessary functions of this interface. The
+old `StandardClaims` struct, which has already been deprecated in `v4` is now
+removed.
+
+Users using custom claims, in most cases, will not experience any changes in the
+behavior as long as they embedded `RegisteredClaims`. If they created a new
+claim type from scratch, they now need to implemented the proper getter
+functions.
+
+### Migrating Application Specific Logic of the old `Valid`
+
+Previously, users could override the `Valid` method in a custom claim, for
+example to extend the validation with application-specific claims. However, this
+was always very dangerous, since once could easily disable the standard
+validation and signature checking.
+
+In order to avoid that, while still supporting the use-case, a new
+`ClaimsValidator` interface has been introduced. This interface consists of the
+`Validate() error` function. If the validator sees, that a `Claims` struct
+implements this interface, the errors returned to the `Validate` function will
+be *appended* to the regular standard validation. It is not possible to disable
+the standard validation anymore (even only by accident).
+
+Usage examples can be found in [example_test.go](./example_test.go), to build
+claims structs like the following.
+
+```go
+// MyCustomClaims includes all registered claims, plus Foo.
+type MyCustomClaims struct {
+ Foo string `json:"foo"`
+ jwt.RegisteredClaims
+}
+
+// Validate can be used to execute additional application-specific claims
+// validation.
+func (m MyCustomClaims) Validate() error {
+ if m.Foo != "bar" {
+ return errors.New("must be foobar")
+ }
+
+ return nil
+}
+```
+
+## Changes to the `Token` and `Parser` struct
+
+The previously global functions `DecodeSegment` and `EncodeSegment` were moved
+to the `Parser` and `Token` struct respectively. This will allow us in the
+future to configure the behavior of these two based on options supplied on the
+parser or the token (creation). This also removes two previously global
+variables and moves them to parser options `WithStrictDecoding` and
+`WithPaddingAllowed`.
+
+In order to do that, we had to adjust the way signing methods work. Previously
+they were given a base64 encoded signature in `Verify` and were expected to
+return a base64 encoded version of the signature in `Sign`, both as a `string`.
+However, this made it necessary to have `DecodeSegment` and `EncodeSegment`
+global and was a less than perfect design because we were repeating
+encoding/decoding steps for all signing methods. Now, `Sign` and `Verify`
+operate on a decoded signature as a `[]byte`, which feels more natural for a
+cryptographic operation anyway. Lastly, `Parse` and `SignedString` take care of
+the final encoding/decoding part.
+
+In addition to that, we also changed the `Signature` field on `Token` from a
+`string` to `[]byte` and this is also now populated with the decoded form. This
+is also more consistent, because the other parts of the JWT, mainly `Header` and
+`Claims` were already stored in decoded form in `Token`. Only the signature was
+stored in base64 encoded form, which was redundant with the information in the
+`Raw` field, which contains the complete token as base64.
+
+```go
+type Token struct {
+ Raw string // Raw contains the raw token
+ Method SigningMethod // Method is the signing method used or to be used
+ Header map[string]interface{} // Header is the first segment of the token in decoded form
+ Claims Claims // Claims is the second segment of the token in decoded form
+ Signature []byte // Signature is the third segment of the token in decoded form
+ Valid bool // Valid specifies if the token is valid
+}
+```
+
+Most (if not all) of these changes should not impact the normal usage of this
+library. Only users directly accessing the `Signature` field as well as
+developers of custom signing methods should be affected.
+
+# Migration Guide (v4.0.0)
+
+Starting from [v4.0.0](https://github.com/golang-jwt/jwt/releases/tag/v4.0.0),
+the import path will be:
+
+ "github.com/golang-jwt/jwt/v4"
+
+The `/v4` version will be backwards compatible with existing `v3.x.y` tags in
+this repo, as well as `github.com/dgrijalva/jwt-go`. For most users this should
+be a drop-in replacement, if you're having troubles migrating, please open an
+issue.
+
+You can replace all occurrences of `github.com/dgrijalva/jwt-go` or
+`github.com/golang-jwt/jwt` with `github.com/golang-jwt/jwt/v5`, either manually
+or by using tools such as `sed` or `gofmt`.
+
+And then you'd typically run:
+
+```
+go get github.com/golang-jwt/jwt/v4
+go mod tidy
+```
+
+# Older releases (before v3.2.0)
+
+The original migration guide for older releases can be found at
+https://github.com/dgrijalva/jwt-go/blob/master/MIGRATION_GUIDE.md.
diff --git a/vendor/github.com/golang-jwt/jwt/v5/README.md b/vendor/github.com/golang-jwt/jwt/v5/README.md
new file mode 100644
index 000000000..964598a31
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/README.md
@@ -0,0 +1,167 @@
+# jwt-go
+
+[](https://github.com/golang-jwt/jwt/actions/workflows/build.yml)
+[](https://pkg.go.dev/github.com/golang-jwt/jwt/v5)
+[](https://coveralls.io/github/golang-jwt/jwt?branch=main)
+
+A [go](http://www.golang.org) (or 'golang' for search engine friendliness)
+implementation of [JSON Web
+Tokens](https://datatracker.ietf.org/doc/html/rfc7519).
+
+Starting with [v4.0.0](https://github.com/golang-jwt/jwt/releases/tag/v4.0.0)
+this project adds Go module support, but maintains backwards compatibility with
+older `v3.x.y` tags and upstream `github.com/dgrijalva/jwt-go`. See the
+[`MIGRATION_GUIDE.md`](./MIGRATION_GUIDE.md) for more information. Version
+v5.0.0 introduces major improvements to the validation of tokens, but is not
+entirely backwards compatible.
+
+> After the original author of the library suggested migrating the maintenance
+> of `jwt-go`, a dedicated team of open source maintainers decided to clone the
+> existing library into this repository. See
+> [dgrijalva/jwt-go#462](https://github.com/dgrijalva/jwt-go/issues/462) for a
+> detailed discussion on this topic.
+
+
+**SECURITY NOTICE:** Some older versions of Go have a security issue in the
+crypto/elliptic. Recommendation is to upgrade to at least 1.15 See issue
+[dgrijalva/jwt-go#216](https://github.com/dgrijalva/jwt-go/issues/216) for more
+detail.
+
+**SECURITY NOTICE:** It's important that you [validate the `alg` presented is
+what you
+expect](https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/).
+This library attempts to make it easy to do the right thing by requiring key
+types match the expected alg, but you should take the extra step to verify it in
+your usage. See the examples provided.
+
+### Supported Go versions
+
+Our support of Go versions is aligned with Go's [version release
+policy](https://golang.org/doc/devel/release#policy). So we will support a major
+version of Go until there are two newer major releases. We no longer support
+building jwt-go with unsupported Go versions, as these contain security
+vulnerabilities which will not be fixed.
+
+## What the heck is a JWT?
+
+JWT.io has [a great introduction](https://jwt.io/introduction) to JSON Web
+Tokens.
+
+In short, it's a signed JSON object that does something useful (for example,
+authentication). It's commonly used for `Bearer` tokens in Oauth 2. A token is
+made of three parts, separated by `.`'s. The first two parts are JSON objects,
+that have been [base64url](https://datatracker.ietf.org/doc/html/rfc4648)
+encoded. The last part is the signature, encoded the same way.
+
+The first part is called the header. It contains the necessary information for
+verifying the last part, the signature. For example, which encryption method
+was used for signing and what key was used.
+
+The part in the middle is the interesting bit. It's called the Claims and
+contains the actual stuff you care about. Refer to [RFC
+7519](https://datatracker.ietf.org/doc/html/rfc7519) for information about
+reserved keys and the proper way to add your own.
+
+## What's in the box?
+
+This library supports the parsing and verification as well as the generation and
+signing of JWTs. Current supported signing algorithms are HMAC SHA, RSA,
+RSA-PSS, and ECDSA, though hooks are present for adding your own.
+
+## Installation Guidelines
+
+1. To install the jwt package, you first need to have
+ [Go](https://go.dev/doc/install) installed, then you can use the command
+ below to add `jwt-go` as a dependency in your Go program.
+
+```sh
+go get -u github.com/golang-jwt/jwt/v5
+```
+
+2. Import it in your code:
+
+```go
+import "github.com/golang-jwt/jwt/v5"
+```
+
+## Usage
+
+A detailed usage guide, including how to sign and verify tokens can be found on
+our [documentation website](https://golang-jwt.github.io/jwt/usage/create/).
+
+## Examples
+
+See [the project documentation](https://pkg.go.dev/github.com/golang-jwt/jwt/v5)
+for examples of usage:
+
+* [Simple example of parsing and validating a
+ token](https://pkg.go.dev/github.com/golang-jwt/jwt/v5#example-Parse-Hmac)
+* [Simple example of building and signing a
+ token](https://pkg.go.dev/github.com/golang-jwt/jwt/v5#example-New-Hmac)
+* [Directory of
+ Examples](https://pkg.go.dev/github.com/golang-jwt/jwt/v5#pkg-examples)
+
+## Compliance
+
+This library was last reviewed to comply with [RFC
+7519](https://datatracker.ietf.org/doc/html/rfc7519) dated May 2015 with a few
+notable differences:
+
+* In order to protect against accidental use of [Unsecured
+ JWTs](https://datatracker.ietf.org/doc/html/rfc7519#section-6), tokens using
+ `alg=none` will only be accepted if the constant
+ `jwt.UnsafeAllowNoneSignatureType` is provided as the key.
+
+## Project Status & Versioning
+
+This library is considered production ready. Feedback and feature requests are
+appreciated. The API should be considered stable. There should be very few
+backwards-incompatible changes outside of major version updates (and only with
+good reason).
+
+This project uses [Semantic Versioning 2.0.0](http://semver.org). Accepted pull
+requests will land on `main`. Periodically, versions will be tagged from
+`main`. You can find all the releases on [the project releases
+page](https://github.com/golang-jwt/jwt/releases).
+
+**BREAKING CHANGES:*** A full list of breaking changes is available in
+`VERSION_HISTORY.md`. See `MIGRATION_GUIDE.md` for more information on updating
+your code.
+
+## Extensions
+
+This library publishes all the necessary components for adding your own signing
+methods or key functions. Simply implement the `SigningMethod` interface and
+register a factory method using `RegisterSigningMethod` or provide a
+`jwt.Keyfunc`.
+
+A common use case would be integrating with different 3rd party signature
+providers, like key management services from various cloud providers or Hardware
+Security Modules (HSMs) or to implement additional standards.
+
+| Extension | Purpose | Repo |
+| --------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
+| GCP | Integrates with multiple Google Cloud Platform signing tools (AppEngine, IAM API, Cloud KMS) | https://github.com/someone1/gcp-jwt-go |
+| AWS | Integrates with AWS Key Management Service, KMS | https://github.com/matelang/jwt-go-aws-kms |
+| JWKS | Provides support for JWKS ([RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517)) as a `jwt.Keyfunc` | https://github.com/MicahParks/keyfunc |
+
+*Disclaimer*: Unless otherwise specified, these integrations are maintained by
+third parties and should not be considered as a primary offer by any of the
+mentioned cloud providers
+
+## More
+
+Go package documentation can be found [on
+pkg.go.dev](https://pkg.go.dev/github.com/golang-jwt/jwt/v5). Additional
+documentation can be found on [our project
+page](https://golang-jwt.github.io/jwt/).
+
+The command line utility included in this project (cmd/jwt) provides a
+straightforward example of token creation and parsing as well as a useful tool
+for debugging your own integration. You'll also find several implementation
+examples in the documentation.
+
+[golang-jwt](https://github.com/orgs/golang-jwt) incorporates a modified version
+of the JWT logo, which is distributed under the terms of the [MIT
+License](https://github.com/jsonwebtoken/jsonwebtoken.github.io/blob/master/LICENSE.txt).
diff --git a/vendor/github.com/golang-jwt/jwt/v5/SECURITY.md b/vendor/github.com/golang-jwt/jwt/v5/SECURITY.md
new file mode 100644
index 000000000..b08402c34
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/SECURITY.md
@@ -0,0 +1,19 @@
+# Security Policy
+
+## Supported Versions
+
+As of February 2022 (and until this document is updated), the latest version `v4` is supported.
+
+## Reporting a Vulnerability
+
+If you think you found a vulnerability, and even if you are not sure, please report it to jwt-go-security@googlegroups.com or one of the other [golang-jwt maintainers](https://github.com/orgs/golang-jwt/people). Please try be explicit, describe steps to reproduce the security issue with code example(s).
+
+You will receive a response within a timely manner. If the issue is confirmed, we will do our best to release a patch as soon as possible given the complexity of the problem.
+
+## Public Discussions
+
+Please avoid publicly discussing a potential security vulnerability.
+
+Let's take this offline and find a solution first, this limits the potential impact as much as possible.
+
+We appreciate your help!
diff --git a/vendor/github.com/golang-jwt/jwt/v5/VERSION_HISTORY.md b/vendor/github.com/golang-jwt/jwt/v5/VERSION_HISTORY.md
new file mode 100644
index 000000000..b5039e49c
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/VERSION_HISTORY.md
@@ -0,0 +1,137 @@
+# `jwt-go` Version History
+
+The following version history is kept for historic purposes. To retrieve the current changes of each version, please refer to the change-log of the specific release versions on https://github.com/golang-jwt/jwt/releases.
+
+## 4.0.0
+
+* Introduces support for Go modules. The `v4` version will be backwards compatible with `v3.x.y`.
+
+## 3.2.2
+
+* Starting from this release, we are adopting the policy to support the most 2 recent versions of Go currently available. By the time of this release, this is Go 1.15 and 1.16 ([#28](https://github.com/golang-jwt/jwt/pull/28)).
+* Fixed a potential issue that could occur when the verification of `exp`, `iat` or `nbf` was not required and contained invalid contents, i.e. non-numeric/date. Thanks for @thaJeztah for making us aware of that and @giorgos-f3 for originally reporting it to the formtech fork ([#40](https://github.com/golang-jwt/jwt/pull/40)).
+* Added support for EdDSA / ED25519 ([#36](https://github.com/golang-jwt/jwt/pull/36)).
+* Optimized allocations ([#33](https://github.com/golang-jwt/jwt/pull/33)).
+
+## 3.2.1
+
+* **Import Path Change**: See MIGRATION_GUIDE.md for tips on updating your code
+ * Changed the import path from `github.com/dgrijalva/jwt-go` to `github.com/golang-jwt/jwt`
+* Fixed type confusing issue between `string` and `[]string` in `VerifyAudience` ([#12](https://github.com/golang-jwt/jwt/pull/12)). This fixes CVE-2020-26160
+
+#### 3.2.0
+
+* Added method `ParseUnverified` to allow users to split up the tasks of parsing and validation
+* HMAC signing method returns `ErrInvalidKeyType` instead of `ErrInvalidKey` where appropriate
+* Added options to `request.ParseFromRequest`, which allows for an arbitrary list of modifiers to parsing behavior. Initial set include `WithClaims` and `WithParser`. Existing usage of this function will continue to work as before.
+* Deprecated `ParseFromRequestWithClaims` to simplify API in the future.
+
+#### 3.1.0
+
+* Improvements to `jwt` command line tool
+* Added `SkipClaimsValidation` option to `Parser`
+* Documentation updates
+
+#### 3.0.0
+
+* **Compatibility Breaking Changes**: See MIGRATION_GUIDE.md for tips on updating your code
+ * Dropped support for `[]byte` keys when using RSA signing methods. This convenience feature could contribute to security vulnerabilities involving mismatched key types with signing methods.
+ * `ParseFromRequest` has been moved to `request` subpackage and usage has changed
+ * The `Claims` property on `Token` is now type `Claims` instead of `map[string]interface{}`. The default value is type `MapClaims`, which is an alias to `map[string]interface{}`. This makes it possible to use a custom type when decoding claims.
+* Other Additions and Changes
+ * Added `Claims` interface type to allow users to decode the claims into a custom type
+ * Added `ParseWithClaims`, which takes a third argument of type `Claims`. Use this function instead of `Parse` if you have a custom type you'd like to decode into.
+ * Dramatically improved the functionality and flexibility of `ParseFromRequest`, which is now in the `request` subpackage
+ * Added `ParseFromRequestWithClaims` which is the `FromRequest` equivalent of `ParseWithClaims`
+ * Added new interface type `Extractor`, which is used for extracting JWT strings from http requests. Used with `ParseFromRequest` and `ParseFromRequestWithClaims`.
+ * Added several new, more specific, validation errors to error type bitmask
+ * Moved examples from README to executable example files
+ * Signing method registry is now thread safe
+ * Added new property to `ValidationError`, which contains the raw error returned by calls made by parse/verify (such as those returned by keyfunc or json parser)
+
+#### 2.7.0
+
+This will likely be the last backwards compatible release before 3.0.0, excluding essential bug fixes.
+
+* Added new option `-show` to the `jwt` command that will just output the decoded token without verifying
+* Error text for expired tokens includes how long it's been expired
+* Fixed incorrect error returned from `ParseRSAPublicKeyFromPEM`
+* Documentation updates
+
+#### 2.6.0
+
+* Exposed inner error within ValidationError
+* Fixed validation errors when using UseJSONNumber flag
+* Added several unit tests
+
+#### 2.5.0
+
+* Added support for signing method none. You shouldn't use this. The API tries to make this clear.
+* Updated/fixed some documentation
+* Added more helpful error message when trying to parse tokens that begin with `BEARER `
+
+#### 2.4.0
+
+* Added new type, Parser, to allow for configuration of various parsing parameters
+ * You can now specify a list of valid signing methods. Anything outside this set will be rejected.
+ * You can now opt to use the `json.Number` type instead of `float64` when parsing token JSON
+* Added support for [Travis CI](https://travis-ci.org/dgrijalva/jwt-go)
+* Fixed some bugs with ECDSA parsing
+
+#### 2.3.0
+
+* Added support for ECDSA signing methods
+* Added support for RSA PSS signing methods (requires go v1.4)
+
+#### 2.2.0
+
+* Gracefully handle a `nil` `Keyfunc` being passed to `Parse`. Result will now be the parsed token and an error, instead of a panic.
+
+#### 2.1.0
+
+Backwards compatible API change that was missed in 2.0.0.
+
+* The `SignedString` method on `Token` now takes `interface{}` instead of `[]byte`
+
+#### 2.0.0
+
+There were two major reasons for breaking backwards compatibility with this update. The first was a refactor required to expand the width of the RSA and HMAC-SHA signing implementations. There will likely be no required code changes to support this change.
+
+The second update, while unfortunately requiring a small change in integration, is required to open up this library to other signing methods. Not all keys used for all signing methods have a single standard on-disk representation. Requiring `[]byte` as the type for all keys proved too limiting. Additionally, this implementation allows for pre-parsed tokens to be reused, which might matter in an application that parses a high volume of tokens with a small set of keys. Backwards compatibilty has been maintained for passing `[]byte` to the RSA signing methods, but they will also accept `*rsa.PublicKey` and `*rsa.PrivateKey`.
+
+It is likely the only integration change required here will be to change `func(t *jwt.Token) ([]byte, error)` to `func(t *jwt.Token) (interface{}, error)` when calling `Parse`.
+
+* **Compatibility Breaking Changes**
+ * `SigningMethodHS256` is now `*SigningMethodHMAC` instead of `type struct`
+ * `SigningMethodRS256` is now `*SigningMethodRSA` instead of `type struct`
+ * `KeyFunc` now returns `interface{}` instead of `[]byte`
+ * `SigningMethod.Sign` now takes `interface{}` instead of `[]byte` for the key
+ * `SigningMethod.Verify` now takes `interface{}` instead of `[]byte` for the key
+* Renamed type `SigningMethodHS256` to `SigningMethodHMAC`. Specific sizes are now just instances of this type.
+ * Added public package global `SigningMethodHS256`
+ * Added public package global `SigningMethodHS384`
+ * Added public package global `SigningMethodHS512`
+* Renamed type `SigningMethodRS256` to `SigningMethodRSA`. Specific sizes are now just instances of this type.
+ * Added public package global `SigningMethodRS256`
+ * Added public package global `SigningMethodRS384`
+ * Added public package global `SigningMethodRS512`
+* Moved sample private key for HMAC tests from an inline value to a file on disk. Value is unchanged.
+* Refactored the RSA implementation to be easier to read
+* Exposed helper methods `ParseRSAPrivateKeyFromPEM` and `ParseRSAPublicKeyFromPEM`
+
+## 1.0.2
+
+* Fixed bug in parsing public keys from certificates
+* Added more tests around the parsing of keys for RS256
+* Code refactoring in RS256 implementation. No functional changes
+
+## 1.0.1
+
+* Fixed panic if RS256 signing method was passed an invalid key
+
+## 1.0.0
+
+* First versioned release
+* API stabilized
+* Supports creating, signing, parsing, and validating JWT tokens
+* Supports RS256 and HS256 signing methods
diff --git a/vendor/github.com/golang-jwt/jwt/v5/claims.go b/vendor/github.com/golang-jwt/jwt/v5/claims.go
new file mode 100644
index 000000000..d50ff3dad
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/claims.go
@@ -0,0 +1,16 @@
+package jwt
+
+// Claims represent any form of a JWT Claims Set according to
+// https://datatracker.ietf.org/doc/html/rfc7519#section-4. In order to have a
+// common basis for validation, it is required that an implementation is able to
+// supply at least the claim names provided in
+// https://datatracker.ietf.org/doc/html/rfc7519#section-4.1 namely `exp`,
+// `iat`, `nbf`, `iss`, `sub` and `aud`.
+type Claims interface {
+ GetExpirationTime() (*NumericDate, error)
+ GetIssuedAt() (*NumericDate, error)
+ GetNotBefore() (*NumericDate, error)
+ GetIssuer() (string, error)
+ GetSubject() (string, error)
+ GetAudience() (ClaimStrings, error)
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/doc.go b/vendor/github.com/golang-jwt/jwt/v5/doc.go
new file mode 100644
index 000000000..a86dc1a3b
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/doc.go
@@ -0,0 +1,4 @@
+// Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html
+//
+// See README.md for more info.
+package jwt
diff --git a/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go b/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go
new file mode 100644
index 000000000..4ccae2a85
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/ecdsa.go
@@ -0,0 +1,134 @@
+package jwt
+
+import (
+ "crypto"
+ "crypto/ecdsa"
+ "crypto/rand"
+ "errors"
+ "math/big"
+)
+
+var (
+ // Sadly this is missing from crypto/ecdsa compared to crypto/rsa
+ ErrECDSAVerification = errors.New("crypto/ecdsa: verification error")
+)
+
+// SigningMethodECDSA implements the ECDSA family of signing methods.
+// Expects *ecdsa.PrivateKey for signing and *ecdsa.PublicKey for verification
+type SigningMethodECDSA struct {
+ Name string
+ Hash crypto.Hash
+ KeySize int
+ CurveBits int
+}
+
+// Specific instances for EC256 and company
+var (
+ SigningMethodES256 *SigningMethodECDSA
+ SigningMethodES384 *SigningMethodECDSA
+ SigningMethodES512 *SigningMethodECDSA
+)
+
+func init() {
+ // ES256
+ SigningMethodES256 = &SigningMethodECDSA{"ES256", crypto.SHA256, 32, 256}
+ RegisterSigningMethod(SigningMethodES256.Alg(), func() SigningMethod {
+ return SigningMethodES256
+ })
+
+ // ES384
+ SigningMethodES384 = &SigningMethodECDSA{"ES384", crypto.SHA384, 48, 384}
+ RegisterSigningMethod(SigningMethodES384.Alg(), func() SigningMethod {
+ return SigningMethodES384
+ })
+
+ // ES512
+ SigningMethodES512 = &SigningMethodECDSA{"ES512", crypto.SHA512, 66, 521}
+ RegisterSigningMethod(SigningMethodES512.Alg(), func() SigningMethod {
+ return SigningMethodES512
+ })
+}
+
+func (m *SigningMethodECDSA) Alg() string {
+ return m.Name
+}
+
+// Verify implements token verification for the SigningMethod.
+// For this verify method, key must be an ecdsa.PublicKey struct
+func (m *SigningMethodECDSA) Verify(signingString string, sig []byte, key interface{}) error {
+ // Get the key
+ var ecdsaKey *ecdsa.PublicKey
+ switch k := key.(type) {
+ case *ecdsa.PublicKey:
+ ecdsaKey = k
+ default:
+ return ErrInvalidKeyType
+ }
+
+ if len(sig) != 2*m.KeySize {
+ return ErrECDSAVerification
+ }
+
+ r := big.NewInt(0).SetBytes(sig[:m.KeySize])
+ s := big.NewInt(0).SetBytes(sig[m.KeySize:])
+
+ // Create hasher
+ if !m.Hash.Available() {
+ return ErrHashUnavailable
+ }
+ hasher := m.Hash.New()
+ hasher.Write([]byte(signingString))
+
+ // Verify the signature
+ if verifystatus := ecdsa.Verify(ecdsaKey, hasher.Sum(nil), r, s); verifystatus {
+ return nil
+ }
+
+ return ErrECDSAVerification
+}
+
+// Sign implements token signing for the SigningMethod.
+// For this signing method, key must be an ecdsa.PrivateKey struct
+func (m *SigningMethodECDSA) Sign(signingString string, key interface{}) ([]byte, error) {
+ // Get the key
+ var ecdsaKey *ecdsa.PrivateKey
+ switch k := key.(type) {
+ case *ecdsa.PrivateKey:
+ ecdsaKey = k
+ default:
+ return nil, ErrInvalidKeyType
+ }
+
+ // Create the hasher
+ if !m.Hash.Available() {
+ return nil, ErrHashUnavailable
+ }
+
+ hasher := m.Hash.New()
+ hasher.Write([]byte(signingString))
+
+ // Sign the string and return r, s
+ if r, s, err := ecdsa.Sign(rand.Reader, ecdsaKey, hasher.Sum(nil)); err == nil {
+ curveBits := ecdsaKey.Curve.Params().BitSize
+
+ if m.CurveBits != curveBits {
+ return nil, ErrInvalidKey
+ }
+
+ keyBytes := curveBits / 8
+ if curveBits%8 > 0 {
+ keyBytes += 1
+ }
+
+ // We serialize the outputs (r and s) into big-endian byte arrays
+ // padded with zeros on the left to make sure the sizes work out.
+ // Output must be 2*keyBytes long.
+ out := make([]byte, 2*keyBytes)
+ r.FillBytes(out[0:keyBytes]) // r is assigned to the first half of output.
+ s.FillBytes(out[keyBytes:]) // s is assigned to the second half of output.
+
+ return out, nil
+ } else {
+ return nil, err
+ }
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go b/vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go
new file mode 100644
index 000000000..5700636d3
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go
@@ -0,0 +1,69 @@
+package jwt
+
+import (
+ "crypto/ecdsa"
+ "crypto/x509"
+ "encoding/pem"
+ "errors"
+)
+
+var (
+ ErrNotECPublicKey = errors.New("key is not a valid ECDSA public key")
+ ErrNotECPrivateKey = errors.New("key is not a valid ECDSA private key")
+)
+
+// ParseECPrivateKeyFromPEM parses a PEM encoded Elliptic Curve Private Key Structure
+func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) {
+ var err error
+
+ // Parse PEM block
+ var block *pem.Block
+ if block, _ = pem.Decode(key); block == nil {
+ return nil, ErrKeyMustBePEMEncoded
+ }
+
+ // Parse the key
+ var parsedKey interface{}
+ if parsedKey, err = x509.ParseECPrivateKey(block.Bytes); err != nil {
+ if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil {
+ return nil, err
+ }
+ }
+
+ var pkey *ecdsa.PrivateKey
+ var ok bool
+ if pkey, ok = parsedKey.(*ecdsa.PrivateKey); !ok {
+ return nil, ErrNotECPrivateKey
+ }
+
+ return pkey, nil
+}
+
+// ParseECPublicKeyFromPEM parses a PEM encoded PKCS1 or PKCS8 public key
+func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error) {
+ var err error
+
+ // Parse PEM block
+ var block *pem.Block
+ if block, _ = pem.Decode(key); block == nil {
+ return nil, ErrKeyMustBePEMEncoded
+ }
+
+ // Parse the key
+ var parsedKey interface{}
+ if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil {
+ if cert, err := x509.ParseCertificate(block.Bytes); err == nil {
+ parsedKey = cert.PublicKey
+ } else {
+ return nil, err
+ }
+ }
+
+ var pkey *ecdsa.PublicKey
+ var ok bool
+ if pkey, ok = parsedKey.(*ecdsa.PublicKey); !ok {
+ return nil, ErrNotECPublicKey
+ }
+
+ return pkey, nil
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/ed25519.go b/vendor/github.com/golang-jwt/jwt/v5/ed25519.go
new file mode 100644
index 000000000..3db00e4a2
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/ed25519.go
@@ -0,0 +1,80 @@
+package jwt
+
+import (
+ "errors"
+
+ "crypto"
+ "crypto/ed25519"
+ "crypto/rand"
+)
+
+var (
+ ErrEd25519Verification = errors.New("ed25519: verification error")
+)
+
+// SigningMethodEd25519 implements the EdDSA family.
+// Expects ed25519.PrivateKey for signing and ed25519.PublicKey for verification
+type SigningMethodEd25519 struct{}
+
+// Specific instance for EdDSA
+var (
+ SigningMethodEdDSA *SigningMethodEd25519
+)
+
+func init() {
+ SigningMethodEdDSA = &SigningMethodEd25519{}
+ RegisterSigningMethod(SigningMethodEdDSA.Alg(), func() SigningMethod {
+ return SigningMethodEdDSA
+ })
+}
+
+func (m *SigningMethodEd25519) Alg() string {
+ return "EdDSA"
+}
+
+// Verify implements token verification for the SigningMethod.
+// For this verify method, key must be an ed25519.PublicKey
+func (m *SigningMethodEd25519) Verify(signingString string, sig []byte, key interface{}) error {
+ var ed25519Key ed25519.PublicKey
+ var ok bool
+
+ if ed25519Key, ok = key.(ed25519.PublicKey); !ok {
+ return ErrInvalidKeyType
+ }
+
+ if len(ed25519Key) != ed25519.PublicKeySize {
+ return ErrInvalidKey
+ }
+
+ // Verify the signature
+ if !ed25519.Verify(ed25519Key, []byte(signingString), sig) {
+ return ErrEd25519Verification
+ }
+
+ return nil
+}
+
+// Sign implements token signing for the SigningMethod.
+// For this signing method, key must be an ed25519.PrivateKey
+func (m *SigningMethodEd25519) Sign(signingString string, key interface{}) ([]byte, error) {
+ var ed25519Key crypto.Signer
+ var ok bool
+
+ if ed25519Key, ok = key.(crypto.Signer); !ok {
+ return nil, ErrInvalidKeyType
+ }
+
+ if _, ok := ed25519Key.Public().(ed25519.PublicKey); !ok {
+ return nil, ErrInvalidKey
+ }
+
+ // Sign the string and return the result. ed25519 performs a two-pass hash
+ // as part of its algorithm. Therefore, we need to pass a non-prehashed
+ // message into the Sign function, as indicated by crypto.Hash(0)
+ sig, err := ed25519Key.Sign(rand.Reader, []byte(signingString), crypto.Hash(0))
+ if err != nil {
+ return nil, err
+ }
+
+ return sig, nil
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go b/vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go
new file mode 100644
index 000000000..cdb5e68e8
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go
@@ -0,0 +1,64 @@
+package jwt
+
+import (
+ "crypto"
+ "crypto/ed25519"
+ "crypto/x509"
+ "encoding/pem"
+ "errors"
+)
+
+var (
+ ErrNotEdPrivateKey = errors.New("key is not a valid Ed25519 private key")
+ ErrNotEdPublicKey = errors.New("key is not a valid Ed25519 public key")
+)
+
+// ParseEdPrivateKeyFromPEM parses a PEM-encoded Edwards curve private key
+func ParseEdPrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error) {
+ var err error
+
+ // Parse PEM block
+ var block *pem.Block
+ if block, _ = pem.Decode(key); block == nil {
+ return nil, ErrKeyMustBePEMEncoded
+ }
+
+ // Parse the key
+ var parsedKey interface{}
+ if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil {
+ return nil, err
+ }
+
+ var pkey ed25519.PrivateKey
+ var ok bool
+ if pkey, ok = parsedKey.(ed25519.PrivateKey); !ok {
+ return nil, ErrNotEdPrivateKey
+ }
+
+ return pkey, nil
+}
+
+// ParseEdPublicKeyFromPEM parses a PEM-encoded Edwards curve public key
+func ParseEdPublicKeyFromPEM(key []byte) (crypto.PublicKey, error) {
+ var err error
+
+ // Parse PEM block
+ var block *pem.Block
+ if block, _ = pem.Decode(key); block == nil {
+ return nil, ErrKeyMustBePEMEncoded
+ }
+
+ // Parse the key
+ var parsedKey interface{}
+ if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil {
+ return nil, err
+ }
+
+ var pkey ed25519.PublicKey
+ var ok bool
+ if pkey, ok = parsedKey.(ed25519.PublicKey); !ok {
+ return nil, ErrNotEdPublicKey
+ }
+
+ return pkey, nil
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/errors.go b/vendor/github.com/golang-jwt/jwt/v5/errors.go
new file mode 100644
index 000000000..23bb616dd
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/errors.go
@@ -0,0 +1,49 @@
+package jwt
+
+import (
+ "errors"
+ "strings"
+)
+
+var (
+ ErrInvalidKey = errors.New("key is invalid")
+ ErrInvalidKeyType = errors.New("key is of invalid type")
+ ErrHashUnavailable = errors.New("the requested hash function is unavailable")
+ ErrTokenMalformed = errors.New("token is malformed")
+ ErrTokenUnverifiable = errors.New("token is unverifiable")
+ ErrTokenSignatureInvalid = errors.New("token signature is invalid")
+ ErrTokenRequiredClaimMissing = errors.New("token is missing required claim")
+ ErrTokenInvalidAudience = errors.New("token has invalid audience")
+ ErrTokenExpired = errors.New("token is expired")
+ ErrTokenUsedBeforeIssued = errors.New("token used before issued")
+ ErrTokenInvalidIssuer = errors.New("token has invalid issuer")
+ ErrTokenInvalidSubject = errors.New("token has invalid subject")
+ ErrTokenNotValidYet = errors.New("token is not valid yet")
+ ErrTokenInvalidId = errors.New("token has invalid id")
+ ErrTokenInvalidClaims = errors.New("token has invalid claims")
+ ErrInvalidType = errors.New("invalid type for claim")
+)
+
+// joinedError is an error type that works similar to what [errors.Join]
+// produces, with the exception that it has a nice error string; mainly its
+// error messages are concatenated using a comma, rather than a newline.
+type joinedError struct {
+ errs []error
+}
+
+func (je joinedError) Error() string {
+ msg := []string{}
+ for _, err := range je.errs {
+ msg = append(msg, err.Error())
+ }
+
+ return strings.Join(msg, ", ")
+}
+
+// joinErrors joins together multiple errors. Useful for scenarios where
+// multiple errors next to each other occur, e.g., in claims validation.
+func joinErrors(errs ...error) error {
+ return &joinedError{
+ errs: errs,
+ }
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go b/vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go
new file mode 100644
index 000000000..a893d355e
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go
@@ -0,0 +1,47 @@
+//go:build go1.20
+// +build go1.20
+
+package jwt
+
+import (
+ "fmt"
+)
+
+// Unwrap implements the multiple error unwrapping for this error type, which is
+// possible in Go 1.20.
+func (je joinedError) Unwrap() []error {
+ return je.errs
+}
+
+// newError creates a new error message with a detailed error message. The
+// message will be prefixed with the contents of the supplied error type.
+// Additionally, more errors, that provide more context can be supplied which
+// will be appended to the message. This makes use of Go 1.20's possibility to
+// include more than one %w formatting directive in [fmt.Errorf].
+//
+// For example,
+//
+// newError("no keyfunc was provided", ErrTokenUnverifiable)
+//
+// will produce the error string
+//
+// "token is unverifiable: no keyfunc was provided"
+func newError(message string, err error, more ...error) error {
+ var format string
+ var args []any
+ if message != "" {
+ format = "%w: %s"
+ args = []any{err, message}
+ } else {
+ format = "%w"
+ args = []any{err}
+ }
+
+ for _, e := range more {
+ format += ": %w"
+ args = append(args, e)
+ }
+
+ err = fmt.Errorf(format, args...)
+ return err
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go b/vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go
new file mode 100644
index 000000000..3afb04e64
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go
@@ -0,0 +1,78 @@
+//go:build !go1.20
+// +build !go1.20
+
+package jwt
+
+import (
+ "errors"
+ "fmt"
+)
+
+// Is implements checking for multiple errors using [errors.Is], since multiple
+// error unwrapping is not possible in versions less than Go 1.20.
+func (je joinedError) Is(err error) bool {
+ for _, e := range je.errs {
+ if errors.Is(e, err) {
+ return true
+ }
+ }
+
+ return false
+}
+
+// wrappedErrors is a workaround for wrapping multiple errors in environments
+// where Go 1.20 is not available. It basically uses the already implemented
+// functionatlity of joinedError to handle multiple errors with supplies a
+// custom error message that is identical to the one we produce in Go 1.20 using
+// multiple %w directives.
+type wrappedErrors struct {
+ msg string
+ joinedError
+}
+
+// Error returns the stored error string
+func (we wrappedErrors) Error() string {
+ return we.msg
+}
+
+// newError creates a new error message with a detailed error message. The
+// message will be prefixed with the contents of the supplied error type.
+// Additionally, more errors, that provide more context can be supplied which
+// will be appended to the message. Since we cannot use of Go 1.20's possibility
+// to include more than one %w formatting directive in [fmt.Errorf], we have to
+// emulate that.
+//
+// For example,
+//
+// newError("no keyfunc was provided", ErrTokenUnverifiable)
+//
+// will produce the error string
+//
+// "token is unverifiable: no keyfunc was provided"
+func newError(message string, err error, more ...error) error {
+ // We cannot wrap multiple errors here with %w, so we have to be a little
+ // bit creative. Basically, we are using %s instead of %w to produce the
+ // same error message and then throw the result into a custom error struct.
+ var format string
+ var args []any
+ if message != "" {
+ format = "%s: %s"
+ args = []any{err, message}
+ } else {
+ format = "%s"
+ args = []any{err}
+ }
+ errs := []error{err}
+
+ for _, e := range more {
+ format += ": %s"
+ args = append(args, e)
+ errs = append(errs, e)
+ }
+
+ err = &wrappedErrors{
+ msg: fmt.Sprintf(format, args...),
+ joinedError: joinedError{errs: errs},
+ }
+ return err
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/hmac.go b/vendor/github.com/golang-jwt/jwt/v5/hmac.go
new file mode 100644
index 000000000..91b688ba9
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/hmac.go
@@ -0,0 +1,104 @@
+package jwt
+
+import (
+ "crypto"
+ "crypto/hmac"
+ "errors"
+)
+
+// SigningMethodHMAC implements the HMAC-SHA family of signing methods.
+// Expects key type of []byte for both signing and validation
+type SigningMethodHMAC struct {
+ Name string
+ Hash crypto.Hash
+}
+
+// Specific instances for HS256 and company
+var (
+ SigningMethodHS256 *SigningMethodHMAC
+ SigningMethodHS384 *SigningMethodHMAC
+ SigningMethodHS512 *SigningMethodHMAC
+ ErrSignatureInvalid = errors.New("signature is invalid")
+)
+
+func init() {
+ // HS256
+ SigningMethodHS256 = &SigningMethodHMAC{"HS256", crypto.SHA256}
+ RegisterSigningMethod(SigningMethodHS256.Alg(), func() SigningMethod {
+ return SigningMethodHS256
+ })
+
+ // HS384
+ SigningMethodHS384 = &SigningMethodHMAC{"HS384", crypto.SHA384}
+ RegisterSigningMethod(SigningMethodHS384.Alg(), func() SigningMethod {
+ return SigningMethodHS384
+ })
+
+ // HS512
+ SigningMethodHS512 = &SigningMethodHMAC{"HS512", crypto.SHA512}
+ RegisterSigningMethod(SigningMethodHS512.Alg(), func() SigningMethod {
+ return SigningMethodHS512
+ })
+}
+
+func (m *SigningMethodHMAC) Alg() string {
+ return m.Name
+}
+
+// Verify implements token verification for the SigningMethod. Returns nil if
+// the signature is valid. Key must be []byte.
+//
+// Note it is not advised to provide a []byte which was converted from a 'human
+// readable' string using a subset of ASCII characters. To maximize entropy, you
+// should ideally be providing a []byte key which was produced from a
+// cryptographically random source, e.g. crypto/rand. Additional information
+// about this, and why we intentionally are not supporting string as a key can
+// be found on our usage guide
+// https://golang-jwt.github.io/jwt/usage/signing_methods/#signing-methods-and-key-types.
+func (m *SigningMethodHMAC) Verify(signingString string, sig []byte, key interface{}) error {
+ // Verify the key is the right type
+ keyBytes, ok := key.([]byte)
+ if !ok {
+ return ErrInvalidKeyType
+ }
+
+ // Can we use the specified hashing method?
+ if !m.Hash.Available() {
+ return ErrHashUnavailable
+ }
+
+ // This signing method is symmetric, so we validate the signature
+ // by reproducing the signature from the signing string and key, then
+ // comparing that against the provided signature.
+ hasher := hmac.New(m.Hash.New, keyBytes)
+ hasher.Write([]byte(signingString))
+ if !hmac.Equal(sig, hasher.Sum(nil)) {
+ return ErrSignatureInvalid
+ }
+
+ // No validation errors. Signature is good.
+ return nil
+}
+
+// Sign implements token signing for the SigningMethod. Key must be []byte.
+//
+// Note it is not advised to provide a []byte which was converted from a 'human
+// readable' string using a subset of ASCII characters. To maximize entropy, you
+// should ideally be providing a []byte key which was produced from a
+// cryptographically random source, e.g. crypto/rand. Additional information
+// about this, and why we intentionally are not supporting string as a key can
+// be found on our usage guide https://golang-jwt.github.io/jwt/usage/signing_methods/.
+func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) ([]byte, error) {
+ if keyBytes, ok := key.([]byte); ok {
+ if !m.Hash.Available() {
+ return nil, ErrHashUnavailable
+ }
+
+ hasher := hmac.New(m.Hash.New, keyBytes)
+ hasher.Write([]byte(signingString))
+
+ return hasher.Sum(nil), nil
+ }
+
+ return nil, ErrInvalidKeyType
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/map_claims.go b/vendor/github.com/golang-jwt/jwt/v5/map_claims.go
new file mode 100644
index 000000000..b2b51a1f8
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/map_claims.go
@@ -0,0 +1,109 @@
+package jwt
+
+import (
+ "encoding/json"
+ "fmt"
+)
+
+// MapClaims is a claims type that uses the map[string]interface{} for JSON
+// decoding. This is the default claims type if you don't supply one
+type MapClaims map[string]interface{}
+
+// GetExpirationTime implements the Claims interface.
+func (m MapClaims) GetExpirationTime() (*NumericDate, error) {
+ return m.parseNumericDate("exp")
+}
+
+// GetNotBefore implements the Claims interface.
+func (m MapClaims) GetNotBefore() (*NumericDate, error) {
+ return m.parseNumericDate("nbf")
+}
+
+// GetIssuedAt implements the Claims interface.
+func (m MapClaims) GetIssuedAt() (*NumericDate, error) {
+ return m.parseNumericDate("iat")
+}
+
+// GetAudience implements the Claims interface.
+func (m MapClaims) GetAudience() (ClaimStrings, error) {
+ return m.parseClaimsString("aud")
+}
+
+// GetIssuer implements the Claims interface.
+func (m MapClaims) GetIssuer() (string, error) {
+ return m.parseString("iss")
+}
+
+// GetSubject implements the Claims interface.
+func (m MapClaims) GetSubject() (string, error) {
+ return m.parseString("sub")
+}
+
+// parseNumericDate tries to parse a key in the map claims type as a number
+// date. This will succeed, if the underlying type is either a [float64] or a
+// [json.Number]. Otherwise, nil will be returned.
+func (m MapClaims) parseNumericDate(key string) (*NumericDate, error) {
+ v, ok := m[key]
+ if !ok {
+ return nil, nil
+ }
+
+ switch exp := v.(type) {
+ case float64:
+ if exp == 0 {
+ return nil, nil
+ }
+
+ return newNumericDateFromSeconds(exp), nil
+ case json.Number:
+ v, _ := exp.Float64()
+
+ return newNumericDateFromSeconds(v), nil
+ }
+
+ return nil, newError(fmt.Sprintf("%s is invalid", key), ErrInvalidType)
+}
+
+// parseClaimsString tries to parse a key in the map claims type as a
+// [ClaimsStrings] type, which can either be a string or an array of string.
+func (m MapClaims) parseClaimsString(key string) (ClaimStrings, error) {
+ var cs []string
+ switch v := m[key].(type) {
+ case string:
+ cs = append(cs, v)
+ case []string:
+ cs = v
+ case []interface{}:
+ for _, a := range v {
+ vs, ok := a.(string)
+ if !ok {
+ return nil, newError(fmt.Sprintf("%s is invalid", key), ErrInvalidType)
+ }
+ cs = append(cs, vs)
+ }
+ }
+
+ return cs, nil
+}
+
+// parseString tries to parse a key in the map claims type as a [string] type.
+// If the key does not exist, an empty string is returned. If the key has the
+// wrong type, an error is returned.
+func (m MapClaims) parseString(key string) (string, error) {
+ var (
+ ok bool
+ raw interface{}
+ iss string
+ )
+ raw, ok = m[key]
+ if !ok {
+ return "", nil
+ }
+
+ iss, ok = raw.(string)
+ if !ok {
+ return "", newError(fmt.Sprintf("%s is invalid", key), ErrInvalidType)
+ }
+
+ return iss, nil
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/none.go b/vendor/github.com/golang-jwt/jwt/v5/none.go
new file mode 100644
index 000000000..c93daa584
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/none.go
@@ -0,0 +1,50 @@
+package jwt
+
+// SigningMethodNone implements the none signing method. This is required by the spec
+// but you probably should never use it.
+var SigningMethodNone *signingMethodNone
+
+const UnsafeAllowNoneSignatureType unsafeNoneMagicConstant = "none signing method allowed"
+
+var NoneSignatureTypeDisallowedError error
+
+type signingMethodNone struct{}
+type unsafeNoneMagicConstant string
+
+func init() {
+ SigningMethodNone = &signingMethodNone{}
+ NoneSignatureTypeDisallowedError = newError("'none' signature type is not allowed", ErrTokenUnverifiable)
+
+ RegisterSigningMethod(SigningMethodNone.Alg(), func() SigningMethod {
+ return SigningMethodNone
+ })
+}
+
+func (m *signingMethodNone) Alg() string {
+ return "none"
+}
+
+// Only allow 'none' alg type if UnsafeAllowNoneSignatureType is specified as the key
+func (m *signingMethodNone) Verify(signingString string, sig []byte, key interface{}) (err error) {
+ // Key must be UnsafeAllowNoneSignatureType to prevent accidentally
+ // accepting 'none' signing method
+ if _, ok := key.(unsafeNoneMagicConstant); !ok {
+ return NoneSignatureTypeDisallowedError
+ }
+ // If signing method is none, signature must be an empty string
+ if string(sig) != "" {
+ return newError("'none' signing method with non-empty signature", ErrTokenUnverifiable)
+ }
+
+ // Accept 'none' signing method.
+ return nil
+}
+
+// Only allow 'none' signing if UnsafeAllowNoneSignatureType is specified as the key
+func (m *signingMethodNone) Sign(signingString string, key interface{}) ([]byte, error) {
+ if _, ok := key.(unsafeNoneMagicConstant); ok {
+ return []byte{}, nil
+ }
+
+ return nil, NoneSignatureTypeDisallowedError
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/parser.go b/vendor/github.com/golang-jwt/jwt/v5/parser.go
new file mode 100644
index 000000000..f4386fbaa
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/parser.go
@@ -0,0 +1,215 @@
+package jwt
+
+import (
+ "bytes"
+ "encoding/base64"
+ "encoding/json"
+ "fmt"
+ "strings"
+)
+
+type Parser struct {
+ // If populated, only these methods will be considered valid.
+ validMethods []string
+
+ // Use JSON Number format in JSON decoder.
+ useJSONNumber bool
+
+ // Skip claims validation during token parsing.
+ skipClaimsValidation bool
+
+ validator *validator
+
+ decodeStrict bool
+
+ decodePaddingAllowed bool
+}
+
+// NewParser creates a new Parser with the specified options
+func NewParser(options ...ParserOption) *Parser {
+ p := &Parser{
+ validator: &validator{},
+ }
+
+ // Loop through our parsing options and apply them
+ for _, option := range options {
+ option(p)
+ }
+
+ return p
+}
+
+// Parse parses, validates, verifies the signature and returns the parsed token.
+// keyFunc will receive the parsed token and should return the key for validating.
+func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
+ return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc)
+}
+
+// ParseWithClaims parses, validates, and verifies like Parse, but supplies a default object implementing the Claims
+// interface. This provides default values which can be overridden and allows a caller to use their own type, rather
+// than the default MapClaims implementation of Claims.
+//
+// Note: If you provide a custom claim implementation that embeds one of the standard claims (such as RegisteredClaims),
+// make sure that a) you either embed a non-pointer version of the claims or b) if you are using a pointer, allocate the
+// proper memory for it before passing in the overall claims, otherwise you might run into a panic.
+func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) {
+ token, parts, err := p.ParseUnverified(tokenString, claims)
+ if err != nil {
+ return token, err
+ }
+
+ // Verify signing method is in the required set
+ if p.validMethods != nil {
+ var signingMethodValid = false
+ var alg = token.Method.Alg()
+ for _, m := range p.validMethods {
+ if m == alg {
+ signingMethodValid = true
+ break
+ }
+ }
+ if !signingMethodValid {
+ // signing method is not in the listed set
+ return token, newError(fmt.Sprintf("signing method %v is invalid", alg), ErrTokenSignatureInvalid)
+ }
+ }
+
+ // Lookup key
+ var key interface{}
+ if keyFunc == nil {
+ // keyFunc was not provided. short circuiting validation
+ return token, newError("no keyfunc was provided", ErrTokenUnverifiable)
+ }
+ if key, err = keyFunc(token); err != nil {
+ return token, newError("error while executing keyfunc", ErrTokenUnverifiable, err)
+ }
+
+ // Decode signature
+ token.Signature, err = p.DecodeSegment(parts[2])
+ if err != nil {
+ return token, newError("could not base64 decode signature", ErrTokenMalformed, err)
+ }
+
+ // Perform signature validation
+ if err = token.Method.Verify(strings.Join(parts[0:2], "."), token.Signature, key); err != nil {
+ return token, newError("", ErrTokenSignatureInvalid, err)
+ }
+
+ // Validate Claims
+ if !p.skipClaimsValidation {
+ // Make sure we have at least a default validator
+ if p.validator == nil {
+ p.validator = newValidator()
+ }
+
+ if err := p.validator.Validate(claims); err != nil {
+ return token, newError("", ErrTokenInvalidClaims, err)
+ }
+ }
+
+ // No errors so far, token is valid.
+ token.Valid = true
+
+ return token, nil
+}
+
+// ParseUnverified parses the token but doesn't validate the signature.
+//
+// WARNING: Don't use this method unless you know what you're doing.
+//
+// It's only ever useful in cases where you know the signature is valid (because it has
+// been checked previously in the stack) and you want to extract values from it.
+func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Token, parts []string, err error) {
+ parts = strings.Split(tokenString, ".")
+ if len(parts) != 3 {
+ return nil, parts, newError("token contains an invalid number of segments", ErrTokenMalformed)
+ }
+
+ token = &Token{Raw: tokenString}
+
+ // parse Header
+ var headerBytes []byte
+ if headerBytes, err = p.DecodeSegment(parts[0]); err != nil {
+ if strings.HasPrefix(strings.ToLower(tokenString), "bearer ") {
+ return token, parts, newError("tokenstring should not contain 'bearer '", ErrTokenMalformed)
+ }
+ return token, parts, newError("could not base64 decode header", ErrTokenMalformed, err)
+ }
+ if err = json.Unmarshal(headerBytes, &token.Header); err != nil {
+ return token, parts, newError("could not JSON decode header", ErrTokenMalformed, err)
+ }
+
+ // parse Claims
+ var claimBytes []byte
+ token.Claims = claims
+
+ if claimBytes, err = p.DecodeSegment(parts[1]); err != nil {
+ return token, parts, newError("could not base64 decode claim", ErrTokenMalformed, err)
+ }
+ dec := json.NewDecoder(bytes.NewBuffer(claimBytes))
+ if p.useJSONNumber {
+ dec.UseNumber()
+ }
+ // JSON Decode. Special case for map type to avoid weird pointer behavior
+ if c, ok := token.Claims.(MapClaims); ok {
+ err = dec.Decode(&c)
+ } else {
+ err = dec.Decode(&claims)
+ }
+ // Handle decode error
+ if err != nil {
+ return token, parts, newError("could not JSON decode claim", ErrTokenMalformed, err)
+ }
+
+ // Lookup signature method
+ if method, ok := token.Header["alg"].(string); ok {
+ if token.Method = GetSigningMethod(method); token.Method == nil {
+ return token, parts, newError("signing method (alg) is unavailable", ErrTokenUnverifiable)
+ }
+ } else {
+ return token, parts, newError("signing method (alg) is unspecified", ErrTokenUnverifiable)
+ }
+
+ return token, parts, nil
+}
+
+// DecodeSegment decodes a JWT specific base64url encoding. This function will
+// take into account whether the [Parser] is configured with additional options,
+// such as [WithStrictDecoding] or [WithPaddingAllowed].
+func (p *Parser) DecodeSegment(seg string) ([]byte, error) {
+ encoding := base64.RawURLEncoding
+
+ if p.decodePaddingAllowed {
+ if l := len(seg) % 4; l > 0 {
+ seg += strings.Repeat("=", 4-l)
+ }
+ encoding = base64.URLEncoding
+ }
+
+ if p.decodeStrict {
+ encoding = encoding.Strict()
+ }
+ return encoding.DecodeString(seg)
+}
+
+// Parse parses, validates, verifies the signature and returns the parsed token.
+// keyFunc will receive the parsed token and should return the cryptographic key
+// for verifying the signature. The caller is strongly encouraged to set the
+// WithValidMethods option to validate the 'alg' claim in the token matches the
+// expected algorithm. For more details about the importance of validating the
+// 'alg' claim, see
+// https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/
+func Parse(tokenString string, keyFunc Keyfunc, options ...ParserOption) (*Token, error) {
+ return NewParser(options...).Parse(tokenString, keyFunc)
+}
+
+// ParseWithClaims is a shortcut for NewParser().ParseWithClaims().
+//
+// Note: If you provide a custom claim implementation that embeds one of the
+// standard claims (such as RegisteredClaims), make sure that a) you either
+// embed a non-pointer version of the claims or b) if you are using a pointer,
+// allocate the proper memory for it before passing in the overall claims,
+// otherwise you might run into a panic.
+func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc, options ...ParserOption) (*Token, error) {
+ return NewParser(options...).ParseWithClaims(tokenString, claims, keyFunc)
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/parser_option.go b/vendor/github.com/golang-jwt/jwt/v5/parser_option.go
new file mode 100644
index 000000000..1b5af970f
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/parser_option.go
@@ -0,0 +1,120 @@
+package jwt
+
+import "time"
+
+// ParserOption is used to implement functional-style options that modify the
+// behavior of the parser. To add new options, just create a function (ideally
+// beginning with With or Without) that returns an anonymous function that takes
+// a *Parser type as input and manipulates its configuration accordingly.
+type ParserOption func(*Parser)
+
+// WithValidMethods is an option to supply algorithm methods that the parser
+// will check. Only those methods will be considered valid. It is heavily
+// encouraged to use this option in order to prevent attacks such as
+// https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/.
+func WithValidMethods(methods []string) ParserOption {
+ return func(p *Parser) {
+ p.validMethods = methods
+ }
+}
+
+// WithJSONNumber is an option to configure the underlying JSON parser with
+// UseNumber.
+func WithJSONNumber() ParserOption {
+ return func(p *Parser) {
+ p.useJSONNumber = true
+ }
+}
+
+// WithoutClaimsValidation is an option to disable claims validation. This
+// option should only be used if you exactly know what you are doing.
+func WithoutClaimsValidation() ParserOption {
+ return func(p *Parser) {
+ p.skipClaimsValidation = true
+ }
+}
+
+// WithLeeway returns the ParserOption for specifying the leeway window.
+func WithLeeway(leeway time.Duration) ParserOption {
+ return func(p *Parser) {
+ p.validator.leeway = leeway
+ }
+}
+
+// WithTimeFunc returns the ParserOption for specifying the time func. The
+// primary use-case for this is testing. If you are looking for a way to account
+// for clock-skew, WithLeeway should be used instead.
+func WithTimeFunc(f func() time.Time) ParserOption {
+ return func(p *Parser) {
+ p.validator.timeFunc = f
+ }
+}
+
+// WithIssuedAt returns the ParserOption to enable verification
+// of issued-at.
+func WithIssuedAt() ParserOption {
+ return func(p *Parser) {
+ p.validator.verifyIat = true
+ }
+}
+
+// WithAudience configures the validator to require the specified audience in
+// the `aud` claim. Validation will fail if the audience is not listed in the
+// token or the `aud` claim is missing.
+//
+// NOTE: While the `aud` claim is OPTIONAL in a JWT, the handling of it is
+// application-specific. Since this validation API is helping developers in
+// writing secure application, we decided to REQUIRE the existence of the claim,
+// if an audience is expected.
+func WithAudience(aud string) ParserOption {
+ return func(p *Parser) {
+ p.validator.expectedAud = aud
+ }
+}
+
+// WithIssuer configures the validator to require the specified issuer in the
+// `iss` claim. Validation will fail if a different issuer is specified in the
+// token or the `iss` claim is missing.
+//
+// NOTE: While the `iss` claim is OPTIONAL in a JWT, the handling of it is
+// application-specific. Since this validation API is helping developers in
+// writing secure application, we decided to REQUIRE the existence of the claim,
+// if an issuer is expected.
+func WithIssuer(iss string) ParserOption {
+ return func(p *Parser) {
+ p.validator.expectedIss = iss
+ }
+}
+
+// WithSubject configures the validator to require the specified subject in the
+// `sub` claim. Validation will fail if a different subject is specified in the
+// token or the `sub` claim is missing.
+//
+// NOTE: While the `sub` claim is OPTIONAL in a JWT, the handling of it is
+// application-specific. Since this validation API is helping developers in
+// writing secure application, we decided to REQUIRE the existence of the claim,
+// if a subject is expected.
+func WithSubject(sub string) ParserOption {
+ return func(p *Parser) {
+ p.validator.expectedSub = sub
+ }
+}
+
+// WithPaddingAllowed will enable the codec used for decoding JWTs to allow
+// padding. Note that the JWS RFC7515 states that the tokens will utilize a
+// Base64url encoding with no padding. Unfortunately, some implementations of
+// JWT are producing non-standard tokens, and thus require support for decoding.
+func WithPaddingAllowed() ParserOption {
+ return func(p *Parser) {
+ p.decodePaddingAllowed = true
+ }
+}
+
+// WithStrictDecoding will switch the codec used for decoding JWTs into strict
+// mode. In this mode, the decoder requires that trailing padding bits are zero,
+// as described in RFC 4648 section 3.5.
+func WithStrictDecoding() ParserOption {
+ return func(p *Parser) {
+ p.decodeStrict = true
+ }
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/registered_claims.go b/vendor/github.com/golang-jwt/jwt/v5/registered_claims.go
new file mode 100644
index 000000000..77951a531
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/registered_claims.go
@@ -0,0 +1,63 @@
+package jwt
+
+// RegisteredClaims are a structured version of the JWT Claims Set,
+// restricted to Registered Claim Names, as referenced at
+// https://datatracker.ietf.org/doc/html/rfc7519#section-4.1
+//
+// This type can be used on its own, but then additional private and
+// public claims embedded in the JWT will not be parsed. The typical use-case
+// therefore is to embedded this in a user-defined claim type.
+//
+// See examples for how to use this with your own claim types.
+type RegisteredClaims struct {
+ // the `iss` (Issuer) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.1
+ Issuer string `json:"iss,omitempty"`
+
+ // the `sub` (Subject) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.2
+ Subject string `json:"sub,omitempty"`
+
+ // the `aud` (Audience) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3
+ Audience ClaimStrings `json:"aud,omitempty"`
+
+ // the `exp` (Expiration Time) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
+ ExpiresAt *NumericDate `json:"exp,omitempty"`
+
+ // the `nbf` (Not Before) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.5
+ NotBefore *NumericDate `json:"nbf,omitempty"`
+
+ // the `iat` (Issued At) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.6
+ IssuedAt *NumericDate `json:"iat,omitempty"`
+
+ // the `jti` (JWT ID) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7
+ ID string `json:"jti,omitempty"`
+}
+
+// GetExpirationTime implements the Claims interface.
+func (c RegisteredClaims) GetExpirationTime() (*NumericDate, error) {
+ return c.ExpiresAt, nil
+}
+
+// GetNotBefore implements the Claims interface.
+func (c RegisteredClaims) GetNotBefore() (*NumericDate, error) {
+ return c.NotBefore, nil
+}
+
+// GetIssuedAt implements the Claims interface.
+func (c RegisteredClaims) GetIssuedAt() (*NumericDate, error) {
+ return c.IssuedAt, nil
+}
+
+// GetAudience implements the Claims interface.
+func (c RegisteredClaims) GetAudience() (ClaimStrings, error) {
+ return c.Audience, nil
+}
+
+// GetIssuer implements the Claims interface.
+func (c RegisteredClaims) GetIssuer() (string, error) {
+ return c.Issuer, nil
+}
+
+// GetSubject implements the Claims interface.
+func (c RegisteredClaims) GetSubject() (string, error) {
+ return c.Subject, nil
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/rsa.go b/vendor/github.com/golang-jwt/jwt/v5/rsa.go
new file mode 100644
index 000000000..daff09431
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/rsa.go
@@ -0,0 +1,93 @@
+package jwt
+
+import (
+ "crypto"
+ "crypto/rand"
+ "crypto/rsa"
+)
+
+// SigningMethodRSA implements the RSA family of signing methods.
+// Expects *rsa.PrivateKey for signing and *rsa.PublicKey for validation
+type SigningMethodRSA struct {
+ Name string
+ Hash crypto.Hash
+}
+
+// Specific instances for RS256 and company
+var (
+ SigningMethodRS256 *SigningMethodRSA
+ SigningMethodRS384 *SigningMethodRSA
+ SigningMethodRS512 *SigningMethodRSA
+)
+
+func init() {
+ // RS256
+ SigningMethodRS256 = &SigningMethodRSA{"RS256", crypto.SHA256}
+ RegisterSigningMethod(SigningMethodRS256.Alg(), func() SigningMethod {
+ return SigningMethodRS256
+ })
+
+ // RS384
+ SigningMethodRS384 = &SigningMethodRSA{"RS384", crypto.SHA384}
+ RegisterSigningMethod(SigningMethodRS384.Alg(), func() SigningMethod {
+ return SigningMethodRS384
+ })
+
+ // RS512
+ SigningMethodRS512 = &SigningMethodRSA{"RS512", crypto.SHA512}
+ RegisterSigningMethod(SigningMethodRS512.Alg(), func() SigningMethod {
+ return SigningMethodRS512
+ })
+}
+
+func (m *SigningMethodRSA) Alg() string {
+ return m.Name
+}
+
+// Verify implements token verification for the SigningMethod
+// For this signing method, must be an *rsa.PublicKey structure.
+func (m *SigningMethodRSA) Verify(signingString string, sig []byte, key interface{}) error {
+ var rsaKey *rsa.PublicKey
+ var ok bool
+
+ if rsaKey, ok = key.(*rsa.PublicKey); !ok {
+ return ErrInvalidKeyType
+ }
+
+ // Create hasher
+ if !m.Hash.Available() {
+ return ErrHashUnavailable
+ }
+ hasher := m.Hash.New()
+ hasher.Write([]byte(signingString))
+
+ // Verify the signature
+ return rsa.VerifyPKCS1v15(rsaKey, m.Hash, hasher.Sum(nil), sig)
+}
+
+// Sign implements token signing for the SigningMethod
+// For this signing method, must be an *rsa.PrivateKey structure.
+func (m *SigningMethodRSA) Sign(signingString string, key interface{}) ([]byte, error) {
+ var rsaKey *rsa.PrivateKey
+ var ok bool
+
+ // Validate type of key
+ if rsaKey, ok = key.(*rsa.PrivateKey); !ok {
+ return nil, ErrInvalidKey
+ }
+
+ // Create the hasher
+ if !m.Hash.Available() {
+ return nil, ErrHashUnavailable
+ }
+
+ hasher := m.Hash.New()
+ hasher.Write([]byte(signingString))
+
+ // Sign the string and return the encoded bytes
+ if sigBytes, err := rsa.SignPKCS1v15(rand.Reader, rsaKey, m.Hash, hasher.Sum(nil)); err == nil {
+ return sigBytes, nil
+ } else {
+ return nil, err
+ }
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go b/vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go
new file mode 100644
index 000000000..9599f0a46
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go
@@ -0,0 +1,135 @@
+//go:build go1.4
+// +build go1.4
+
+package jwt
+
+import (
+ "crypto"
+ "crypto/rand"
+ "crypto/rsa"
+)
+
+// SigningMethodRSAPSS implements the RSAPSS family of signing methods signing methods
+type SigningMethodRSAPSS struct {
+ *SigningMethodRSA
+ Options *rsa.PSSOptions
+ // VerifyOptions is optional. If set overrides Options for rsa.VerifyPPS.
+ // Used to accept tokens signed with rsa.PSSSaltLengthAuto, what doesn't follow
+ // https://tools.ietf.org/html/rfc7518#section-3.5 but was used previously.
+ // See https://github.com/dgrijalva/jwt-go/issues/285#issuecomment-437451244 for details.
+ VerifyOptions *rsa.PSSOptions
+}
+
+// Specific instances for RS/PS and company.
+var (
+ SigningMethodPS256 *SigningMethodRSAPSS
+ SigningMethodPS384 *SigningMethodRSAPSS
+ SigningMethodPS512 *SigningMethodRSAPSS
+)
+
+func init() {
+ // PS256
+ SigningMethodPS256 = &SigningMethodRSAPSS{
+ SigningMethodRSA: &SigningMethodRSA{
+ Name: "PS256",
+ Hash: crypto.SHA256,
+ },
+ Options: &rsa.PSSOptions{
+ SaltLength: rsa.PSSSaltLengthEqualsHash,
+ },
+ VerifyOptions: &rsa.PSSOptions{
+ SaltLength: rsa.PSSSaltLengthAuto,
+ },
+ }
+ RegisterSigningMethod(SigningMethodPS256.Alg(), func() SigningMethod {
+ return SigningMethodPS256
+ })
+
+ // PS384
+ SigningMethodPS384 = &SigningMethodRSAPSS{
+ SigningMethodRSA: &SigningMethodRSA{
+ Name: "PS384",
+ Hash: crypto.SHA384,
+ },
+ Options: &rsa.PSSOptions{
+ SaltLength: rsa.PSSSaltLengthEqualsHash,
+ },
+ VerifyOptions: &rsa.PSSOptions{
+ SaltLength: rsa.PSSSaltLengthAuto,
+ },
+ }
+ RegisterSigningMethod(SigningMethodPS384.Alg(), func() SigningMethod {
+ return SigningMethodPS384
+ })
+
+ // PS512
+ SigningMethodPS512 = &SigningMethodRSAPSS{
+ SigningMethodRSA: &SigningMethodRSA{
+ Name: "PS512",
+ Hash: crypto.SHA512,
+ },
+ Options: &rsa.PSSOptions{
+ SaltLength: rsa.PSSSaltLengthEqualsHash,
+ },
+ VerifyOptions: &rsa.PSSOptions{
+ SaltLength: rsa.PSSSaltLengthAuto,
+ },
+ }
+ RegisterSigningMethod(SigningMethodPS512.Alg(), func() SigningMethod {
+ return SigningMethodPS512
+ })
+}
+
+// Verify implements token verification for the SigningMethod.
+// For this verify method, key must be an rsa.PublicKey struct
+func (m *SigningMethodRSAPSS) Verify(signingString string, sig []byte, key interface{}) error {
+ var rsaKey *rsa.PublicKey
+ switch k := key.(type) {
+ case *rsa.PublicKey:
+ rsaKey = k
+ default:
+ return ErrInvalidKey
+ }
+
+ // Create hasher
+ if !m.Hash.Available() {
+ return ErrHashUnavailable
+ }
+ hasher := m.Hash.New()
+ hasher.Write([]byte(signingString))
+
+ opts := m.Options
+ if m.VerifyOptions != nil {
+ opts = m.VerifyOptions
+ }
+
+ return rsa.VerifyPSS(rsaKey, m.Hash, hasher.Sum(nil), sig, opts)
+}
+
+// Sign implements token signing for the SigningMethod.
+// For this signing method, key must be an rsa.PrivateKey struct
+func (m *SigningMethodRSAPSS) Sign(signingString string, key interface{}) ([]byte, error) {
+ var rsaKey *rsa.PrivateKey
+
+ switch k := key.(type) {
+ case *rsa.PrivateKey:
+ rsaKey = k
+ default:
+ return nil, ErrInvalidKeyType
+ }
+
+ // Create the hasher
+ if !m.Hash.Available() {
+ return nil, ErrHashUnavailable
+ }
+
+ hasher := m.Hash.New()
+ hasher.Write([]byte(signingString))
+
+ // Sign the string and return the encoded bytes
+ if sigBytes, err := rsa.SignPSS(rand.Reader, rsaKey, m.Hash, hasher.Sum(nil), m.Options); err == nil {
+ return sigBytes, nil
+ } else {
+ return nil, err
+ }
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go b/vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go
new file mode 100644
index 000000000..b3aeebbe1
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go
@@ -0,0 +1,107 @@
+package jwt
+
+import (
+ "crypto/rsa"
+ "crypto/x509"
+ "encoding/pem"
+ "errors"
+)
+
+var (
+ ErrKeyMustBePEMEncoded = errors.New("invalid key: Key must be a PEM encoded PKCS1 or PKCS8 key")
+ ErrNotRSAPrivateKey = errors.New("key is not a valid RSA private key")
+ ErrNotRSAPublicKey = errors.New("key is not a valid RSA public key")
+)
+
+// ParseRSAPrivateKeyFromPEM parses a PEM encoded PKCS1 or PKCS8 private key
+func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error) {
+ var err error
+
+ // Parse PEM block
+ var block *pem.Block
+ if block, _ = pem.Decode(key); block == nil {
+ return nil, ErrKeyMustBePEMEncoded
+ }
+
+ var parsedKey interface{}
+ if parsedKey, err = x509.ParsePKCS1PrivateKey(block.Bytes); err != nil {
+ if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil {
+ return nil, err
+ }
+ }
+
+ var pkey *rsa.PrivateKey
+ var ok bool
+ if pkey, ok = parsedKey.(*rsa.PrivateKey); !ok {
+ return nil, ErrNotRSAPrivateKey
+ }
+
+ return pkey, nil
+}
+
+// ParseRSAPrivateKeyFromPEMWithPassword parses a PEM encoded PKCS1 or PKCS8 private key protected with password
+//
+// Deprecated: This function is deprecated and should not be used anymore. It uses the deprecated x509.DecryptPEMBlock
+// function, which was deprecated since RFC 1423 is regarded insecure by design. Unfortunately, there is no alternative
+// in the Go standard library for now. See https://github.com/golang/go/issues/8860.
+func ParseRSAPrivateKeyFromPEMWithPassword(key []byte, password string) (*rsa.PrivateKey, error) {
+ var err error
+
+ // Parse PEM block
+ var block *pem.Block
+ if block, _ = pem.Decode(key); block == nil {
+ return nil, ErrKeyMustBePEMEncoded
+ }
+
+ var parsedKey interface{}
+
+ var blockDecrypted []byte
+ if blockDecrypted, err = x509.DecryptPEMBlock(block, []byte(password)); err != nil {
+ return nil, err
+ }
+
+ if parsedKey, err = x509.ParsePKCS1PrivateKey(blockDecrypted); err != nil {
+ if parsedKey, err = x509.ParsePKCS8PrivateKey(blockDecrypted); err != nil {
+ return nil, err
+ }
+ }
+
+ var pkey *rsa.PrivateKey
+ var ok bool
+ if pkey, ok = parsedKey.(*rsa.PrivateKey); !ok {
+ return nil, ErrNotRSAPrivateKey
+ }
+
+ return pkey, nil
+}
+
+// ParseRSAPublicKeyFromPEM parses a certificate or a PEM encoded PKCS1 or PKIX public key
+func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) {
+ var err error
+
+ // Parse PEM block
+ var block *pem.Block
+ if block, _ = pem.Decode(key); block == nil {
+ return nil, ErrKeyMustBePEMEncoded
+ }
+
+ // Parse the key
+ var parsedKey interface{}
+ if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil {
+ if cert, err := x509.ParseCertificate(block.Bytes); err == nil {
+ parsedKey = cert.PublicKey
+ } else {
+ if parsedKey, err = x509.ParsePKCS1PublicKey(block.Bytes); err != nil {
+ return nil, err
+ }
+ }
+ }
+
+ var pkey *rsa.PublicKey
+ var ok bool
+ if pkey, ok = parsedKey.(*rsa.PublicKey); !ok {
+ return nil, ErrNotRSAPublicKey
+ }
+
+ return pkey, nil
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/signing_method.go b/vendor/github.com/golang-jwt/jwt/v5/signing_method.go
new file mode 100644
index 000000000..0d73631c1
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/signing_method.go
@@ -0,0 +1,49 @@
+package jwt
+
+import (
+ "sync"
+)
+
+var signingMethods = map[string]func() SigningMethod{}
+var signingMethodLock = new(sync.RWMutex)
+
+// SigningMethod can be used add new methods for signing or verifying tokens. It
+// takes a decoded signature as an input in the Verify function and produces a
+// signature in Sign. The signature is then usually base64 encoded as part of a
+// JWT.
+type SigningMethod interface {
+ Verify(signingString string, sig []byte, key interface{}) error // Returns nil if signature is valid
+ Sign(signingString string, key interface{}) ([]byte, error) // Returns signature or error
+ Alg() string // returns the alg identifier for this method (example: 'HS256')
+}
+
+// RegisterSigningMethod registers the "alg" name and a factory function for signing method.
+// This is typically done during init() in the method's implementation
+func RegisterSigningMethod(alg string, f func() SigningMethod) {
+ signingMethodLock.Lock()
+ defer signingMethodLock.Unlock()
+
+ signingMethods[alg] = f
+}
+
+// GetSigningMethod retrieves a signing method from an "alg" string
+func GetSigningMethod(alg string) (method SigningMethod) {
+ signingMethodLock.RLock()
+ defer signingMethodLock.RUnlock()
+
+ if methodF, ok := signingMethods[alg]; ok {
+ method = methodF()
+ }
+ return
+}
+
+// GetAlgorithms returns a list of registered "alg" names
+func GetAlgorithms() (algs []string) {
+ signingMethodLock.RLock()
+ defer signingMethodLock.RUnlock()
+
+ for alg := range signingMethods {
+ algs = append(algs, alg)
+ }
+ return
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/staticcheck.conf b/vendor/github.com/golang-jwt/jwt/v5/staticcheck.conf
new file mode 100644
index 000000000..53745d51d
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/staticcheck.conf
@@ -0,0 +1 @@
+checks = ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1023"]
diff --git a/vendor/github.com/golang-jwt/jwt/v5/token.go b/vendor/github.com/golang-jwt/jwt/v5/token.go
new file mode 100644
index 000000000..c8ad7c783
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/token.go
@@ -0,0 +1,86 @@
+package jwt
+
+import (
+ "encoding/base64"
+ "encoding/json"
+)
+
+// Keyfunc will be used by the Parse methods as a callback function to supply
+// the key for verification. The function receives the parsed, but unverified
+// Token. This allows you to use properties in the Header of the token (such as
+// `kid`) to identify which key to use.
+type Keyfunc func(*Token) (interface{}, error)
+
+// Token represents a JWT Token. Different fields will be used depending on
+// whether you're creating or parsing/verifying a token.
+type Token struct {
+ Raw string // Raw contains the raw token. Populated when you [Parse] a token
+ Method SigningMethod // Method is the signing method used or to be used
+ Header map[string]interface{} // Header is the first segment of the token in decoded form
+ Claims Claims // Claims is the second segment of the token in decoded form
+ Signature []byte // Signature is the third segment of the token in decoded form. Populated when you Parse a token
+ Valid bool // Valid specifies if the token is valid. Populated when you Parse/Verify a token
+}
+
+// New creates a new [Token] with the specified signing method and an empty map
+// of claims. Additional options can be specified, but are currently unused.
+func New(method SigningMethod, opts ...TokenOption) *Token {
+ return NewWithClaims(method, MapClaims{}, opts...)
+}
+
+// NewWithClaims creates a new [Token] with the specified signing method and
+// claims. Additional options can be specified, but are currently unused.
+func NewWithClaims(method SigningMethod, claims Claims, opts ...TokenOption) *Token {
+ return &Token{
+ Header: map[string]interface{}{
+ "typ": "JWT",
+ "alg": method.Alg(),
+ },
+ Claims: claims,
+ Method: method,
+ }
+}
+
+// SignedString creates and returns a complete, signed JWT. The token is signed
+// using the SigningMethod specified in the token. Please refer to
+// https://golang-jwt.github.io/jwt/usage/signing_methods/#signing-methods-and-key-types
+// for an overview of the different signing methods and their respective key
+// types.
+func (t *Token) SignedString(key interface{}) (string, error) {
+ sstr, err := t.SigningString()
+ if err != nil {
+ return "", err
+ }
+
+ sig, err := t.Method.Sign(sstr, key)
+ if err != nil {
+ return "", err
+ }
+
+ return sstr + "." + t.EncodeSegment(sig), nil
+}
+
+// SigningString generates the signing string. This is the most expensive part
+// of the whole deal. Unless you need this for something special, just go
+// straight for the SignedString.
+func (t *Token) SigningString() (string, error) {
+ h, err := json.Marshal(t.Header)
+ if err != nil {
+ return "", err
+ }
+
+ c, err := json.Marshal(t.Claims)
+ if err != nil {
+ return "", err
+ }
+
+ return t.EncodeSegment(h) + "." + t.EncodeSegment(c), nil
+}
+
+// EncodeSegment encodes a JWT specific base64url encoding with padding
+// stripped. In the future, this function might take into account a
+// [TokenOption]. Therefore, this function exists as a method of [Token], rather
+// than a global function.
+func (*Token) EncodeSegment(seg []byte) string {
+ return base64.RawURLEncoding.EncodeToString(seg)
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/token_option.go b/vendor/github.com/golang-jwt/jwt/v5/token_option.go
new file mode 100644
index 000000000..b4ae3badf
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/token_option.go
@@ -0,0 +1,5 @@
+package jwt
+
+// TokenOption is a reserved type, which provides some forward compatibility,
+// if we ever want to introduce token creation-related options.
+type TokenOption func(*Token)
diff --git a/vendor/github.com/golang-jwt/jwt/v5/types.go b/vendor/github.com/golang-jwt/jwt/v5/types.go
new file mode 100644
index 000000000..b82b38867
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/types.go
@@ -0,0 +1,150 @@
+package jwt
+
+import (
+ "encoding/json"
+ "fmt"
+ "math"
+ "reflect"
+ "strconv"
+ "time"
+)
+
+// TimePrecision sets the precision of times and dates within this library. This
+// has an influence on the precision of times when comparing expiry or other
+// related time fields. Furthermore, it is also the precision of times when
+// serializing.
+//
+// For backwards compatibility the default precision is set to seconds, so that
+// no fractional timestamps are generated.
+var TimePrecision = time.Second
+
+// MarshalSingleStringAsArray modifies the behavior of the ClaimStrings type,
+// especially its MarshalJSON function.
+//
+// If it is set to true (the default), it will always serialize the type as an
+// array of strings, even if it just contains one element, defaulting to the
+// behavior of the underlying []string. If it is set to false, it will serialize
+// to a single string, if it contains one element. Otherwise, it will serialize
+// to an array of strings.
+var MarshalSingleStringAsArray = true
+
+// NumericDate represents a JSON numeric date value, as referenced at
+// https://datatracker.ietf.org/doc/html/rfc7519#section-2.
+type NumericDate struct {
+ time.Time
+}
+
+// NewNumericDate constructs a new *NumericDate from a standard library time.Time struct.
+// It will truncate the timestamp according to the precision specified in TimePrecision.
+func NewNumericDate(t time.Time) *NumericDate {
+ return &NumericDate{t.Truncate(TimePrecision)}
+}
+
+// newNumericDateFromSeconds creates a new *NumericDate out of a float64 representing a
+// UNIX epoch with the float fraction representing non-integer seconds.
+func newNumericDateFromSeconds(f float64) *NumericDate {
+ round, frac := math.Modf(f)
+ return NewNumericDate(time.Unix(int64(round), int64(frac*1e9)))
+}
+
+// MarshalJSON is an implementation of the json.RawMessage interface and serializes the UNIX epoch
+// represented in NumericDate to a byte array, using the precision specified in TimePrecision.
+func (date NumericDate) MarshalJSON() (b []byte, err error) {
+ var prec int
+ if TimePrecision < time.Second {
+ prec = int(math.Log10(float64(time.Second) / float64(TimePrecision)))
+ }
+ truncatedDate := date.Truncate(TimePrecision)
+
+ // For very large timestamps, UnixNano would overflow an int64, but this
+ // function requires nanosecond level precision, so we have to use the
+ // following technique to get round the issue:
+ //
+ // 1. Take the normal unix timestamp to form the whole number part of the
+ // output,
+ // 2. Take the result of the Nanosecond function, which returns the offset
+ // within the second of the particular unix time instance, to form the
+ // decimal part of the output
+ // 3. Concatenate them to produce the final result
+ seconds := strconv.FormatInt(truncatedDate.Unix(), 10)
+ nanosecondsOffset := strconv.FormatFloat(float64(truncatedDate.Nanosecond())/float64(time.Second), 'f', prec, 64)
+
+ output := append([]byte(seconds), []byte(nanosecondsOffset)[1:]...)
+
+ return output, nil
+}
+
+// UnmarshalJSON is an implementation of the json.RawMessage interface and
+// deserializes a [NumericDate] from a JSON representation, i.e. a
+// [json.Number]. This number represents an UNIX epoch with either integer or
+// non-integer seconds.
+func (date *NumericDate) UnmarshalJSON(b []byte) (err error) {
+ var (
+ number json.Number
+ f float64
+ )
+
+ if err = json.Unmarshal(b, &number); err != nil {
+ return fmt.Errorf("could not parse NumericData: %w", err)
+ }
+
+ if f, err = number.Float64(); err != nil {
+ return fmt.Errorf("could not convert json number value to float: %w", err)
+ }
+
+ n := newNumericDateFromSeconds(f)
+ *date = *n
+
+ return nil
+}
+
+// ClaimStrings is basically just a slice of strings, but it can be either
+// serialized from a string array or just a string. This type is necessary,
+// since the "aud" claim can either be a single string or an array.
+type ClaimStrings []string
+
+func (s *ClaimStrings) UnmarshalJSON(data []byte) (err error) {
+ var value interface{}
+
+ if err = json.Unmarshal(data, &value); err != nil {
+ return err
+ }
+
+ var aud []string
+
+ switch v := value.(type) {
+ case string:
+ aud = append(aud, v)
+ case []string:
+ aud = ClaimStrings(v)
+ case []interface{}:
+ for _, vv := range v {
+ vs, ok := vv.(string)
+ if !ok {
+ return &json.UnsupportedTypeError{Type: reflect.TypeOf(vv)}
+ }
+ aud = append(aud, vs)
+ }
+ case nil:
+ return nil
+ default:
+ return &json.UnsupportedTypeError{Type: reflect.TypeOf(v)}
+ }
+
+ *s = aud
+
+ return
+}
+
+func (s ClaimStrings) MarshalJSON() (b []byte, err error) {
+ // This handles a special case in the JWT RFC. If the string array, e.g.
+ // used by the "aud" field, only contains one element, it MAY be serialized
+ // as a single string. This may or may not be desired based on the ecosystem
+ // of other JWT library used, so we make it configurable by the variable
+ // MarshalSingleStringAsArray.
+ if len(s) == 1 && !MarshalSingleStringAsArray {
+ return json.Marshal(s[0])
+ }
+
+ return json.Marshal([]string(s))
+}
diff --git a/vendor/github.com/golang-jwt/jwt/v5/validator.go b/vendor/github.com/golang-jwt/jwt/v5/validator.go
new file mode 100644
index 000000000..385043893
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/validator.go
@@ -0,0 +1,301 @@
+package jwt
+
+import (
+ "crypto/subtle"
+ "fmt"
+ "time"
+)
+
+// ClaimsValidator is an interface that can be implemented by custom claims who
+// wish to execute any additional claims validation based on
+// application-specific logic. The Validate function is then executed in
+// addition to the regular claims validation and any error returned is appended
+// to the final validation result.
+//
+// type MyCustomClaims struct {
+// Foo string `json:"foo"`
+// jwt.RegisteredClaims
+// }
+//
+// func (m MyCustomClaims) Validate() error {
+// if m.Foo != "bar" {
+// return errors.New("must be foobar")
+// }
+// return nil
+// }
+type ClaimsValidator interface {
+ Claims
+ Validate() error
+}
+
+// validator is the core of the new Validation API. It is automatically used by
+// a [Parser] during parsing and can be modified with various parser options.
+//
+// Note: This struct is intentionally not exported (yet) as we want to
+// internally finalize its API. In the future, we might make it publicly
+// available.
+type validator struct {
+ // leeway is an optional leeway that can be provided to account for clock skew.
+ leeway time.Duration
+
+ // timeFunc is used to supply the current time that is needed for
+ // validation. If unspecified, this defaults to time.Now.
+ timeFunc func() time.Time
+
+ // verifyIat specifies whether the iat (Issued At) claim will be verified.
+ // According to https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6 this
+ // only specifies the age of the token, but no validation check is
+ // necessary. However, if wanted, it can be checked if the iat is
+ // unrealistic, i.e., in the future.
+ verifyIat bool
+
+ // expectedAud contains the audience this token expects. Supplying an empty
+ // string will disable aud checking.
+ expectedAud string
+
+ // expectedIss contains the issuer this token expects. Supplying an empty
+ // string will disable iss checking.
+ expectedIss string
+
+ // expectedSub contains the subject this token expects. Supplying an empty
+ // string will disable sub checking.
+ expectedSub string
+}
+
+// newValidator can be used to create a stand-alone validator with the supplied
+// options. This validator can then be used to validate already parsed claims.
+func newValidator(opts ...ParserOption) *validator {
+ p := NewParser(opts...)
+ return p.validator
+}
+
+// Validate validates the given claims. It will also perform any custom
+// validation if claims implements the [ClaimsValidator] interface.
+func (v *validator) Validate(claims Claims) error {
+ var (
+ now time.Time
+ errs []error = make([]error, 0, 6)
+ err error
+ )
+
+ // Check, if we have a time func
+ if v.timeFunc != nil {
+ now = v.timeFunc()
+ } else {
+ now = time.Now()
+ }
+
+ // We always need to check the expiration time, but usage of the claim
+ // itself is OPTIONAL.
+ if err = v.verifyExpiresAt(claims, now, false); err != nil {
+ errs = append(errs, err)
+ }
+
+ // We always need to check not-before, but usage of the claim itself is
+ // OPTIONAL.
+ if err = v.verifyNotBefore(claims, now, false); err != nil {
+ errs = append(errs, err)
+ }
+
+ // Check issued-at if the option is enabled
+ if v.verifyIat {
+ if err = v.verifyIssuedAt(claims, now, false); err != nil {
+ errs = append(errs, err)
+ }
+ }
+
+ // If we have an expected audience, we also require the audience claim
+ if v.expectedAud != "" {
+ if err = v.verifyAudience(claims, v.expectedAud, true); err != nil {
+ errs = append(errs, err)
+ }
+ }
+
+ // If we have an expected issuer, we also require the issuer claim
+ if v.expectedIss != "" {
+ if err = v.verifyIssuer(claims, v.expectedIss, true); err != nil {
+ errs = append(errs, err)
+ }
+ }
+
+ // If we have an expected subject, we also require the subject claim
+ if v.expectedSub != "" {
+ if err = v.verifySubject(claims, v.expectedSub, true); err != nil {
+ errs = append(errs, err)
+ }
+ }
+
+ // Finally, we want to give the claim itself some possibility to do some
+ // additional custom validation based on a custom Validate function.
+ cvt, ok := claims.(ClaimsValidator)
+ if ok {
+ if err := cvt.Validate(); err != nil {
+ errs = append(errs, err)
+ }
+ }
+
+ if len(errs) == 0 {
+ return nil
+ }
+
+ return joinErrors(errs...)
+}
+
+// verifyExpiresAt compares the exp claim in claims against cmp. This function
+// will succeed if cmp < exp. Additional leeway is taken into account.
+//
+// If exp is not set, it will succeed if the claim is not required,
+// otherwise ErrTokenRequiredClaimMissing will be returned.
+//
+// Additionally, if any error occurs while retrieving the claim, e.g., when its
+// the wrong type, an ErrTokenUnverifiable error will be returned.
+func (v *validator) verifyExpiresAt(claims Claims, cmp time.Time, required bool) error {
+ exp, err := claims.GetExpirationTime()
+ if err != nil {
+ return err
+ }
+
+ if exp == nil {
+ return errorIfRequired(required, "exp")
+ }
+
+ return errorIfFalse(cmp.Before((exp.Time).Add(+v.leeway)), ErrTokenExpired)
+}
+
+// verifyIssuedAt compares the iat claim in claims against cmp. This function
+// will succeed if cmp >= iat. Additional leeway is taken into account.
+//
+// If iat is not set, it will succeed if the claim is not required,
+// otherwise ErrTokenRequiredClaimMissing will be returned.
+//
+// Additionally, if any error occurs while retrieving the claim, e.g., when its
+// the wrong type, an ErrTokenUnverifiable error will be returned.
+func (v *validator) verifyIssuedAt(claims Claims, cmp time.Time, required bool) error {
+ iat, err := claims.GetIssuedAt()
+ if err != nil {
+ return err
+ }
+
+ if iat == nil {
+ return errorIfRequired(required, "iat")
+ }
+
+ return errorIfFalse(!cmp.Before(iat.Add(-v.leeway)), ErrTokenUsedBeforeIssued)
+}
+
+// verifyNotBefore compares the nbf claim in claims against cmp. This function
+// will return true if cmp >= nbf. Additional leeway is taken into account.
+//
+// If nbf is not set, it will succeed if the claim is not required,
+// otherwise ErrTokenRequiredClaimMissing will be returned.
+//
+// Additionally, if any error occurs while retrieving the claim, e.g., when its
+// the wrong type, an ErrTokenUnverifiable error will be returned.
+func (v *validator) verifyNotBefore(claims Claims, cmp time.Time, required bool) error {
+ nbf, err := claims.GetNotBefore()
+ if err != nil {
+ return err
+ }
+
+ if nbf == nil {
+ return errorIfRequired(required, "nbf")
+ }
+
+ return errorIfFalse(!cmp.Before(nbf.Add(-v.leeway)), ErrTokenNotValidYet)
+}
+
+// verifyAudience compares the aud claim against cmp.
+//
+// If aud is not set or an empty list, it will succeed if the claim is not required,
+// otherwise ErrTokenRequiredClaimMissing will be returned.
+//
+// Additionally, if any error occurs while retrieving the claim, e.g., when its
+// the wrong type, an ErrTokenUnverifiable error will be returned.
+func (v *validator) verifyAudience(claims Claims, cmp string, required bool) error {
+ aud, err := claims.GetAudience()
+ if err != nil {
+ return err
+ }
+
+ if len(aud) == 0 {
+ return errorIfRequired(required, "aud")
+ }
+
+ // use a var here to keep constant time compare when looping over a number of claims
+ result := false
+
+ var stringClaims string
+ for _, a := range aud {
+ if subtle.ConstantTimeCompare([]byte(a), []byte(cmp)) != 0 {
+ result = true
+ }
+ stringClaims = stringClaims + a
+ }
+
+ // case where "" is sent in one or many aud claims
+ if stringClaims == "" {
+ return errorIfRequired(required, "aud")
+ }
+
+ return errorIfFalse(result, ErrTokenInvalidAudience)
+}
+
+// verifyIssuer compares the iss claim in claims against cmp.
+//
+// If iss is not set, it will succeed if the claim is not required,
+// otherwise ErrTokenRequiredClaimMissing will be returned.
+//
+// Additionally, if any error occurs while retrieving the claim, e.g., when its
+// the wrong type, an ErrTokenUnverifiable error will be returned.
+func (v *validator) verifyIssuer(claims Claims, cmp string, required bool) error {
+ iss, err := claims.GetIssuer()
+ if err != nil {
+ return err
+ }
+
+ if iss == "" {
+ return errorIfRequired(required, "iss")
+ }
+
+ return errorIfFalse(iss == cmp, ErrTokenInvalidIssuer)
+}
+
+// verifySubject compares the sub claim against cmp.
+//
+// If sub is not set, it will succeed if the claim is not required,
+// otherwise ErrTokenRequiredClaimMissing will be returned.
+//
+// Additionally, if any error occurs while retrieving the claim, e.g., when its
+// the wrong type, an ErrTokenUnverifiable error will be returned.
+func (v *validator) verifySubject(claims Claims, cmp string, required bool) error {
+ sub, err := claims.GetSubject()
+ if err != nil {
+ return err
+ }
+
+ if sub == "" {
+ return errorIfRequired(required, "sub")
+ }
+
+ return errorIfFalse(sub == cmp, ErrTokenInvalidSubject)
+}
+
+// errorIfFalse returns the error specified in err, if the value is true.
+// Otherwise, nil is returned.
+func errorIfFalse(value bool, err error) error {
+ if value {
+ return nil
+ } else {
+ return err
+ }
+}
+
+// errorIfRequired returns an ErrTokenRequiredClaimMissing error if required is
+// true. Otherwise, nil is returned.
+func errorIfRequired(required bool, claim string) error {
+ if required {
+ return newError(fmt.Sprintf("%s claim is required", claim), ErrTokenRequiredClaimMissing)
+ } else {
+ return nil
+ }
+}
diff --git a/vendor/github.com/kylelemons/godebug/LICENSE b/vendor/github.com/kylelemons/godebug/LICENSE
new file mode 100644
index 000000000..d64569567
--- /dev/null
+++ b/vendor/github.com/kylelemons/godebug/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vendor/github.com/kylelemons/godebug/diff/diff.go b/vendor/github.com/kylelemons/godebug/diff/diff.go
new file mode 100644
index 000000000..200e596c6
--- /dev/null
+++ b/vendor/github.com/kylelemons/godebug/diff/diff.go
@@ -0,0 +1,186 @@
+// Copyright 2013 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package diff implements a linewise diff algorithm.
+package diff
+
+import (
+ "bytes"
+ "fmt"
+ "strings"
+)
+
+// Chunk represents a piece of the diff. A chunk will not have both added and
+// deleted lines. Equal lines are always after any added or deleted lines.
+// A Chunk may or may not have any lines in it, especially for the first or last
+// chunk in a computation.
+type Chunk struct {
+ Added []string
+ Deleted []string
+ Equal []string
+}
+
+func (c *Chunk) empty() bool {
+ return len(c.Added) == 0 && len(c.Deleted) == 0 && len(c.Equal) == 0
+}
+
+// Diff returns a string containing a line-by-line unified diff of the linewise
+// changes required to make A into B. Each line is prefixed with '+', '-', or
+// ' ' to indicate if it should be added, removed, or is correct respectively.
+func Diff(A, B string) string {
+ aLines := strings.Split(A, "\n")
+ bLines := strings.Split(B, "\n")
+
+ chunks := DiffChunks(aLines, bLines)
+
+ buf := new(bytes.Buffer)
+ for _, c := range chunks {
+ for _, line := range c.Added {
+ fmt.Fprintf(buf, "+%s\n", line)
+ }
+ for _, line := range c.Deleted {
+ fmt.Fprintf(buf, "-%s\n", line)
+ }
+ for _, line := range c.Equal {
+ fmt.Fprintf(buf, " %s\n", line)
+ }
+ }
+ return strings.TrimRight(buf.String(), "\n")
+}
+
+// DiffChunks uses an O(D(N+M)) shortest-edit-script algorithm
+// to compute the edits required from A to B and returns the
+// edit chunks.
+func DiffChunks(a, b []string) []Chunk {
+ // algorithm: http://www.xmailserver.org/diff2.pdf
+
+ // We'll need these quantities a lot.
+ alen, blen := len(a), len(b) // M, N
+
+ // At most, it will require len(a) deletions and len(b) additions
+ // to transform a into b.
+ maxPath := alen + blen // MAX
+ if maxPath == 0 {
+ // degenerate case: two empty lists are the same
+ return nil
+ }
+
+ // Store the endpoint of the path for diagonals.
+ // We store only the a index, because the b index on any diagonal
+ // (which we know during the loop below) is aidx-diag.
+ // endpoint[maxPath] represents the 0 diagonal.
+ //
+ // Stated differently:
+ // endpoint[d] contains the aidx of a furthest reaching path in diagonal d
+ endpoint := make([]int, 2*maxPath+1) // V
+
+ saved := make([][]int, 0, 8) // Vs
+ save := func() {
+ dup := make([]int, len(endpoint))
+ copy(dup, endpoint)
+ saved = append(saved, dup)
+ }
+
+ var editDistance int // D
+dLoop:
+ for editDistance = 0; editDistance <= maxPath; editDistance++ {
+ // The 0 diag(onal) represents equality of a and b. Each diagonal to
+ // the left is numbered one lower, to the right is one higher, from
+ // -alen to +blen. Negative diagonals favor differences from a,
+ // positive diagonals favor differences from b. The edit distance to a
+ // diagonal d cannot be shorter than d itself.
+ //
+ // The iterations of this loop cover either odds or evens, but not both,
+ // If odd indices are inputs, even indices are outputs and vice versa.
+ for diag := -editDistance; diag <= editDistance; diag += 2 { // k
+ var aidx int // x
+ switch {
+ case diag == -editDistance:
+ // This is a new diagonal; copy from previous iter
+ aidx = endpoint[maxPath-editDistance+1] + 0
+ case diag == editDistance:
+ // This is a new diagonal; copy from previous iter
+ aidx = endpoint[maxPath+editDistance-1] + 1
+ case endpoint[maxPath+diag+1] > endpoint[maxPath+diag-1]:
+ // diagonal d+1 was farther along, so use that
+ aidx = endpoint[maxPath+diag+1] + 0
+ default:
+ // diagonal d-1 was farther (or the same), so use that
+ aidx = endpoint[maxPath+diag-1] + 1
+ }
+ // On diagonal d, we can compute bidx from aidx.
+ bidx := aidx - diag // y
+ // See how far we can go on this diagonal before we find a difference.
+ for aidx < alen && bidx < blen && a[aidx] == b[bidx] {
+ aidx++
+ bidx++
+ }
+ // Store the end of the current edit chain.
+ endpoint[maxPath+diag] = aidx
+ // If we've found the end of both inputs, we're done!
+ if aidx >= alen && bidx >= blen {
+ save() // save the final path
+ break dLoop
+ }
+ }
+ save() // save the current path
+ }
+ if editDistance == 0 {
+ return nil
+ }
+ chunks := make([]Chunk, editDistance+1)
+
+ x, y := alen, blen
+ for d := editDistance; d > 0; d-- {
+ endpoint := saved[d]
+ diag := x - y
+ insert := diag == -d || (diag != d && endpoint[maxPath+diag-1] < endpoint[maxPath+diag+1])
+
+ x1 := endpoint[maxPath+diag]
+ var x0, xM, kk int
+ if insert {
+ kk = diag + 1
+ x0 = endpoint[maxPath+kk]
+ xM = x0
+ } else {
+ kk = diag - 1
+ x0 = endpoint[maxPath+kk]
+ xM = x0 + 1
+ }
+ y0 := x0 - kk
+
+ var c Chunk
+ if insert {
+ c.Added = b[y0:][:1]
+ } else {
+ c.Deleted = a[x0:][:1]
+ }
+ if xM < x1 {
+ c.Equal = a[xM:][:x1-xM]
+ }
+
+ x, y = x0, y0
+ chunks[d] = c
+ }
+ if x > 0 {
+ chunks[0].Equal = a[:x]
+ }
+ if chunks[0].empty() {
+ chunks = chunks[1:]
+ }
+ if len(chunks) == 0 {
+ return nil
+ }
+ return chunks
+}
diff --git a/vendor/github.com/kylelemons/godebug/pretty/.gitignore b/vendor/github.com/kylelemons/godebug/pretty/.gitignore
new file mode 100644
index 000000000..fa9a735da
--- /dev/null
+++ b/vendor/github.com/kylelemons/godebug/pretty/.gitignore
@@ -0,0 +1,5 @@
+*.test
+*.bench
+*.golden
+*.txt
+*.prof
diff --git a/vendor/github.com/kylelemons/godebug/pretty/doc.go b/vendor/github.com/kylelemons/godebug/pretty/doc.go
new file mode 100644
index 000000000..03b5718a7
--- /dev/null
+++ b/vendor/github.com/kylelemons/godebug/pretty/doc.go
@@ -0,0 +1,25 @@
+// Copyright 2013 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package pretty pretty-prints Go structures.
+//
+// This package uses reflection to examine a Go value and can
+// print out in a nice, aligned fashion. It supports three
+// modes (normal, compact, and extended) for advanced use.
+//
+// See the Reflect and Print examples for what the output looks like.
+package pretty
+
+// TODO:
+// - Catch cycles
diff --git a/vendor/github.com/kylelemons/godebug/pretty/public.go b/vendor/github.com/kylelemons/godebug/pretty/public.go
new file mode 100644
index 000000000..fbc5d7abb
--- /dev/null
+++ b/vendor/github.com/kylelemons/godebug/pretty/public.go
@@ -0,0 +1,188 @@
+// Copyright 2013 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package pretty
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "net"
+ "reflect"
+ "time"
+
+ "github.com/kylelemons/godebug/diff"
+)
+
+// A Config represents optional configuration parameters for formatting.
+//
+// Some options, notably ShortList, dramatically increase the overhead
+// of pretty-printing a value.
+type Config struct {
+ // Verbosity options
+ Compact bool // One-line output. Overrides Diffable.
+ Diffable bool // Adds extra newlines for more easily diffable output.
+
+ // Field and value options
+ IncludeUnexported bool // Include unexported fields in output
+ PrintStringers bool // Call String on a fmt.Stringer
+ PrintTextMarshalers bool // Call MarshalText on an encoding.TextMarshaler
+ SkipZeroFields bool // Skip struct fields that have a zero value.
+
+ // Output transforms
+ ShortList int // Maximum character length for short lists if nonzero.
+
+ // Type-specific overrides
+ //
+ // Formatter maps a type to a function that will provide a one-line string
+ // representation of the input value. Conceptually:
+ // Formatter[reflect.TypeOf(v)](v) = "v as a string"
+ //
+ // Note that the first argument need not explicitly match the type, it must
+ // merely be callable with it.
+ //
+ // When processing an input value, if its type exists as a key in Formatter:
+ // 1) If the value is nil, no stringification is performed.
+ // This allows overriding of PrintStringers and PrintTextMarshalers.
+ // 2) The value will be called with the input as its only argument.
+ // The function must return a string as its first return value.
+ //
+ // In addition to func literals, two common values for this will be:
+ // fmt.Sprint (function) func Sprint(...interface{}) string
+ // Type.String (method) func (Type) String() string
+ //
+ // Note that neither of these work if the String method is a pointer
+ // method and the input will be provided as a value. In that case,
+ // use a function that calls .String on the formal value parameter.
+ Formatter map[reflect.Type]interface{}
+
+ // If TrackCycles is enabled, pretty will detect and track
+ // self-referential structures. If a self-referential structure (aka a
+ // "recursive" value) is detected, numbered placeholders will be emitted.
+ //
+ // Pointer tracking is disabled by default for performance reasons.
+ TrackCycles bool
+}
+
+// Default Config objects
+var (
+ // DefaultFormatter is the default set of overrides for stringification.
+ DefaultFormatter = map[reflect.Type]interface{}{
+ reflect.TypeOf(time.Time{}): fmt.Sprint,
+ reflect.TypeOf(net.IP{}): fmt.Sprint,
+ reflect.TypeOf((*error)(nil)).Elem(): fmt.Sprint,
+ }
+
+ // CompareConfig is the default configuration used for Compare.
+ CompareConfig = &Config{
+ Diffable: true,
+ IncludeUnexported: true,
+ Formatter: DefaultFormatter,
+ }
+
+ // DefaultConfig is the default configuration used for all other top-level functions.
+ DefaultConfig = &Config{
+ Formatter: DefaultFormatter,
+ }
+
+ // CycleTracker is a convenience config for formatting and comparing recursive structures.
+ CycleTracker = &Config{
+ Diffable: true,
+ Formatter: DefaultFormatter,
+ TrackCycles: true,
+ }
+)
+
+func (cfg *Config) fprint(buf *bytes.Buffer, vals ...interface{}) {
+ ref := &reflector{
+ Config: cfg,
+ }
+ if cfg.TrackCycles {
+ ref.pointerTracker = new(pointerTracker)
+ }
+ for i, val := range vals {
+ if i > 0 {
+ buf.WriteByte('\n')
+ }
+ newFormatter(cfg, buf).write(ref.val2node(reflect.ValueOf(val)))
+ }
+}
+
+// Print writes the DefaultConfig representation of the given values to standard output.
+func Print(vals ...interface{}) {
+ DefaultConfig.Print(vals...)
+}
+
+// Print writes the configured presentation of the given values to standard output.
+func (cfg *Config) Print(vals ...interface{}) {
+ fmt.Println(cfg.Sprint(vals...))
+}
+
+// Sprint returns a string representation of the given value according to the DefaultConfig.
+func Sprint(vals ...interface{}) string {
+ return DefaultConfig.Sprint(vals...)
+}
+
+// Sprint returns a string representation of the given value according to cfg.
+func (cfg *Config) Sprint(vals ...interface{}) string {
+ buf := new(bytes.Buffer)
+ cfg.fprint(buf, vals...)
+ return buf.String()
+}
+
+// Fprint writes the representation of the given value to the writer according to the DefaultConfig.
+func Fprint(w io.Writer, vals ...interface{}) (n int64, err error) {
+ return DefaultConfig.Fprint(w, vals...)
+}
+
+// Fprint writes the representation of the given value to the writer according to the cfg.
+func (cfg *Config) Fprint(w io.Writer, vals ...interface{}) (n int64, err error) {
+ buf := new(bytes.Buffer)
+ cfg.fprint(buf, vals...)
+ return buf.WriteTo(w)
+}
+
+// Compare returns a string containing a line-by-line unified diff of the
+// values in a and b, using the CompareConfig.
+//
+// Each line in the output is prefixed with '+', '-', or ' ' to indicate which
+// side it's from. Lines from the a side are marked with '-', lines from the
+// b side are marked with '+' and lines that are the same on both sides are
+// marked with ' '.
+//
+// The comparison is based on the intentionally-untyped output of Print, and as
+// such this comparison is pretty forviving. In particular, if the types of or
+// types within in a and b are different but have the same representation,
+// Compare will not indicate any differences between them.
+func Compare(a, b interface{}) string {
+ return CompareConfig.Compare(a, b)
+}
+
+// Compare returns a string containing a line-by-line unified diff of the
+// values in got and want according to the cfg.
+//
+// Each line in the output is prefixed with '+', '-', or ' ' to indicate which
+// side it's from. Lines from the a side are marked with '-', lines from the
+// b side are marked with '+' and lines that are the same on both sides are
+// marked with ' '.
+//
+// The comparison is based on the intentionally-untyped output of Print, and as
+// such this comparison is pretty forviving. In particular, if the types of or
+// types within in a and b are different but have the same representation,
+// Compare will not indicate any differences between them.
+func (cfg *Config) Compare(a, b interface{}) string {
+ diffCfg := *cfg
+ diffCfg.Diffable = true
+ return diff.Diff(cfg.Sprint(a), cfg.Sprint(b))
+}
diff --git a/vendor/github.com/kylelemons/godebug/pretty/reflect.go b/vendor/github.com/kylelemons/godebug/pretty/reflect.go
new file mode 100644
index 000000000..5cd30b7f0
--- /dev/null
+++ b/vendor/github.com/kylelemons/godebug/pretty/reflect.go
@@ -0,0 +1,241 @@
+// Copyright 2013 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package pretty
+
+import (
+ "encoding"
+ "fmt"
+ "reflect"
+ "sort"
+)
+
+func isZeroVal(val reflect.Value) bool {
+ if !val.CanInterface() {
+ return false
+ }
+ z := reflect.Zero(val.Type()).Interface()
+ return reflect.DeepEqual(val.Interface(), z)
+}
+
+// pointerTracker is a helper for tracking pointer chasing to detect cycles.
+type pointerTracker struct {
+ addrs map[uintptr]int // addr[address] = seen count
+
+ lastID int
+ ids map[uintptr]int // ids[address] = id
+}
+
+// track tracks following a reference (pointer, slice, map, etc). Every call to
+// track should be paired with a call to untrack.
+func (p *pointerTracker) track(ptr uintptr) {
+ if p.addrs == nil {
+ p.addrs = make(map[uintptr]int)
+ }
+ p.addrs[ptr]++
+}
+
+// untrack registers that we have backtracked over the reference to the pointer.
+func (p *pointerTracker) untrack(ptr uintptr) {
+ p.addrs[ptr]--
+ if p.addrs[ptr] == 0 {
+ delete(p.addrs, ptr)
+ }
+}
+
+// seen returns whether the pointer was previously seen along this path.
+func (p *pointerTracker) seen(ptr uintptr) bool {
+ _, ok := p.addrs[ptr]
+ return ok
+}
+
+// keep allocates an ID for the given address and returns it.
+func (p *pointerTracker) keep(ptr uintptr) int {
+ if p.ids == nil {
+ p.ids = make(map[uintptr]int)
+ }
+ if _, ok := p.ids[ptr]; !ok {
+ p.lastID++
+ p.ids[ptr] = p.lastID
+ }
+ return p.ids[ptr]
+}
+
+// id returns the ID for the given address.
+func (p *pointerTracker) id(ptr uintptr) (int, bool) {
+ if p.ids == nil {
+ p.ids = make(map[uintptr]int)
+ }
+ id, ok := p.ids[ptr]
+ return id, ok
+}
+
+// reflector adds local state to the recursive reflection logic.
+type reflector struct {
+ *Config
+ *pointerTracker
+}
+
+// follow handles following a possiblly-recursive reference to the given value
+// from the given ptr address.
+func (r *reflector) follow(ptr uintptr, val reflect.Value) node {
+ if r.pointerTracker == nil {
+ // Tracking disabled
+ return r.val2node(val)
+ }
+
+ // If a parent already followed this, emit a reference marker
+ if r.seen(ptr) {
+ id := r.keep(ptr)
+ return ref{id}
+ }
+
+ // Track the pointer we're following while on this recursive branch
+ r.track(ptr)
+ defer r.untrack(ptr)
+ n := r.val2node(val)
+
+ // If the recursion used this ptr, wrap it with a target marker
+ if id, ok := r.id(ptr); ok {
+ return target{id, n}
+ }
+
+ // Otherwise, return the node unadulterated
+ return n
+}
+
+func (r *reflector) val2node(val reflect.Value) node {
+ if !val.IsValid() {
+ return rawVal("nil")
+ }
+
+ if val.CanInterface() {
+ v := val.Interface()
+ if formatter, ok := r.Formatter[val.Type()]; ok {
+ if formatter != nil {
+ res := reflect.ValueOf(formatter).Call([]reflect.Value{val})
+ return rawVal(res[0].Interface().(string))
+ }
+ } else {
+ if s, ok := v.(fmt.Stringer); ok && r.PrintStringers {
+ return stringVal(s.String())
+ }
+ if t, ok := v.(encoding.TextMarshaler); ok && r.PrintTextMarshalers {
+ if raw, err := t.MarshalText(); err == nil { // if NOT an error
+ return stringVal(string(raw))
+ }
+ }
+ }
+ }
+
+ switch kind := val.Kind(); kind {
+ case reflect.Ptr:
+ if val.IsNil() {
+ return rawVal("nil")
+ }
+ return r.follow(val.Pointer(), val.Elem())
+ case reflect.Interface:
+ if val.IsNil() {
+ return rawVal("nil")
+ }
+ return r.val2node(val.Elem())
+ case reflect.String:
+ return stringVal(val.String())
+ case reflect.Slice:
+ n := list{}
+ length := val.Len()
+ ptr := val.Pointer()
+ for i := 0; i < length; i++ {
+ n = append(n, r.follow(ptr, val.Index(i)))
+ }
+ return n
+ case reflect.Array:
+ n := list{}
+ length := val.Len()
+ for i := 0; i < length; i++ {
+ n = append(n, r.val2node(val.Index(i)))
+ }
+ return n
+ case reflect.Map:
+ // Extract the keys and sort them for stable iteration
+ keys := val.MapKeys()
+ pairs := make([]mapPair, 0, len(keys))
+ for _, key := range keys {
+ pairs = append(pairs, mapPair{
+ key: new(formatter).compactString(r.val2node(key)), // can't be cyclic
+ value: val.MapIndex(key),
+ })
+ }
+ sort.Sort(byKey(pairs))
+
+ // Process the keys into the final representation
+ ptr, n := val.Pointer(), keyvals{}
+ for _, pair := range pairs {
+ n = append(n, keyval{
+ key: pair.key,
+ val: r.follow(ptr, pair.value),
+ })
+ }
+ return n
+ case reflect.Struct:
+ n := keyvals{}
+ typ := val.Type()
+ fields := typ.NumField()
+ for i := 0; i < fields; i++ {
+ sf := typ.Field(i)
+ if !r.IncludeUnexported && sf.PkgPath != "" {
+ continue
+ }
+ field := val.Field(i)
+ if r.SkipZeroFields && isZeroVal(field) {
+ continue
+ }
+ n = append(n, keyval{sf.Name, r.val2node(field)})
+ }
+ return n
+ case reflect.Bool:
+ if val.Bool() {
+ return rawVal("true")
+ }
+ return rawVal("false")
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ return rawVal(fmt.Sprintf("%d", val.Int()))
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
+ return rawVal(fmt.Sprintf("%d", val.Uint()))
+ case reflect.Uintptr:
+ return rawVal(fmt.Sprintf("0x%X", val.Uint()))
+ case reflect.Float32, reflect.Float64:
+ return rawVal(fmt.Sprintf("%v", val.Float()))
+ case reflect.Complex64, reflect.Complex128:
+ return rawVal(fmt.Sprintf("%v", val.Complex()))
+ }
+
+ // Fall back to the default %#v if we can
+ if val.CanInterface() {
+ return rawVal(fmt.Sprintf("%#v", val.Interface()))
+ }
+
+ return rawVal(val.String())
+}
+
+type mapPair struct {
+ key string
+ value reflect.Value
+}
+
+type byKey []mapPair
+
+func (v byKey) Len() int { return len(v) }
+func (v byKey) Swap(i, j int) { v[i], v[j] = v[j], v[i] }
+func (v byKey) Less(i, j int) bool { return v[i].key < v[j].key }
diff --git a/vendor/github.com/kylelemons/godebug/pretty/structure.go b/vendor/github.com/kylelemons/godebug/pretty/structure.go
new file mode 100644
index 000000000..d876f60ca
--- /dev/null
+++ b/vendor/github.com/kylelemons/godebug/pretty/structure.go
@@ -0,0 +1,223 @@
+// Copyright 2013 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package pretty
+
+import (
+ "bufio"
+ "bytes"
+ "fmt"
+ "io"
+ "strconv"
+ "strings"
+)
+
+// a formatter stores stateful formatting information as well as being
+// an io.Writer for simplicity.
+type formatter struct {
+ *bufio.Writer
+ *Config
+
+ // Self-referential structure tracking
+ tagNumbers map[int]int // tagNumbers[id] = <#n>
+}
+
+// newFormatter creates a new buffered formatter. For the output to be written
+// to the given writer, this must be accompanied by a call to write (or Flush).
+func newFormatter(cfg *Config, w io.Writer) *formatter {
+ return &formatter{
+ Writer: bufio.NewWriter(w),
+ Config: cfg,
+ tagNumbers: make(map[int]int),
+ }
+}
+
+func (f *formatter) write(n node) {
+ defer f.Flush()
+ n.format(f, "")
+}
+
+func (f *formatter) tagFor(id int) int {
+ if tag, ok := f.tagNumbers[id]; ok {
+ return tag
+ }
+ if f.tagNumbers == nil {
+ return 0
+ }
+ tag := len(f.tagNumbers) + 1
+ f.tagNumbers[id] = tag
+ return tag
+}
+
+type node interface {
+ format(f *formatter, indent string)
+}
+
+func (f *formatter) compactString(n node) string {
+ switch k := n.(type) {
+ case stringVal:
+ return string(k)
+ case rawVal:
+ return string(k)
+ }
+
+ buf := new(bytes.Buffer)
+ f2 := newFormatter(&Config{Compact: true}, buf)
+ f2.tagNumbers = f.tagNumbers // reuse tagNumbers just in case
+ f2.write(n)
+ return buf.String()
+}
+
+type stringVal string
+
+func (str stringVal) format(f *formatter, indent string) {
+ f.WriteString(strconv.Quote(string(str)))
+}
+
+type rawVal string
+
+func (r rawVal) format(f *formatter, indent string) {
+ f.WriteString(string(r))
+}
+
+type keyval struct {
+ key string
+ val node
+}
+
+type keyvals []keyval
+
+func (l keyvals) format(f *formatter, indent string) {
+ f.WriteByte('{')
+
+ switch {
+ case f.Compact:
+ // All on one line:
+ for i, kv := range l {
+ if i > 0 {
+ f.WriteByte(',')
+ }
+ f.WriteString(kv.key)
+ f.WriteByte(':')
+ kv.val.format(f, indent)
+ }
+ case f.Diffable:
+ f.WriteByte('\n')
+ inner := indent + " "
+ // Each value gets its own line:
+ for _, kv := range l {
+ f.WriteString(inner)
+ f.WriteString(kv.key)
+ f.WriteString(": ")
+ kv.val.format(f, inner)
+ f.WriteString(",\n")
+ }
+ f.WriteString(indent)
+ default:
+ keyWidth := 0
+ for _, kv := range l {
+ if kw := len(kv.key); kw > keyWidth {
+ keyWidth = kw
+ }
+ }
+ alignKey := indent + " "
+ alignValue := strings.Repeat(" ", keyWidth)
+ inner := alignKey + alignValue + " "
+ // First and last line shared with bracket:
+ for i, kv := range l {
+ if i > 0 {
+ f.WriteString(",\n")
+ f.WriteString(alignKey)
+ }
+ f.WriteString(kv.key)
+ f.WriteString(": ")
+ f.WriteString(alignValue[len(kv.key):])
+ kv.val.format(f, inner)
+ }
+ }
+
+ f.WriteByte('}')
+}
+
+type list []node
+
+func (l list) format(f *formatter, indent string) {
+ if max := f.ShortList; max > 0 {
+ short := f.compactString(l)
+ if len(short) <= max {
+ f.WriteString(short)
+ return
+ }
+ }
+
+ f.WriteByte('[')
+
+ switch {
+ case f.Compact:
+ // All on one line:
+ for i, v := range l {
+ if i > 0 {
+ f.WriteByte(',')
+ }
+ v.format(f, indent)
+ }
+ case f.Diffable:
+ f.WriteByte('\n')
+ inner := indent + " "
+ // Each value gets its own line:
+ for _, v := range l {
+ f.WriteString(inner)
+ v.format(f, inner)
+ f.WriteString(",\n")
+ }
+ f.WriteString(indent)
+ default:
+ inner := indent + " "
+ // First and last line shared with bracket:
+ for i, v := range l {
+ if i > 0 {
+ f.WriteString(",\n")
+ f.WriteString(inner)
+ }
+ v.format(f, inner)
+ }
+ }
+
+ f.WriteByte(']')
+}
+
+type ref struct {
+ id int
+}
+
+func (r ref) format(f *formatter, indent string) {
+ fmt.Fprintf(f, "", f.tagFor(r.id))
+}
+
+type target struct {
+ id int
+ value node
+}
+
+func (t target) format(f *formatter, indent string) {
+ tag := fmt.Sprintf("<#%d> ", f.tagFor(t.id))
+ switch {
+ case f.Diffable, f.Compact:
+ // no indent changes
+ default:
+ indent += strings.Repeat(" ", len(tag))
+ }
+ f.WriteString(tag)
+ t.value.format(f, indent)
+}
diff --git a/vendor/github.com/pkg/browser/LICENSE b/vendor/github.com/pkg/browser/LICENSE
new file mode 100644
index 000000000..65f78fb62
--- /dev/null
+++ b/vendor/github.com/pkg/browser/LICENSE
@@ -0,0 +1,23 @@
+Copyright (c) 2014, Dave Cheney
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/pkg/browser/README.md b/vendor/github.com/pkg/browser/README.md
new file mode 100644
index 000000000..72b1976e3
--- /dev/null
+++ b/vendor/github.com/pkg/browser/README.md
@@ -0,0 +1,55 @@
+
+# browser
+ import "github.com/pkg/browser"
+
+Package browser provides helpers to open files, readers, and urls in a browser window.
+
+The choice of which browser is started is entirely client dependant.
+
+
+
+
+
+## Variables
+``` go
+var Stderr io.Writer = os.Stderr
+```
+Stderr is the io.Writer to which executed commands write standard error.
+
+``` go
+var Stdout io.Writer = os.Stdout
+```
+Stdout is the io.Writer to which executed commands write standard output.
+
+
+## func OpenFile
+``` go
+func OpenFile(path string) error
+```
+OpenFile opens new browser window for the file path.
+
+
+## func OpenReader
+``` go
+func OpenReader(r io.Reader) error
+```
+OpenReader consumes the contents of r and presents the
+results in a new browser window.
+
+
+## func OpenURL
+``` go
+func OpenURL(url string) error
+```
+OpenURL opens a new browser window pointing to url.
+
+
+
+
+
+
+
+
+
+- - -
+Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md)
diff --git a/vendor/github.com/pkg/browser/browser.go b/vendor/github.com/pkg/browser/browser.go
new file mode 100644
index 000000000..d7969d74d
--- /dev/null
+++ b/vendor/github.com/pkg/browser/browser.go
@@ -0,0 +1,57 @@
+// Package browser provides helpers to open files, readers, and urls in a browser window.
+//
+// The choice of which browser is started is entirely client dependant.
+package browser
+
+import (
+ "fmt"
+ "io"
+ "io/ioutil"
+ "os"
+ "os/exec"
+ "path/filepath"
+)
+
+// Stdout is the io.Writer to which executed commands write standard output.
+var Stdout io.Writer = os.Stdout
+
+// Stderr is the io.Writer to which executed commands write standard error.
+var Stderr io.Writer = os.Stderr
+
+// OpenFile opens new browser window for the file path.
+func OpenFile(path string) error {
+ path, err := filepath.Abs(path)
+ if err != nil {
+ return err
+ }
+ return OpenURL("file://" + path)
+}
+
+// OpenReader consumes the contents of r and presents the
+// results in a new browser window.
+func OpenReader(r io.Reader) error {
+ f, err := ioutil.TempFile("", "browser.*.html")
+ if err != nil {
+ return fmt.Errorf("browser: could not create temporary file: %v", err)
+ }
+ if _, err := io.Copy(f, r); err != nil {
+ f.Close()
+ return fmt.Errorf("browser: caching temporary file failed: %v", err)
+ }
+ if err := f.Close(); err != nil {
+ return fmt.Errorf("browser: caching temporary file failed: %v", err)
+ }
+ return OpenFile(f.Name())
+}
+
+// OpenURL opens a new browser window pointing to url.
+func OpenURL(url string) error {
+ return openBrowser(url)
+}
+
+func runCmd(prog string, args ...string) error {
+ cmd := exec.Command(prog, args...)
+ cmd.Stdout = Stdout
+ cmd.Stderr = Stderr
+ return cmd.Run()
+}
diff --git a/vendor/github.com/pkg/browser/browser_darwin.go b/vendor/github.com/pkg/browser/browser_darwin.go
new file mode 100644
index 000000000..8507cf7c2
--- /dev/null
+++ b/vendor/github.com/pkg/browser/browser_darwin.go
@@ -0,0 +1,5 @@
+package browser
+
+func openBrowser(url string) error {
+ return runCmd("open", url)
+}
diff --git a/vendor/github.com/pkg/browser/browser_freebsd.go b/vendor/github.com/pkg/browser/browser_freebsd.go
new file mode 100644
index 000000000..4fc7ff076
--- /dev/null
+++ b/vendor/github.com/pkg/browser/browser_freebsd.go
@@ -0,0 +1,14 @@
+package browser
+
+import (
+ "errors"
+ "os/exec"
+)
+
+func openBrowser(url string) error {
+ err := runCmd("xdg-open", url)
+ if e, ok := err.(*exec.Error); ok && e.Err == exec.ErrNotFound {
+ return errors.New("xdg-open: command not found - install xdg-utils from ports(8)")
+ }
+ return err
+}
diff --git a/vendor/github.com/pkg/browser/browser_linux.go b/vendor/github.com/pkg/browser/browser_linux.go
new file mode 100644
index 000000000..d26cdddf9
--- /dev/null
+++ b/vendor/github.com/pkg/browser/browser_linux.go
@@ -0,0 +1,21 @@
+package browser
+
+import (
+ "os/exec"
+ "strings"
+)
+
+func openBrowser(url string) error {
+ providers := []string{"xdg-open", "x-www-browser", "www-browser"}
+
+ // There are multiple possible providers to open a browser on linux
+ // One of them is xdg-open, another is x-www-browser, then there's www-browser, etc.
+ // Look for one that exists and run it
+ for _, provider := range providers {
+ if _, err := exec.LookPath(provider); err == nil {
+ return runCmd(provider, url)
+ }
+ }
+
+ return &exec.Error{Name: strings.Join(providers, ","), Err: exec.ErrNotFound}
+}
diff --git a/vendor/github.com/pkg/browser/browser_netbsd.go b/vendor/github.com/pkg/browser/browser_netbsd.go
new file mode 100644
index 000000000..65a5e5a29
--- /dev/null
+++ b/vendor/github.com/pkg/browser/browser_netbsd.go
@@ -0,0 +1,14 @@
+package browser
+
+import (
+ "errors"
+ "os/exec"
+)
+
+func openBrowser(url string) error {
+ err := runCmd("xdg-open", url)
+ if e, ok := err.(*exec.Error); ok && e.Err == exec.ErrNotFound {
+ return errors.New("xdg-open: command not found - install xdg-utils from pkgsrc(7)")
+ }
+ return err
+}
diff --git a/vendor/github.com/pkg/browser/browser_openbsd.go b/vendor/github.com/pkg/browser/browser_openbsd.go
new file mode 100644
index 000000000..4fc7ff076
--- /dev/null
+++ b/vendor/github.com/pkg/browser/browser_openbsd.go
@@ -0,0 +1,14 @@
+package browser
+
+import (
+ "errors"
+ "os/exec"
+)
+
+func openBrowser(url string) error {
+ err := runCmd("xdg-open", url)
+ if e, ok := err.(*exec.Error); ok && e.Err == exec.ErrNotFound {
+ return errors.New("xdg-open: command not found - install xdg-utils from ports(8)")
+ }
+ return err
+}
diff --git a/vendor/github.com/pkg/browser/browser_unsupported.go b/vendor/github.com/pkg/browser/browser_unsupported.go
new file mode 100644
index 000000000..7c5c17d34
--- /dev/null
+++ b/vendor/github.com/pkg/browser/browser_unsupported.go
@@ -0,0 +1,12 @@
+// +build !linux,!windows,!darwin,!openbsd,!freebsd,!netbsd
+
+package browser
+
+import (
+ "fmt"
+ "runtime"
+)
+
+func openBrowser(url string) error {
+ return fmt.Errorf("openBrowser: unsupported operating system: %v", runtime.GOOS)
+}
diff --git a/vendor/github.com/pkg/browser/browser_windows.go b/vendor/github.com/pkg/browser/browser_windows.go
new file mode 100644
index 000000000..63e192959
--- /dev/null
+++ b/vendor/github.com/pkg/browser/browser_windows.go
@@ -0,0 +1,7 @@
+package browser
+
+import "golang.org/x/sys/windows"
+
+func openBrowser(url string) error {
+ return windows.ShellExecute(0, nil, windows.StringToUTF16Ptr(url), nil, nil, windows.SW_SHOWNORMAL)
+}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 0474224ad..96814ef22 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -24,18 +24,16 @@ cloud.google.com/go/storage/internal/apiv2
cloud.google.com/go/storage/internal/apiv2/storagepb
# github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
## explicit
-github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute
-github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/resources/mgmt/resources
-github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/storage/mgmt/storage
-github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute
github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-09-01/network
-github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources
github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-05-01/resources
-github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage
github.com/Azure/azure-sdk-for-go/version
# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1
## explicit; go 1.18
github.com/Azure/azure-sdk-for-go/sdk/azcore
+github.com/Azure/azure-sdk-for-go/sdk/azcore/arm
+github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource
+github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy
+github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime
github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud
github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported
github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log
@@ -52,6 +50,9 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime
github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming
github.com/Azure/azure-sdk-for-go/sdk/azcore/to
github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing
+# github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0
+## explicit; go 1.18
+github.com/Azure/azure-sdk-for-go/sdk/azidentity
# github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1
## explicit; go 1.18
github.com/Azure/azure-sdk-for-go/sdk/internal/diag
@@ -61,6 +62,15 @@ github.com/Azure/azure-sdk-for-go/sdk/internal/log
github.com/Azure/azure-sdk-for-go/sdk/internal/poller
github.com/Azure/azure-sdk-for-go/sdk/internal/temporal
github.com/Azure/azure-sdk-for-go/sdk/internal/uuid
+# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.3.0
+## explicit; go 1.18
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5
+# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0
+## explicit; go 1.18
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources
+# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0
+## explicit; go 1.18
+github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage
# github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1
## explicit; go 1.18
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob
@@ -107,6 +117,29 @@ github.com/Azure/go-autorest/logger
# github.com/Azure/go-autorest/tracing v0.6.0
## explicit; go 1.12
github.com/Azure/go-autorest/tracing
+# github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1
+## explicit; go 1.18
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/grant
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/options
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version
+github.com/AzureAD/microsoft-authentication-library-for-go/apps/public
# github.com/BurntSushi/toml v1.3.2
## explicit; go 1.16
github.com/BurntSushi/toml
@@ -413,6 +446,9 @@ github.com/golang-jwt/jwt
# github.com/golang-jwt/jwt/v4 v4.5.0
## explicit; go 1.16
github.com/golang-jwt/jwt/v4
+# github.com/golang-jwt/jwt/v5 v5.0.0
+## explicit; go 1.18
+github.com/golang-jwt/jwt/v5
# github.com/golang/glog v1.1.2
## explicit; go 1.19
github.com/golang/glog
@@ -576,6 +612,10 @@ github.com/kolo/xmlrpc
# github.com/kr/text v0.2.0
## explicit
github.com/kr/text
+# github.com/kylelemons/godebug v1.1.0
+## explicit; go 1.11
+github.com/kylelemons/godebug/diff
+github.com/kylelemons/godebug/pretty
# github.com/labstack/echo/v4 v4.11.4
## explicit; go 1.18
github.com/labstack/echo/v4
@@ -709,6 +749,9 @@ github.com/osbuild/osbuild-composer/pkg/splunk_logger
# github.com/osbuild/pulp-client v0.1.0
## explicit; go 1.19
github.com/osbuild/pulp-client/pulpclient
+# github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
+## explicit; go 1.14
+github.com/pkg/browser
# github.com/pkg/errors v0.9.1
## explicit
github.com/pkg/errors