diff --git a/azurerm/internal/services/powerbi/client/client.go b/azurerm/internal/services/powerbi/client/client.go index eab8f0e51c92..c35ec36342d2 100644 --- a/azurerm/internal/services/powerbi/client/client.go +++ b/azurerm/internal/services/powerbi/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated" + "github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/powerbi/powerbi_embedded_resource.go b/azurerm/internal/services/powerbi/powerbi_embedded_resource.go index 80a75c81735c..e73d17616aa2 100644 --- a/azurerm/internal/services/powerbi/powerbi_embedded_resource.go +++ b/azurerm/internal/services/powerbi/powerbi_embedded_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated" + "github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated" "github.com/hashicorp/go-azure-helpers/response" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -72,6 +72,17 @@ func resourcePowerBIEmbedded() *pluginsdk.Resource { }, }, + "mode": { + Type: pluginsdk.TypeString, + Optional: true, + Default: string(powerbidedicated.ModeGen1), + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(powerbidedicated.ModeGen1), + string(powerbidedicated.ModeGen2), + }, false), + }, + "tags": tags.Schema(), }, } @@ -98,6 +109,7 @@ func resourcePowerBIEmbeddedCreate(d *pluginsdk.ResourceData, meta interface{}) location := azure.NormalizeLocation(d.Get("location").(string)) administrators := d.Get("administrators").(*pluginsdk.Set).List() skuName := d.Get("sku_name").(string) + mode := d.Get("mode").(string) t := d.Get("tags").(map[string]interface{}) parameters := powerbidedicated.DedicatedCapacity{ @@ -106,8 +118,9 @@ func resourcePowerBIEmbeddedCreate(d *pluginsdk.ResourceData, meta interface{}) Administration: &powerbidedicated.DedicatedCapacityAdministrators{ Members: utils.ExpandStringSlice(administrators), }, + Mode: powerbidedicated.Mode(mode), }, - Sku: &powerbidedicated.ResourceSku{ + Sku: &powerbidedicated.CapacitySku{ Name: utils.String(skuName), }, Tags: tags.Expand(t), @@ -162,6 +175,8 @@ func resourcePowerBIEmbeddedRead(d *pluginsdk.ResourceData, meta interface{}) er if err := d.Set("administrators", utils.FlattenStringSlice(props.Administration.Members)); err != nil { return fmt.Errorf("Error setting `administration`: %+v", err) } + + d.Set("mode", props.Mode) } skuName := "" @@ -182,6 +197,7 @@ func resourcePowerBIEmbeddedUpdate(d *pluginsdk.ResourceData, meta interface{}) resourceGroup := d.Get("resource_group_name").(string) administrators := d.Get("administrators").(*pluginsdk.Set).List() skuName := d.Get("sku_name").(string) + mode := d.Get("mode").(string) t := d.Get("tags").(map[string]interface{}) parameters := powerbidedicated.DedicatedCapacityUpdateParameters{ @@ -189,8 +205,9 @@ func resourcePowerBIEmbeddedUpdate(d *pluginsdk.ResourceData, meta interface{}) Administration: &powerbidedicated.DedicatedCapacityAdministrators{ Members: utils.ExpandStringSlice(administrators), }, + Mode: powerbidedicated.Mode(mode), }, - Sku: &powerbidedicated.ResourceSku{ + Sku: &powerbidedicated.CapacitySku{ Name: utils.String(skuName), }, Tags: tags.Expand(t), diff --git a/azurerm/internal/services/powerbi/powerbi_embedded_resource_test.go b/azurerm/internal/services/powerbi/powerbi_embedded_resource_test.go index 0a0fdeabfa00..d4b65f2255ec 100644 --- a/azurerm/internal/services/powerbi/powerbi_embedded_resource_test.go +++ b/azurerm/internal/services/powerbi/powerbi_embedded_resource_test.go @@ -31,70 +31,81 @@ func TestAccPowerBIEmbedded_basic(t *testing.T) { }) } -func TestAccPowerBIEmbedded_requiresImport(t *testing.T) { +func TestAccPowerBIEmbedded_complete(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_powerbi_embedded", "test") r := PowerBIEmbeddedResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.basic(data), + Config: r.complete(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, - { - Config: r.requiresImport(data), - ExpectError: acceptance.RequiresImportError("azurerm_powerbi_embedded"), - }, + data.ImportStep(), }) } -func TestAccPowerBIEmbedded_complete(t *testing.T) { +func TestAccPowerBIEmbedded_update(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_powerbi_embedded", "test") r := PowerBIEmbeddedResource{} data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), { Config: r.complete(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("sku_name").HasValue("A2"), - check.That(data.ResourceName).Key("tags.ENV").HasValue("Test"), + ), + }, + data.ImportStep(), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), ), }, data.ImportStep(), }) } -func TestAccPowerBIEmbedded_update(t *testing.T) { +func TestAccPowerBIEmbedded_gen2(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_powerbi_embedded", "test") r := PowerBIEmbeddedResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.basic(data), + Config: r.gen2(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("sku_name").HasValue("A1"), + check.That(data.ResourceName).Key("mode").HasValue("Gen2"), ), }, data.ImportStep(), + }) +} + +func TestAccPowerBIEmbedded_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_powerbi_embedded", "test") + r := PowerBIEmbeddedResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.complete(data), + Config: r.basic(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("sku_name").HasValue("A2"), ), }, - data.ImportStep(), { - Config: r.basic(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("sku_name").HasValue("A1"), - ), + Config: r.requiresImport(data), + ExpectError: acceptance.RequiresImportError("azurerm_powerbi_embedded"), }, - data.ImportStep(), }) } @@ -112,65 +123,78 @@ func (PowerBIEmbeddedResource) Exists(ctx context.Context, clients *clients.Clie return utils.Bool(resp.DedicatedCapacityProperties != nil), nil } -func (PowerBIEmbeddedResource) basic(data acceptance.TestData) string { - template := PowerBIEmbeddedResource{}.template(data) +func (PowerBIEmbeddedResource) template(data acceptance.TestData) string { return fmt.Sprintf(` -%s +provider "azurerm" { + features {} +} -resource "azurerm_powerbi_embedded" "test" { - name = "acctestpowerbi%d" - location = "${azurerm_resource_group.test.location}" - resource_group_name = "${azurerm_resource_group.test.name}" - sku_name = "A1" - administrators = ["${data.azurerm_client_config.test.object_id}"] +resource "azurerm_resource_group" "test" { + name = "acctestRG-powerbi-%[1]d" + location = "%[2]s" } -`, template, data.RandomInteger) + +data "azurerm_client_config" "test" {} +`, data.RandomInteger, data.Locations.Primary) } -func (r PowerBIEmbeddedResource) requiresImport(data acceptance.TestData) string { +func (r PowerBIEmbeddedResource) basic(data acceptance.TestData) string { return fmt.Sprintf(` -%s +%[1]s -resource "azurerm_powerbi_embedded" "import" { - name = "${azurerm_powerbi_embedded.test.name}" - location = "${azurerm_powerbi_embedded.test.location}" - resource_group_name = "${azurerm_resource_group.test.name}" +resource "azurerm_powerbi_embedded" "test" { + name = "acctestpowerbi%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name sku_name = "A1" - administrators = ["${data.azurerm_client_config.test.object_id}"] + administrators = [data.azurerm_client_config.test.object_id] } -`, r.basic(data)) +`, r.template(data), data.RandomInteger) } -func (PowerBIEmbeddedResource) complete(data acceptance.TestData) string { - template := PowerBIEmbeddedResource{}.template(data) +func (r PowerBIEmbeddedResource) complete(data acceptance.TestData) string { return fmt.Sprintf(` -%s +%[1]s resource "azurerm_powerbi_embedded" "test" { - name = "acctestpowerbi%d" - location = "${azurerm_resource_group.test.location}" - resource_group_name = "${azurerm_resource_group.test.name}" + name = "acctestpowerbi%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name sku_name = "A2" - administrators = ["${data.azurerm_client_config.test.object_id}"] + administrators = [data.azurerm_client_config.test.object_id] tags = { ENV = "Test" } } -`, template, data.RandomInteger) +`, r.template(data), data.RandomInteger) } -func (PowerBIEmbeddedResource) template(data acceptance.TestData) string { +func (r PowerBIEmbeddedResource) gen2(data acceptance.TestData) string { return fmt.Sprintf(` -provider "azurerm" { - features {} -} +%[1]s -resource "azurerm_resource_group" "test" { - name = "acctestRG-powerbi-%d" - location = "%s" +resource "azurerm_powerbi_embedded" "test" { + name = "acctestpowerbi%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_name = "A1" + administrators = [data.azurerm_client_config.test.object_id] + mode = "Gen2" +} +`, r.template(data), data.RandomInteger) } -data "azurerm_client_config" "test" {} -`, data.RandomInteger, data.Locations.Primary) +func (r PowerBIEmbeddedResource) requiresImport(data acceptance.TestData) string { + return fmt.Sprintf(` +%[1]s + +resource "azurerm_powerbi_embedded" "import" { + name = azurerm_powerbi_embedded.test.name + location = azurerm_powerbi_embedded.test.location + resource_group_name = azurerm_resource_group.test.name + sku_name = "A1" + administrators = [data.azurerm_client_config.test.object_id] +} +`, r.basic(data)) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/CHANGELOG.md deleted file mode 100644 index fa72975a9186..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# Change History - -## Additive Changes - -### New Funcs - -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. OperationListResult.MarshalJSON() ([]byte, error) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/enums.go deleted file mode 100644 index 8287a3ee6eed..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/enums.go +++ /dev/null @@ -1,90 +0,0 @@ -package powerbidedicated - -// 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. - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // Deleting ... - Deleting ProvisioningState = "Deleting" - // Failed ... - Failed ProvisioningState = "Failed" - // Paused ... - Paused ProvisioningState = "Paused" - // Pausing ... - Pausing ProvisioningState = "Pausing" - // Preparing ... - Preparing ProvisioningState = "Preparing" - // Provisioning ... - Provisioning ProvisioningState = "Provisioning" - // Resuming ... - Resuming ProvisioningState = "Resuming" - // Scaling ... - Scaling ProvisioningState = "Scaling" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" - // Suspended ... - Suspended ProvisioningState = "Suspended" - // Suspending ... - Suspending ProvisioningState = "Suspending" - // Updating ... - Updating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Deleting, Failed, Paused, Pausing, Preparing, Provisioning, Resuming, Scaling, Succeeded, Suspended, Suspending, Updating} -} - -// SkuTier enumerates the values for sku tier. -type SkuTier string - -const ( - // PBIEAzure ... - PBIEAzure SkuTier = "PBIE_Azure" -) - -// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. -func PossibleSkuTierValues() []SkuTier { - return []SkuTier{PBIEAzure} -} - -// State enumerates the values for state. -type State string - -const ( - // StateDeleting ... - StateDeleting State = "Deleting" - // StateFailed ... - StateFailed State = "Failed" - // StatePaused ... - StatePaused State = "Paused" - // StatePausing ... - StatePausing State = "Pausing" - // StatePreparing ... - StatePreparing State = "Preparing" - // StateProvisioning ... - StateProvisioning State = "Provisioning" - // StateResuming ... - StateResuming State = "Resuming" - // StateScaling ... - StateScaling State = "Scaling" - // StateSucceeded ... - StateSucceeded State = "Succeeded" - // StateSuspended ... - StateSuspended State = "Suspended" - // StateSuspending ... - StateSuspending State = "Suspending" - // StateUpdating ... - StateUpdating State = "Updating" -) - -// PossibleStateValues returns an array of possible values for the State const type. -func PossibleStateValues() []State { - return []State{StateDeleting, StateFailed, StatePaused, StatePausing, StatePreparing, StateProvisioning, StateResuming, StateScaling, StateSucceeded, StateSuspended, StateSuspending, StateUpdating} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/CHANGELOG.md new file mode 100644 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/_meta.json similarity index 56% rename from vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/_meta.json rename to vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/_meta.json index f0f9de48ada1..834d5c3996f7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/_meta.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/_meta.json @@ -1,11 +1,11 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "5f9965cd81e1651c38651ddc9a964a7f1ba4b218", "readme": "/_/azure-rest-api-specs/specification/powerbidedicated/resource-manager/readme.md", - "tag": "package-2017-10-01", + "tag": "package-2021-01-01", "use": "@microsoft.azure/autorest.go@2.1.183", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2017-10-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/powerbidedicated/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2021-01-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/powerbidedicated/resource-manager/readme.md", "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" } } \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/autoscalevcores.go b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/autoscalevcores.go new file mode 100644 index 000000000000..2fdb17be9594 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/autoscalevcores.go @@ -0,0 +1,551 @@ +package powerbidedicated + +// 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" +) + +// AutoScaleVCoresClient is the powerBI Dedicated Web API provides a RESTful set of web services that enables users to +// create, retrieve, update, and delete Power BI dedicated capacities +type AutoScaleVCoresClient struct { + BaseClient +} + +// NewAutoScaleVCoresClient creates an instance of the AutoScaleVCoresClient client. +func NewAutoScaleVCoresClient(subscriptionID string) AutoScaleVCoresClient { + return NewAutoScaleVCoresClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAutoScaleVCoresClientWithBaseURI creates an instance of the AutoScaleVCoresClient 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 NewAutoScaleVCoresClientWithBaseURI(baseURI string, subscriptionID string) AutoScaleVCoresClient { + return AutoScaleVCoresClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create provisions the specified auto scale v-core based on the configuration specified in the request. +// Parameters: +// resourceGroupName - the name of the Azure Resource group of which a given PowerBIDedicated capacity is part. +// This name must be at least 1 character in length, and no more than 90. +// vcoreName - the name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. +// vCoreParameters - contains the information used to provision the auto scale v-core. +func (client AutoScaleVCoresClient) Create(ctx context.Context, resourceGroupName string, vcoreName string, vCoreParameters AutoScaleVCore) (result AutoScaleVCore, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutoScaleVCoresClient.Create") + 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: vcoreName, + Constraints: []validation.Constraint{{Target: "vcoreName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "vcoreName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "vcoreName", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9_]+$`, Chain: nil}}}, + {TargetValue: vCoreParameters, + Constraints: []validation.Constraint{{Target: "vCoreParameters.Sku", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "vCoreParameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("powerbidedicated.AutoScaleVCoresClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, vcoreName, vCoreParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client AutoScaleVCoresClient) CreatePreparer(ctx context.Context, resourceGroupName string, vcoreName string, vCoreParameters AutoScaleVCore) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcoreName": autorest.Encode("path", vcoreName), + } + + const APIVersion = "2021-01-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.PowerBIDedicated/autoScaleVCores/{vcoreName}", pathParameters), + autorest.WithJSON(vCoreParameters), + 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 AutoScaleVCoresClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client AutoScaleVCoresClient) CreateResponder(resp *http.Response) (result AutoScaleVCore, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified auto scale v-core. +// Parameters: +// resourceGroupName - the name of the Azure Resource group of which a given PowerBIDedicated capacity is part. +// This name must be at least 1 character in length, and no more than 90. +// vcoreName - the name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. +func (client AutoScaleVCoresClient) Delete(ctx context.Context, resourceGroupName string, vcoreName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutoScaleVCoresClient.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: vcoreName, + Constraints: []validation.Constraint{{Target: "vcoreName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "vcoreName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "vcoreName", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9_]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("powerbidedicated.AutoScaleVCoresClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, vcoreName) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AutoScaleVCoresClient) DeletePreparer(ctx context.Context, resourceGroupName string, vcoreName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcoreName": autorest.Encode("path", vcoreName), + } + + const APIVersion = "2021-01-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.PowerBIDedicated/autoScaleVCores/{vcoreName}", 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 AutoScaleVCoresClient) 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 AutoScaleVCoresClient) 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 +} + +// Get gets details about the specified auto scale v-core. +// Parameters: +// resourceGroupName - the name of the Azure Resource group of which a given PowerBIDedicated capacity is part. +// This name must be at least 1 character in length, and no more than 90. +// vcoreName - the name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. +func (client AutoScaleVCoresClient) Get(ctx context.Context, resourceGroupName string, vcoreName string) (result AutoScaleVCore, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutoScaleVCoresClient.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: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: vcoreName, + Constraints: []validation.Constraint{{Target: "vcoreName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "vcoreName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "vcoreName", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9_]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("powerbidedicated.AutoScaleVCoresClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, vcoreName) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AutoScaleVCoresClient) GetPreparer(ctx context.Context, resourceGroupName string, vcoreName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcoreName": autorest.Encode("path", vcoreName), + } + + const APIVersion = "2021-01-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.PowerBIDedicated/autoScaleVCores/{vcoreName}", 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 AutoScaleVCoresClient) 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 AutoScaleVCoresClient) GetResponder(resp *http.Response) (result AutoScaleVCore, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup gets all the auto scale v-cores for the given resource group. +// Parameters: +// resourceGroupName - the name of the Azure Resource group of which a given PowerBIDedicated capacity is part. +// This name must be at least 1 character in length, and no more than 90. +func (client AutoScaleVCoresClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AutoScaleVCoreListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutoScaleVCoresClient.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("powerbidedicated.AutoScaleVCoresClient", "ListByResourceGroup", err.Error()) + } + + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AutoScaleVCoresClient) 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 = "2021-01-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.PowerBIDedicated/autoScaleVCores", 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 AutoScaleVCoresClient) 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 AutoScaleVCoresClient) ListByResourceGroupResponder(resp *http.Response) (result AutoScaleVCoreListResult, 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 the auto scale v-cores for the given subscription. +func (client AutoScaleVCoresClient) ListBySubscription(ctx context.Context) (result AutoScaleVCoreListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutoScaleVCoresClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "ListBySubscription", resp, "Failure responding to request") + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AutoScaleVCoresClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/autoScaleVCores", 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 AutoScaleVCoresClient) 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 AutoScaleVCoresClient) ListBySubscriptionResponder(resp *http.Response) (result AutoScaleVCoreListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates the current state of the specified auto scale v-core. +// Parameters: +// resourceGroupName - the name of the Azure Resource group of which a given PowerBIDedicated capacity is part. +// This name must be at least 1 character in length, and no more than 90. +// vcoreName - the name of the auto scale v-core. It must be a minimum of 3 characters, and a maximum of 63. +// vCoreUpdateParameters - request object that contains the updated information for the auto scale v-core. +func (client AutoScaleVCoresClient) Update(ctx context.Context, resourceGroupName string, vcoreName string, vCoreUpdateParameters AutoScaleVCoreUpdateParameters) (result AutoScaleVCore, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutoScaleVCoresClient.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: vcoreName, + Constraints: []validation.Constraint{{Target: "vcoreName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "vcoreName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "vcoreName", Name: validation.Pattern, Rule: `^[-a-zA-Z0-9_]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("powerbidedicated.AutoScaleVCoresClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, vcoreName, vCoreUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "powerbidedicated.AutoScaleVCoresClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AutoScaleVCoresClient) UpdatePreparer(ctx context.Context, resourceGroupName string, vcoreName string, vCoreUpdateParameters AutoScaleVCoreUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vcoreName": autorest.Encode("path", vcoreName), + } + + const APIVersion = "2021-01-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.PowerBIDedicated/autoScaleVCores/{vcoreName}", pathParameters), + autorest.WithJSON(vCoreUpdateParameters), + 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 AutoScaleVCoresClient) 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 AutoScaleVCoresClient) UpdateResponder(resp *http.Response) (result AutoScaleVCore, 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/powerbidedicated/mgmt/2017-10-01/powerbidedicated/capacities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/capacities.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/capacities.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/capacities.go index 0a3f025b6e63..3aa7a6ce53e4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/capacities.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/capacities.go @@ -86,7 +86,7 @@ func (client CapacitiesClient) CheckNameAvailabilityPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -145,7 +145,10 @@ func (client CapacitiesClient) Create(ctx context.Context, resourceGroupName str {TargetValue: dedicatedCapacityName, Constraints: []validation.Constraint{{Target: "dedicatedCapacityName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "dedicatedCapacityName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "dedicatedCapacityName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}}); err != nil { + {Target: "dedicatedCapacityName", Name: validation.Pattern, Rule: `^[a-z][a-z0-9]*$`, Chain: nil}}}, + {TargetValue: capacityParameters, + Constraints: []validation.Constraint{{Target: "capacityParameters.Sku", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "capacityParameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("powerbidedicated.CapacitiesClient", "Create", err.Error()) } @@ -172,7 +175,7 @@ func (client CapacitiesClient) CreatePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -266,7 +269,7 @@ func (client CapacitiesClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -364,7 +367,7 @@ func (client CapacitiesClient) GetDetailsPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -435,7 +438,7 @@ func (client CapacitiesClient) ListPreparer(ctx context.Context) (*http.Request, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -518,7 +521,7 @@ func (client CapacitiesClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -589,7 +592,7 @@ func (client CapacitiesClient) ListSkusPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -679,7 +682,7 @@ func (client CapacitiesClient) ListSkusForCapacityPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -762,7 +765,7 @@ func (client CapacitiesClient) ResumePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -853,7 +856,7 @@ func (client CapacitiesClient) SuspendPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -945,7 +948,7 @@ func (client CapacitiesClient) UpdatePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/client.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/client.go index 0d60bde2105d..f11d9a4350f1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/client.go @@ -1,4 +1,4 @@ -// Package powerbidedicated implements the Azure ARM Powerbidedicated service API version 2017-10-01. +// Package powerbidedicated implements the Azure ARM Powerbidedicated service API version 2021-01-01. // // PowerBI Dedicated Web API provides a RESTful set of web services that enables users to create, retrieve, update, and // delete Power BI dedicated capacities diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/enums.go new file mode 100644 index 000000000000..940bc98db10e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/enums.go @@ -0,0 +1,154 @@ +package powerbidedicated + +// 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. + +// CapacityProvisioningState enumerates the values for capacity provisioning state. +type CapacityProvisioningState string + +const ( + // CapacityProvisioningStateDeleting ... + CapacityProvisioningStateDeleting CapacityProvisioningState = "Deleting" + // CapacityProvisioningStateFailed ... + CapacityProvisioningStateFailed CapacityProvisioningState = "Failed" + // CapacityProvisioningStatePaused ... + CapacityProvisioningStatePaused CapacityProvisioningState = "Paused" + // CapacityProvisioningStatePausing ... + CapacityProvisioningStatePausing CapacityProvisioningState = "Pausing" + // CapacityProvisioningStatePreparing ... + CapacityProvisioningStatePreparing CapacityProvisioningState = "Preparing" + // CapacityProvisioningStateProvisioning ... + CapacityProvisioningStateProvisioning CapacityProvisioningState = "Provisioning" + // CapacityProvisioningStateResuming ... + CapacityProvisioningStateResuming CapacityProvisioningState = "Resuming" + // CapacityProvisioningStateScaling ... + CapacityProvisioningStateScaling CapacityProvisioningState = "Scaling" + // CapacityProvisioningStateSucceeded ... + CapacityProvisioningStateSucceeded CapacityProvisioningState = "Succeeded" + // CapacityProvisioningStateSuspended ... + CapacityProvisioningStateSuspended CapacityProvisioningState = "Suspended" + // CapacityProvisioningStateSuspending ... + CapacityProvisioningStateSuspending CapacityProvisioningState = "Suspending" + // CapacityProvisioningStateUpdating ... + CapacityProvisioningStateUpdating CapacityProvisioningState = "Updating" +) + +// PossibleCapacityProvisioningStateValues returns an array of possible values for the CapacityProvisioningState const type. +func PossibleCapacityProvisioningStateValues() []CapacityProvisioningState { + return []CapacityProvisioningState{CapacityProvisioningStateDeleting, CapacityProvisioningStateFailed, CapacityProvisioningStatePaused, CapacityProvisioningStatePausing, CapacityProvisioningStatePreparing, CapacityProvisioningStateProvisioning, CapacityProvisioningStateResuming, CapacityProvisioningStateScaling, CapacityProvisioningStateSucceeded, CapacityProvisioningStateSuspended, CapacityProvisioningStateSuspending, CapacityProvisioningStateUpdating} +} + +// CapacitySkuTier enumerates the values for capacity sku tier. +type CapacitySkuTier string + +const ( + // CapacitySkuTierAutoPremiumHost ... + CapacitySkuTierAutoPremiumHost CapacitySkuTier = "AutoPremiumHost" + // CapacitySkuTierPBIEAzure ... + CapacitySkuTierPBIEAzure CapacitySkuTier = "PBIE_Azure" + // CapacitySkuTierPremium ... + CapacitySkuTierPremium CapacitySkuTier = "Premium" +) + +// PossibleCapacitySkuTierValues returns an array of possible values for the CapacitySkuTier const type. +func PossibleCapacitySkuTierValues() []CapacitySkuTier { + return []CapacitySkuTier{CapacitySkuTierAutoPremiumHost, CapacitySkuTierPBIEAzure, CapacitySkuTierPremium} +} + +// IdentityType enumerates the values for identity type. +type IdentityType string + +const ( + // IdentityTypeApplication ... + IdentityTypeApplication IdentityType = "Application" + // IdentityTypeKey ... + IdentityTypeKey IdentityType = "Key" + // IdentityTypeManagedIdentity ... + IdentityTypeManagedIdentity IdentityType = "ManagedIdentity" + // IdentityTypeUser ... + IdentityTypeUser IdentityType = "User" +) + +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() []IdentityType { + return []IdentityType{IdentityTypeApplication, IdentityTypeKey, IdentityTypeManagedIdentity, IdentityTypeUser} +} + +// Mode enumerates the values for mode. +type Mode string + +const ( + // ModeGen1 ... + ModeGen1 Mode = "Gen1" + // ModeGen2 ... + ModeGen2 Mode = "Gen2" +) + +// PossibleModeValues returns an array of possible values for the Mode const type. +func PossibleModeValues() []Mode { + return []Mode{ModeGen1, ModeGen2} +} + +// State enumerates the values for state. +type State string + +const ( + // StateDeleting ... + StateDeleting State = "Deleting" + // StateFailed ... + StateFailed State = "Failed" + // StatePaused ... + StatePaused State = "Paused" + // StatePausing ... + StatePausing State = "Pausing" + // StatePreparing ... + StatePreparing State = "Preparing" + // StateProvisioning ... + StateProvisioning State = "Provisioning" + // StateResuming ... + StateResuming State = "Resuming" + // StateScaling ... + StateScaling State = "Scaling" + // StateSucceeded ... + StateSucceeded State = "Succeeded" + // StateSuspended ... + StateSuspended State = "Suspended" + // StateSuspending ... + StateSuspending State = "Suspending" + // StateUpdating ... + StateUpdating State = "Updating" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{StateDeleting, StateFailed, StatePaused, StatePausing, StatePreparing, StateProvisioning, StateResuming, StateScaling, StateSucceeded, StateSuspended, StateSuspending, StateUpdating} +} + +// VCoreProvisioningState enumerates the values for v core provisioning state. +type VCoreProvisioningState string + +const ( + // VCoreProvisioningStateSucceeded ... + VCoreProvisioningStateSucceeded VCoreProvisioningState = "Succeeded" +) + +// PossibleVCoreProvisioningStateValues returns an array of possible values for the VCoreProvisioningState const type. +func PossibleVCoreProvisioningStateValues() []VCoreProvisioningState { + return []VCoreProvisioningState{VCoreProvisioningStateSucceeded} +} + +// VCoreSkuTier enumerates the values for v core sku tier. +type VCoreSkuTier string + +const ( + // VCoreSkuTierAutoScale ... + VCoreSkuTierAutoScale VCoreSkuTier = "AutoScale" +) + +// PossibleVCoreSkuTierValues returns an array of possible values for the VCoreSkuTier const type. +func PossibleVCoreSkuTierValues() []VCoreSkuTier { + return []VCoreSkuTier{VCoreSkuTierAutoScale} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/models.go similarity index 69% rename from vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/models.go index e9ce1db9700e..3b7a574b973c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/models.go @@ -11,13 +11,256 @@ import ( "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/powerbidedicated/mgmt/2017-10-01/powerbidedicated" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated" + +// AutoScaleVCore represents an instance of an auto scale v-core resource. +type AutoScaleVCore struct { + autorest.Response `json:"-"` + // Sku - The SKU of the auto scale v-core resource. + Sku *AutoScaleVCoreSku `json:"sku,omitempty"` + // AutoScaleVCoreProperties - Properties of an auto scale v-core resource. + *AutoScaleVCoreProperties `json:"properties,omitempty"` + // ID - READ-ONLY; An identifier that represents the PowerBI Dedicated resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the PowerBI Dedicated resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the PowerBI Dedicated resource. + Type *string `json:"type,omitempty"` + // Location - Location of the PowerBI Dedicated resource. + Location *string `json:"location,omitempty"` + // Tags - Key-value pairs of additional resource provisioning properties. + Tags map[string]*string `json:"tags"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutoScaleVCore. +func (asvc AutoScaleVCore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asvc.Sku != nil { + objectMap["sku"] = asvc.Sku + } + if asvc.AutoScaleVCoreProperties != nil { + objectMap["properties"] = asvc.AutoScaleVCoreProperties + } + if asvc.Location != nil { + objectMap["location"] = asvc.Location + } + if asvc.Tags != nil { + objectMap["tags"] = asvc.Tags + } + if asvc.SystemData != nil { + objectMap["systemData"] = asvc.SystemData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AutoScaleVCore struct. +func (asvc *AutoScaleVCore) 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 AutoScaleVCoreSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + asvc.Sku = &sku + } + case "properties": + if v != nil { + var autoScaleVCoreProperties AutoScaleVCoreProperties + err = json.Unmarshal(*v, &autoScaleVCoreProperties) + if err != nil { + return err + } + asvc.AutoScaleVCoreProperties = &autoScaleVCoreProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asvc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asvc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asvc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + asvc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + asvc.Tags = tags + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + asvc.SystemData = &systemData + } + } + } + + return nil +} + +// AutoScaleVCoreListResult an array of auto scale v-core resources. +type AutoScaleVCoreListResult struct { + autorest.Response `json:"-"` + // Value - An array of auto scale v-core resources. + Value *[]AutoScaleVCore `json:"value,omitempty"` +} + +// AutoScaleVCoreMutableProperties an object that represents a set of mutable auto scale v-core resource +// properties. +type AutoScaleVCoreMutableProperties struct { + // CapacityLimit - The maximum capacity of an auto scale v-core resource. + CapacityLimit *int32 `json:"capacityLimit,omitempty"` +} + +// AutoScaleVCoreProperties properties of an auto scale v-core resource. +type AutoScaleVCoreProperties struct { + // CapacityObjectID - The object ID of the capacity resource associated with the auto scale v-core resource. + CapacityObjectID *string `json:"capacityObjectId,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment state of an auto scale v-core resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'VCoreProvisioningStateSucceeded' + ProvisioningState VCoreProvisioningState `json:"provisioningState,omitempty"` + // CapacityLimit - The maximum capacity of an auto scale v-core resource. + CapacityLimit *int32 `json:"capacityLimit,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutoScaleVCoreProperties. +func (asvcp AutoScaleVCoreProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asvcp.CapacityObjectID != nil { + objectMap["capacityObjectId"] = asvcp.CapacityObjectID + } + if asvcp.CapacityLimit != nil { + objectMap["capacityLimit"] = asvcp.CapacityLimit + } + return json.Marshal(objectMap) +} + +// AutoScaleVCoreSku represents the SKU name and Azure pricing tier for auto scale v-core resource. +type AutoScaleVCoreSku struct { + // Name - Name of the SKU level. + Name *string `json:"name,omitempty"` + // Tier - The name of the Azure pricing tier to which the SKU applies. Possible values include: 'VCoreSkuTierAutoScale' + Tier VCoreSkuTier `json:"tier,omitempty"` + // Capacity - The capacity of an auto scale v-core resource. + Capacity *int32 `json:"capacity,omitempty"` +} + +// AutoScaleVCoreUpdateParameters update request specification +type AutoScaleVCoreUpdateParameters struct { + // Sku - The SKU of the auto scale v-core resource. + Sku *AutoScaleVCoreSku `json:"sku,omitempty"` + // Tags - Key-value pairs of additional provisioning properties. + Tags map[string]*string `json:"tags"` + // AutoScaleVCoreMutableProperties - Properties of the update operation request. + *AutoScaleVCoreMutableProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutoScaleVCoreUpdateParameters. +func (asvcup AutoScaleVCoreUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asvcup.Sku != nil { + objectMap["sku"] = asvcup.Sku + } + if asvcup.Tags != nil { + objectMap["tags"] = asvcup.Tags + } + if asvcup.AutoScaleVCoreMutableProperties != nil { + objectMap["properties"] = asvcup.AutoScaleVCoreMutableProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AutoScaleVCoreUpdateParameters struct. +func (asvcup *AutoScaleVCoreUpdateParameters) 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 AutoScaleVCoreSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + asvcup.Sku = &sku + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + asvcup.Tags = tags + } + case "properties": + if v != nil { + var autoScaleVCoreMutableProperties AutoScaleVCoreMutableProperties + err = json.Unmarshal(*v, &autoScaleVCoreMutableProperties) + if err != nil { + return err + } + asvcup.AutoScaleVCoreMutableProperties = &autoScaleVCoreMutableProperties + } + } + } + + return nil +} // CapacitiesCreateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. @@ -216,6 +459,14 @@ func (future *CapacitiesUpdateFuture) result(client CapacitiesClient) (dc Dedica return } +// CapacitySku represents the SKU name and Azure pricing tier for PowerBI Dedicated capacity resource. +type CapacitySku struct { + // Name - Name of the SKU level. + Name *string `json:"name,omitempty"` + // Tier - The name of the Azure pricing tier to which the SKU applies. Possible values include: 'CapacitySkuTierPBIEAzure', 'CapacitySkuTierPremium', 'CapacitySkuTierAutoPremiumHost' + Tier CapacitySkuTier `json:"tier,omitempty"` +} + // CheckCapacityNameAvailabilityParameters details of capacity name request body. type CheckCapacityNameAvailabilityParameters struct { // Name - Name for checking availability. @@ -245,6 +496,8 @@ type DedicatedCapacities struct { // DedicatedCapacity represents an instance of a Dedicated Capacity resource. type DedicatedCapacity struct { autorest.Response `json:"-"` + // Sku - The SKU of the PowerBI Dedicated capacity resource. + Sku *CapacitySku `json:"sku,omitempty"` // DedicatedCapacityProperties - Properties of the provision operation request. *DedicatedCapacityProperties `json:"properties,omitempty"` // ID - READ-ONLY; An identifier that represents the PowerBI Dedicated resource. @@ -255,27 +508,30 @@ type DedicatedCapacity struct { Type *string `json:"type,omitempty"` // Location - Location of the PowerBI Dedicated resource. Location *string `json:"location,omitempty"` - // Sku - The SKU of the PowerBI Dedicated resource. - Sku *ResourceSku `json:"sku,omitempty"` // Tags - Key-value pairs of additional resource provisioning properties. Tags map[string]*string `json:"tags"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for DedicatedCapacity. func (dc DedicatedCapacity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if dc.Sku != nil { + objectMap["sku"] = dc.Sku + } if dc.DedicatedCapacityProperties != nil { objectMap["properties"] = dc.DedicatedCapacityProperties } if dc.Location != nil { objectMap["location"] = dc.Location } - if dc.Sku != nil { - objectMap["sku"] = dc.Sku - } if dc.Tags != nil { objectMap["tags"] = dc.Tags } + if dc.SystemData != nil { + objectMap["systemData"] = dc.SystemData + } return json.Marshal(objectMap) } @@ -288,6 +544,15 @@ func (dc *DedicatedCapacity) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "sku": + if v != nil { + var sku CapacitySku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + dc.Sku = &sku + } case "properties": if v != nil { var dedicatedCapacityProperties DedicatedCapacityProperties @@ -333,23 +598,23 @@ func (dc *DedicatedCapacity) UnmarshalJSON(body []byte) error { } dc.Location = &location } - case "sku": + case "tags": if v != nil { - var sku ResourceSku - err = json.Unmarshal(*v, &sku) + var tags map[string]*string + err = json.Unmarshal(*v, &tags) if err != nil { return err } - dc.Sku = &sku + dc.Tags = tags } - case "tags": + case "systemData": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var systemData SystemData + err = json.Unmarshal(*v, &systemData) if err != nil { return err } - dc.Tags = tags + dc.SystemData = &systemData } } } @@ -368,16 +633,20 @@ type DedicatedCapacityAdministrators struct { type DedicatedCapacityMutableProperties struct { // Administration - A collection of Dedicated capacity administrators Administration *DedicatedCapacityAdministrators `json:"administration,omitempty"` + // Mode - The capacity mode. Possible values include: 'ModeGen1', 'ModeGen2' + Mode Mode `json:"mode,omitempty"` } // DedicatedCapacityProperties properties of Dedicated Capacity resource. type DedicatedCapacityProperties struct { // State - READ-ONLY; The current state of PowerBI Dedicated resource. The state is to indicate more states outside of resource provisioning. Possible values include: 'StateDeleting', 'StateSucceeded', 'StateFailed', 'StatePaused', 'StateSuspended', 'StateProvisioning', 'StateUpdating', 'StateSuspending', 'StatePausing', 'StateResuming', 'StatePreparing', 'StateScaling' State State `json:"state,omitempty"` - // ProvisioningState - READ-ONLY; The current deployment state of PowerBI Dedicated resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'Deleting', 'Succeeded', 'Failed', 'Paused', 'Suspended', 'Provisioning', 'Updating', 'Suspending', 'Pausing', 'Resuming', 'Preparing', 'Scaling' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment state of PowerBI Dedicated resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'CapacityProvisioningStateDeleting', 'CapacityProvisioningStateSucceeded', 'CapacityProvisioningStateFailed', 'CapacityProvisioningStatePaused', 'CapacityProvisioningStateSuspended', 'CapacityProvisioningStateProvisioning', 'CapacityProvisioningStateUpdating', 'CapacityProvisioningStateSuspending', 'CapacityProvisioningStatePausing', 'CapacityProvisioningStateResuming', 'CapacityProvisioningStatePreparing', 'CapacityProvisioningStateScaling' + ProvisioningState CapacityProvisioningState `json:"provisioningState,omitempty"` // Administration - A collection of Dedicated capacity administrators Administration *DedicatedCapacityAdministrators `json:"administration,omitempty"` + // Mode - The capacity mode. Possible values include: 'ModeGen1', 'ModeGen2' + Mode Mode `json:"mode,omitempty"` } // MarshalJSON is the custom marshaler for DedicatedCapacityProperties. @@ -386,13 +655,16 @@ func (dcp DedicatedCapacityProperties) MarshalJSON() ([]byte, error) { if dcp.Administration != nil { objectMap["administration"] = dcp.Administration } + if dcp.Mode != "" { + objectMap["mode"] = dcp.Mode + } return json.Marshal(objectMap) } // DedicatedCapacityUpdateParameters provision request specification type DedicatedCapacityUpdateParameters struct { // Sku - The SKU of the Dedicated capacity resource. - Sku *ResourceSku `json:"sku,omitempty"` + Sku *CapacitySku `json:"sku,omitempty"` // Tags - Key-value pairs of additional provisioning properties. Tags map[string]*string `json:"tags"` // DedicatedCapacityMutableProperties - Properties of the provision operation request. @@ -425,7 +697,7 @@ func (dcup *DedicatedCapacityUpdateParameters) UnmarshalJSON(body []byte) error switch k { case "sku": if v != nil { - var sku ResourceSku + var sku CapacitySku err = json.Unmarshal(*v, &sku) if err != nil { return err @@ -458,6 +730,12 @@ func (dcup *DedicatedCapacityUpdateParameters) UnmarshalJSON(body []byte) error // ErrorResponse describes the format of Error response. type ErrorResponse struct { + // Error - The error object + Error *ErrorResponseError `json:"error,omitempty"` +} + +// ErrorResponseError the error object +type ErrorResponseError struct { // Code - Error code Code *string `json:"code,omitempty"` // Message - Error message indicating why the operation failed. @@ -673,10 +951,10 @@ type Resource struct { Type *string `json:"type,omitempty"` // Location - Location of the PowerBI Dedicated resource. Location *string `json:"location,omitempty"` - // Sku - The SKU of the PowerBI Dedicated resource. - Sku *ResourceSku `json:"sku,omitempty"` // Tags - Key-value pairs of additional resource provisioning properties. Tags map[string]*string `json:"tags"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` } // MarshalJSON is the custom marshaler for Resource. @@ -685,27 +963,19 @@ func (r Resource) MarshalJSON() ([]byte, error) { if r.Location != nil { objectMap["location"] = r.Location } - if r.Sku != nil { - objectMap["sku"] = r.Sku - } if r.Tags != nil { objectMap["tags"] = r.Tags } + if r.SystemData != nil { + objectMap["systemData"] = r.SystemData + } return json.Marshal(objectMap) } -// ResourceSku represents the SKU name and Azure pricing tier for PowerBI Dedicated resource. -type ResourceSku struct { - // Name - Name of the SKU level. - Name *string `json:"name,omitempty"` - // Tier - The name of the Azure pricing tier to which the SKU applies. Possible values include: 'PBIEAzure' - Tier SkuTier `json:"tier,omitempty"` -} - // SkuDetailsForExistingResource an object that represents SKU details for existing resources type SkuDetailsForExistingResource struct { // Sku - The SKU in SKU details for existing resources. - Sku *ResourceSku `json:"sku,omitempty"` + Sku *CapacitySku `json:"sku,omitempty"` } // SkuEnumerationForExistingResourceResult an object that represents enumerating SKUs for existing @@ -720,5 +990,21 @@ type SkuEnumerationForExistingResourceResult struct { type SkuEnumerationForNewResourceResult struct { autorest.Response `json:"-"` // Value - The collection of available SKUs for new resources - Value *[]ResourceSku `json:"value,omitempty"` + Value *[]CapacitySku `json:"value,omitempty"` +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - An identifier for the identity that created the resource + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'IdentityTypeUser', 'IdentityTypeApplication', 'IdentityTypeManagedIdentity', 'IdentityTypeKey' + CreatedByType IdentityType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC) + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - An identifier for the identity that last modified the resource + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'IdentityTypeUser', 'IdentityTypeApplication', 'IdentityTypeManagedIdentity', 'IdentityTypeKey' + LastModifiedByType IdentityType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/operations.go index 483d32e44110..6603dc83c3fd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/operations.go @@ -72,7 +72,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2017-10-01" + const APIVersion = "2021-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/version.go similarity index 89% rename from vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/version.go index 7a6bbd54dcf0..4ce988fc947b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated/version.go @@ -10,7 +10,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " powerbidedicated/2017-10-01" + return "Azure-SDK-For-Go/" + Version() + " powerbidedicated/2021-01-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index 1589c6dccaea..08c45d208359 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -72,7 +72,7 @@ github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/noti github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2020-08-01/operationalinsights github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2020-01-01/postgresql github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2021-06-01/postgresqlflexibleservers -github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2017-10-01/powerbidedicated +github.com/Azure/azure-sdk-for-go/services/powerbidedicated/mgmt/2021-01-01/powerbidedicated github.com/Azure/azure-sdk-for-go/services/preview/alertsmanagement/mgmt/2019-06-01-preview/alertsmanagement github.com/Azure/azure-sdk-for-go/services/preview/appplatform/mgmt/2020-11-01-preview/appplatform github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2020-04-01-preview/authorization diff --git a/website/docs/r/powerbi_embedded.html.markdown b/website/docs/r/powerbi_embedded.html.markdown index 144b1a83960e..e5e9783c4484 100644 --- a/website/docs/r/powerbi_embedded.html.markdown +++ b/website/docs/r/powerbi_embedded.html.markdown @@ -41,6 +41,8 @@ The following arguments are supported: * `administrators` - (Required) A set of administrator user identities, which manages the Power BI Embedded and must be a member user or a service principal in your AAD tenant. +* `mode` - (Optional) Sets the PowerBI Embedded's mode. Possible values include: `Gen1`, `Gen2`. Defaults to `Gen1`. Changing this forces a new resource to be created. + * `tags` - (Optional) A mapping of tags to assign to the resource. ## Attributes Reference