From 986f03e1945a66693806a4473e639bae7bf4848c Mon Sep 17 00:00:00 2001 From: Yichun Ma Date: Fri, 25 Mar 2022 14:51:02 +0800 Subject: [PATCH 1/4] `dependencies` Update `digitaltwins` api version to 2020-12-01 --- .../services/digitaltwins/client/client.go | 2 +- ...gital_twins_endpoint_eventgrid_resource.go | 2 +- ...igital_twins_endpoint_eventhub_resource.go | 2 +- ...ital_twins_endpoint_servicebus_resource.go | 2 +- .../digital_twins_instance_resource.go | 2 +- .../digitaltwins/CHANGELOG.md | 0 .../digitaltwins/_meta.json | 6 +- .../digitaltwins/client.go | 2 +- .../digitaltwins/digitaltwins.go | 57 +-- .../digitaltwins/endpoint.go | 16 +- .../digitaltwins/enums.go | 87 +++- .../digitaltwins/models.go | 442 +++++++++++++++++- .../digitaltwins/operations.go | 2 +- .../privateendpointconnections.go | 396 ++++++++++++++++ .../digitaltwins/privatelinkresources.go | 207 ++++++++ .../digitaltwins/version.go | 2 +- vendor/modules.txt | 2 +- 17 files changed, 1169 insertions(+), 60 deletions(-) rename vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/{2020-10-31 => 2020-12-01}/digitaltwins/CHANGELOG.md (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/{2020-10-31 => 2020-12-01}/digitaltwins/_meta.json (80%) rename vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/{2020-10-31 => 2020-12-01}/digitaltwins/client.go (97%) rename vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/{2020-10-31 => 2020-12-01}/digitaltwins/digitaltwins.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/{2020-10-31 => 2020-12-01}/digitaltwins/endpoint.go (98%) rename vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/{2020-10-31 => 2020-12-01}/digitaltwins/enums.go (53%) rename vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/{2020-10-31 => 2020-12-01}/digitaltwins/models.go (69%) rename vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/{2020-10-31 => 2020-12-01}/digitaltwins/operations.go (99%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/privateendpointconnections.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/privatelinkresources.go rename vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/{2020-10-31 => 2020-12-01}/digitaltwins/version.go (89%) diff --git a/internal/services/digitaltwins/client/client.go b/internal/services/digitaltwins/client/client.go index 8262b6b62af1..86072925a754 100644 --- a/internal/services/digitaltwins/client/client.go +++ b/internal/services/digitaltwins/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go index b4348af556a7..a917d2ca314f 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/digitaltwins/parse" diff --git a/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go index 93bc5d5ed697..ab0c8d8ccadf 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/digitaltwins/parse" diff --git a/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go index d09776f052c6..d17a6d426905 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/digitaltwins/parse" diff --git a/internal/services/digitaltwins/digital_twins_instance_resource.go b/internal/services/digitaltwins/digital_twins_instance_resource.go index 7da9dd8cd278..450a565e3d59 100644 --- a/internal/services/digitaltwins/digital_twins_instance_resource.go +++ b/internal/services/digitaltwins/digital_twins_instance_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins" + "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/CHANGELOG.md similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/CHANGELOG.md rename to vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/CHANGELOG.md diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/_meta.json similarity index 80% rename from vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/_meta.json rename to vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/_meta.json index 3a116b1de2f4..45dba55c3365 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/_meta.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/_meta.json @@ -1,10 +1,10 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "d9506558e6389e62926ae385f1d625a1376a0f9d", "readme": "/_/azure-rest-api-specs/specification/digitaltwins/resource-manager/readme.md", - "tag": "package-2020-10", + "tag": "package-2020-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-2020-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/digitaltwins/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2020-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/digitaltwins/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/client.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/client.go index fccc49c74a94..a571ae349459 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/client.go @@ -1,4 +1,4 @@ -// Package digitaltwins implements the Azure ARM Digitaltwins service API version 2020-10-31. +// Package digitaltwins implements the Azure ARM Digitaltwins service API version 2020-12-01. // // Azure Digital Twins Client for managing DigitalTwinsInstance package digitaltwins diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/digitaltwins.go b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/digitaltwins.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/digitaltwins.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/digitaltwins.go index eee43c22b161..44bf98dbc19c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/digitaltwins.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/digitaltwins.go @@ -85,7 +85,7 @@ func (client Client) CheckNameAvailabilityPreparer(ctx context.Context, location "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -138,7 +138,7 @@ func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName strin } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, @@ -169,7 +169,7 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -229,7 +229,7 @@ func (client Client) Delete(ctx context.Context, resourceGroupName string, resou } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, @@ -260,7 +260,7 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -318,7 +318,7 @@ func (client Client) Get(ctx context.Context, resourceGroupName string, resource } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, @@ -356,7 +356,7 @@ func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client Client) ListPreparer(ctx context.Context) (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -516,7 +516,7 @@ func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("digitaltwins.Client", "ListByResourceGroup", err.Error()) } @@ -555,7 +555,7 @@ func (client Client) ListByResourceGroupPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -628,20 +628,20 @@ func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGr // resourceGroupName - the name of the resource group that contains the DigitalTwinsInstance. // resourceName - the name of the DigitalTwinsInstance. // digitalTwinsPatchDescription - the DigitalTwinsInstance and security metadata. -func (client Client) Update(ctx context.Context, resourceGroupName string, resourceName string, digitalTwinsPatchDescription PatchDescription) (result Description, err error) { +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceName string, digitalTwinsPatchDescription PatchDescription) (result UpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + 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: 64, Chain: nil}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, @@ -655,16 +655,9 @@ func (client Client) Update(ctx context.Context, resourceGroupName string, resou return } - resp, err := client.UpdateSender(req) + result, err = client.UpdateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "digitaltwins.Client", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.Client", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "digitaltwins.Client", "Update", result.Response(), "Failure sending request") return } @@ -679,7 +672,7 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -696,8 +689,18 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin // 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) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +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 @@ -705,7 +708,7 @@ func (client Client) UpdateSender(req *http.Request) (*http.Response, error) { func (client Client) UpdateResponder(resp *http.Response) (result Description, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/endpoint.go b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/endpoint.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/endpoint.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/endpoint.go index 83cab4e1e59f..849ef84614a3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/endpoint.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/endpoint.go @@ -50,7 +50,7 @@ func (client EndpointClient) CreateOrUpdate(ctx context.Context, resourceGroupNa } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, @@ -85,7 +85,7 @@ func (client EndpointClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -146,7 +146,7 @@ func (client EndpointClient) Delete(ctx context.Context, resourceGroupName strin } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, @@ -181,7 +181,7 @@ func (client EndpointClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client EndpointClient) Get(ctx context.Context, resourceGroupName string, } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, @@ -282,7 +282,7 @@ func (client EndpointClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -330,7 +330,7 @@ func (client EndpointClient) List(ctx context.Context, resourceGroupName string, } if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, @@ -373,7 +373,7 @@ func (client EndpointClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/enums.go similarity index 53% rename from vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/enums.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/enums.go index 471b72e5912c..03dca5ae1ea4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/enums.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/enums.go @@ -6,6 +6,40 @@ package digitaltwins // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// AuthenticationType enumerates the values for authentication type. +type AuthenticationType string + +const ( + // IdentityBased ... + IdentityBased AuthenticationType = "IdentityBased" + // KeyBased ... + KeyBased AuthenticationType = "KeyBased" +) + +// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type. +func PossibleAuthenticationTypeValues() []AuthenticationType { + return []AuthenticationType{IdentityBased, KeyBased} +} + +// ConnectionPropertiesProvisioningState enumerates the values for connection properties provisioning state. +type ConnectionPropertiesProvisioningState string + +const ( + // Approved ... + Approved ConnectionPropertiesProvisioningState = "Approved" + // Disconnected ... + Disconnected ConnectionPropertiesProvisioningState = "Disconnected" + // Pending ... + Pending ConnectionPropertiesProvisioningState = "Pending" + // Rejected ... + Rejected ConnectionPropertiesProvisioningState = "Rejected" +) + +// PossibleConnectionPropertiesProvisioningStateValues returns an array of possible values for the ConnectionPropertiesProvisioningState const type. +func PossibleConnectionPropertiesProvisioningStateValues() []ConnectionPropertiesProvisioningState { + return []ConnectionPropertiesProvisioningState{Approved, Disconnected, Pending, Rejected} +} + // EndpointProvisioningState enumerates the values for endpoint provisioning state. type EndpointProvisioningState string @@ -58,6 +92,40 @@ func PossibleEndpointTypeValues() []EndpointType { return []EndpointType{EndpointTypeDigitalTwinsEndpointResourceProperties, EndpointTypeEventGrid, EndpointTypeEventHub, EndpointTypeServiceBus} } +// IdentityType enumerates the values for identity type. +type IdentityType string + +const ( + // None ... + None IdentityType = "None" + // SystemAssigned ... + SystemAssigned IdentityType = "SystemAssigned" +) + +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() []IdentityType { + return []IdentityType{None, SystemAssigned} +} + +// PrivateLinkServiceConnectionStatus enumerates the values for private link service connection status. +type PrivateLinkServiceConnectionStatus string + +const ( + // PrivateLinkServiceConnectionStatusApproved ... + PrivateLinkServiceConnectionStatusApproved PrivateLinkServiceConnectionStatus = "Approved" + // PrivateLinkServiceConnectionStatusDisconnected ... + PrivateLinkServiceConnectionStatusDisconnected PrivateLinkServiceConnectionStatus = "Disconnected" + // PrivateLinkServiceConnectionStatusPending ... + PrivateLinkServiceConnectionStatusPending PrivateLinkServiceConnectionStatus = "Pending" + // PrivateLinkServiceConnectionStatusRejected ... + PrivateLinkServiceConnectionStatusRejected PrivateLinkServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateLinkServiceConnectionStatusValues returns an array of possible values for the PrivateLinkServiceConnectionStatus const type. +func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConnectionStatus { + return []PrivateLinkServiceConnectionStatus{PrivateLinkServiceConnectionStatusApproved, PrivateLinkServiceConnectionStatusDisconnected, PrivateLinkServiceConnectionStatusPending, PrivateLinkServiceConnectionStatusRejected} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -80,13 +148,30 @@ const ( ProvisioningStateSucceeded ProvisioningState = "Succeeded" // ProvisioningStateSuspending ... ProvisioningStateSuspending ProvisioningState = "Suspending" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" // ProvisioningStateWarning ... ProvisioningStateWarning ProvisioningState = "Warning" ) // PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateDeleted, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMoving, ProvisioningStateProvisioning, ProvisioningStateRestoring, ProvisioningStateSucceeded, ProvisioningStateSuspending, ProvisioningStateWarning} + return []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateDeleted, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMoving, ProvisioningStateProvisioning, ProvisioningStateRestoring, ProvisioningStateSucceeded, ProvisioningStateSuspending, ProvisioningStateUpdating, ProvisioningStateWarning} +} + +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // PublicNetworkAccessDisabled ... + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + // PublicNetworkAccessEnabled ... + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{PublicNetworkAccessDisabled, PublicNetworkAccessEnabled} } // Reason enumerates the values for reason. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/models.go similarity index 69% rename from vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/models.go index e2fd912badec..7a9d2d0a62f1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/models.go @@ -18,7 +18,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins" // CheckNameRequest the result returned from a database check name availability request. type CheckNameRequest struct { @@ -39,6 +39,63 @@ type CheckNameResult struct { Reason Reason `json:"reason,omitempty"` } +// ConnectionProperties the properties of a private endpoint connection. +type ConnectionProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + ProvisioningState ConnectionPropertiesProvisioningState `json:"provisioningState,omitempty"` + PrivateEndpoint *ConnectionPropertiesPrivateEndpoint `json:"privateEndpoint,omitempty"` + // GroupIds - The list of group ids for the private endpoint connection. + GroupIds *[]string `json:"groupIds,omitempty"` + PrivateLinkServiceConnectionState *ConnectionPropertiesPrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionProperties. +func (cp ConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.PrivateEndpoint != nil { + objectMap["privateEndpoint"] = cp.PrivateEndpoint + } + if cp.GroupIds != nil { + objectMap["groupIds"] = cp.GroupIds + } + if cp.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = cp.PrivateLinkServiceConnectionState + } + return json.Marshal(objectMap) +} + +// ConnectionPropertiesPrivateEndpoint ... +type ConnectionPropertiesPrivateEndpoint struct { + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionPropertiesPrivateEndpoint. +func (cpE ConnectionPropertiesPrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ConnectionPropertiesPrivateLinkServiceConnectionState ... +type ConnectionPropertiesPrivateLinkServiceConnectionState struct { + // Status - The status of a private endpoint connection. Possible values include: 'PrivateLinkServiceConnectionStatusPending', 'PrivateLinkServiceConnectionStatusApproved', 'PrivateLinkServiceConnectionStatusRejected', 'PrivateLinkServiceConnectionStatusDisconnected' + Status PrivateLinkServiceConnectionStatus `json:"status,omitempty"` + // Description - The description for the current state of a private endpoint connection. + Description *string `json:"description,omitempty"` + // ActionsRequired - Actions required for a private endpoint connection. + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// ConnectionState the current state of a private endpoint connection. +type ConnectionState struct { + // Status - The status of a private endpoint connection. Possible values include: 'PrivateLinkServiceConnectionStatusPending', 'PrivateLinkServiceConnectionStatusApproved', 'PrivateLinkServiceConnectionStatusRejected', 'PrivateLinkServiceConnectionStatusDisconnected' + Status PrivateLinkServiceConnectionStatus `json:"status,omitempty"` + // Description - The description for the current state of a private endpoint connection. + Description *string `json:"description,omitempty"` + // ActionsRequired - Actions required for a private endpoint connection. + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + // CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type CreateOrUpdateFuture struct { @@ -139,6 +196,8 @@ type Description struct { Location *string `json:"location,omitempty"` // Tags - The resource tags. Tags map[string]*string `json:"tags"` + // Identity - The managed identity for the DigitalTwinsInstance. + Identity *Identity `json:"identity,omitempty"` } // MarshalJSON is the custom marshaler for Description. @@ -153,6 +212,9 @@ func (d Description) MarshalJSON() ([]byte, error) { if d.Tags != nil { objectMap["tags"] = d.Tags } + if d.Identity != nil { + objectMap["identity"] = d.Identity + } return json.Marshal(objectMap) } @@ -219,6 +281,15 @@ func (d *Description) UnmarshalJSON(body []byte) error { } d.Tags = tags } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + d.Identity = &identity + } } } @@ -713,8 +784,12 @@ type EndpointResourceProperties struct { ProvisioningState EndpointProvisioningState `json:"provisioningState,omitempty"` // CreatedTime - READ-ONLY; Time when the Endpoint was added to DigitalTwinsInstance. CreatedTime *date.Time `json:"createdTime,omitempty"` - // DeadLetterSecret - Dead letter storage secret. Will be obfuscated during read. + // AuthenticationType - Specifies the authentication type being used for connecting to the endpoint. Possible values include: 'KeyBased', 'IdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // DeadLetterSecret - Dead letter storage secret for key-based authentication. Will be obfuscated during read. DeadLetterSecret *string `json:"deadLetterSecret,omitempty"` + // DeadLetterURI - Dead letter storage URL for identity-based authentication. + DeadLetterURI *string `json:"deadLetterUri,omitempty"` // EndpointType - Possible values include: 'EndpointTypeDigitalTwinsEndpointResourceProperties', 'EndpointTypeServiceBus', 'EndpointTypeEventHub', 'EndpointTypeEventGrid' EndpointType EndpointType `json:"endpointType,omitempty"` } @@ -768,9 +843,15 @@ func unmarshalBasicEndpointResourcePropertiesArray(body []byte) ([]BasicEndpoint func (erp EndpointResourceProperties) MarshalJSON() ([]byte, error) { erp.EndpointType = EndpointTypeDigitalTwinsEndpointResourceProperties objectMap := make(map[string]interface{}) + if erp.AuthenticationType != "" { + objectMap["authenticationType"] = erp.AuthenticationType + } if erp.DeadLetterSecret != nil { objectMap["deadLetterSecret"] = erp.DeadLetterSecret } + if erp.DeadLetterURI != nil { + objectMap["deadLetterUri"] = erp.DeadLetterURI + } if erp.EndpointType != "" { objectMap["endpointType"] = erp.EndpointType } @@ -836,8 +917,12 @@ type EventGrid struct { ProvisioningState EndpointProvisioningState `json:"provisioningState,omitempty"` // CreatedTime - READ-ONLY; Time when the Endpoint was added to DigitalTwinsInstance. CreatedTime *date.Time `json:"createdTime,omitempty"` - // DeadLetterSecret - Dead letter storage secret. Will be obfuscated during read. + // AuthenticationType - Specifies the authentication type being used for connecting to the endpoint. Possible values include: 'KeyBased', 'IdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // DeadLetterSecret - Dead letter storage secret for key-based authentication. Will be obfuscated during read. DeadLetterSecret *string `json:"deadLetterSecret,omitempty"` + // DeadLetterURI - Dead letter storage URL for identity-based authentication. + DeadLetterURI *string `json:"deadLetterUri,omitempty"` // EndpointType - Possible values include: 'EndpointTypeDigitalTwinsEndpointResourceProperties', 'EndpointTypeServiceBus', 'EndpointTypeEventHub', 'EndpointTypeEventGrid' EndpointType EndpointType `json:"endpointType,omitempty"` } @@ -855,9 +940,15 @@ func (eg EventGrid) MarshalJSON() ([]byte, error) { if eg.AccessKey2 != nil { objectMap["accessKey2"] = eg.AccessKey2 } + if eg.AuthenticationType != "" { + objectMap["authenticationType"] = eg.AuthenticationType + } if eg.DeadLetterSecret != nil { objectMap["deadLetterSecret"] = eg.DeadLetterSecret } + if eg.DeadLetterURI != nil { + objectMap["deadLetterUri"] = eg.DeadLetterURI + } if eg.EndpointType != "" { objectMap["endpointType"] = eg.EndpointType } @@ -891,16 +982,24 @@ func (eg EventGrid) AsBasicEndpointResourceProperties() (BasicEndpointResourcePr // EventHub properties related to EventHub. type EventHub struct { - // ConnectionStringPrimaryKey - PrimaryConnectionString of the endpoint. Will be obfuscated during read. + // ConnectionStringPrimaryKey - PrimaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. ConnectionStringPrimaryKey *string `json:"connectionStringPrimaryKey,omitempty"` - // ConnectionStringSecondaryKey - SecondaryConnectionString of the endpoint. Will be obfuscated during read. + // ConnectionStringSecondaryKey - SecondaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. ConnectionStringSecondaryKey *string `json:"connectionStringSecondaryKey,omitempty"` + // EndpointURI - The URL of the EventHub namespace for identity-based authentication. It must include the protocol sb:// + EndpointURI *string `json:"endpointUri,omitempty"` + // EntityPath - The EventHub name in the EventHub namespace for identity-based authentication. + EntityPath *string `json:"entityPath,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state. Possible values include: 'Provisioning', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'Warning', 'Suspending', 'Restoring', 'Moving', 'Disabled' ProvisioningState EndpointProvisioningState `json:"provisioningState,omitempty"` // CreatedTime - READ-ONLY; Time when the Endpoint was added to DigitalTwinsInstance. CreatedTime *date.Time `json:"createdTime,omitempty"` - // DeadLetterSecret - Dead letter storage secret. Will be obfuscated during read. + // AuthenticationType - Specifies the authentication type being used for connecting to the endpoint. Possible values include: 'KeyBased', 'IdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // DeadLetterSecret - Dead letter storage secret for key-based authentication. Will be obfuscated during read. DeadLetterSecret *string `json:"deadLetterSecret,omitempty"` + // DeadLetterURI - Dead letter storage URL for identity-based authentication. + DeadLetterURI *string `json:"deadLetterUri,omitempty"` // EndpointType - Possible values include: 'EndpointTypeDigitalTwinsEndpointResourceProperties', 'EndpointTypeServiceBus', 'EndpointTypeEventHub', 'EndpointTypeEventGrid' EndpointType EndpointType `json:"endpointType,omitempty"` } @@ -915,9 +1014,21 @@ func (eh EventHub) MarshalJSON() ([]byte, error) { if eh.ConnectionStringSecondaryKey != nil { objectMap["connectionStringSecondaryKey"] = eh.ConnectionStringSecondaryKey } + if eh.EndpointURI != nil { + objectMap["endpointUri"] = eh.EndpointURI + } + if eh.EntityPath != nil { + objectMap["entityPath"] = eh.EntityPath + } + if eh.AuthenticationType != "" { + objectMap["authenticationType"] = eh.AuthenticationType + } if eh.DeadLetterSecret != nil { objectMap["deadLetterSecret"] = eh.DeadLetterSecret } + if eh.DeadLetterURI != nil { + objectMap["deadLetterUri"] = eh.DeadLetterURI + } if eh.EndpointType != "" { objectMap["endpointType"] = eh.EndpointType } @@ -965,6 +1076,76 @@ func (er ExternalResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// GroupIDInformation the group information for creating a private endpoint on Digital Twin. +type GroupIDInformation struct { + autorest.Response `json:"-"` + Properties *GroupIDInformationPropertiesModel `json:"properties,omitempty"` + // ID - The resource identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupIDInformation. +func (gii GroupIDInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gii.Properties != nil { + objectMap["properties"] = gii.Properties + } + if gii.ID != nil { + objectMap["id"] = gii.ID + } + return json.Marshal(objectMap) +} + +// GroupIDInformationProperties the properties for a group information object. +type GroupIDInformationProperties struct { + // GroupID - The group id + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - The required members for a specific group id. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - The required DNS zones for a specific group id. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// GroupIDInformationPropertiesModel ... +type GroupIDInformationPropertiesModel struct { + // GroupID - The group id + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - The required members for a specific group id. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - The required DNS zones for a specific group id. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// GroupIDInformationResponse the available private link resources for a Digital Twin. +type GroupIDInformationResponse struct { + autorest.Response `json:"-"` + // Value - The list of available private link resources for a Digital Twin. + Value *[]GroupIDInformation `json:"value,omitempty"` +} + +// Identity the managed identity for the DigitalTwinsInstance. +type Identity struct { + // Type - The type of Managed Identity used by the DigitalTwinsInstance. Only SystemAssigned is supported. Possible values include: 'None', 'SystemAssigned' + Type IdentityType `json:"type,omitempty"` + // PrincipalID - 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 `json:"principalId,omitempty"` + // TenantID - 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 `json:"tenantId,omitempty"` +} + +// 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 + } + return json.Marshal(objectMap) +} + // Operation digitalTwins service REST API operation type Operation struct { // Name - READ-ONLY; Operation name: {provider}/{resource}/{read | write | action | delete} @@ -1175,8 +1356,12 @@ func NewOperationListResultPage(cur OperationListResult, getNextPage func(contex // PatchDescription the description of the DigitalTwins service. type PatchDescription struct { - // Tags - Instance tags + // Tags - Instance patch properties Tags map[string]*string `json:"tags"` + // Identity - The managed identity for the DigitalTwinsInstance. + Identity *Identity `json:"identity,omitempty"` + // Properties - Properties for the DigitalTwinsInstance. + Properties *PatchProperties `json:"properties,omitempty"` } // MarshalJSON is the custom marshaler for PatchDescription. @@ -1185,24 +1370,190 @@ func (pd PatchDescription) MarshalJSON() ([]byte, error) { if pd.Tags != nil { objectMap["tags"] = pd.Tags } + if pd.Identity != nil { + objectMap["identity"] = pd.Identity + } + if pd.Properties != nil { + objectMap["properties"] = pd.Properties + } + return json.Marshal(objectMap) +} + +// PatchProperties the properties of a DigitalTwinsInstance. +type PatchProperties struct { + // PublicNetworkAccess - Public network access for the DigitalTwinsInstance. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` +} + +// PrivateEndpoint the private endpoint property of a private endpoint connection. +type PrivateEndpoint struct { + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpoint. +func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateEndpointConnection the private endpoint connection of a Digital Twin. +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.Properties != nil { + objectMap["properties"] = pec.Properties + } + return json.Marshal(objectMap) +} + +// PrivateEndpointConnectionProperties ... +type PrivateEndpointConnectionProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + ProvisioningState ConnectionPropertiesProvisioningState `json:"provisioningState,omitempty"` + PrivateEndpoint *ConnectionPropertiesPrivateEndpoint `json:"privateEndpoint,omitempty"` + // GroupIds - The list of group ids for the private endpoint connection. + GroupIds *[]string `json:"groupIds,omitempty"` + PrivateLinkServiceConnectionState *ConnectionPropertiesPrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. +func (pec PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpoint != nil { + objectMap["privateEndpoint"] = pec.PrivateEndpoint + } + if pec.GroupIds != nil { + objectMap["groupIds"] = pec.GroupIds + } + if pec.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = pec.PrivateLinkServiceConnectionState + } return json.Marshal(objectMap) } +// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type PrivateEndpointConnectionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) 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 PrivateEndpointConnectionsCreateOrUpdateFuture.Result. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pec.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("digitaltwins.PrivateEndpointConnectionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { + pec, err = client.CreateOrUpdateResponder(pec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsDeleteFuture) 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 PrivateEndpointConnectionsDeleteFuture.Result. +func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("digitaltwins.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateEndpointConnectionsResponse the available private link connections for a Digital Twin. +type PrivateEndpointConnectionsResponse struct { + autorest.Response `json:"-"` + // Value - The list of available private link connections for a Digital Twin. + Value *[]PrivateEndpointConnection `json:"value,omitempty"` +} + // Properties the properties of a DigitalTwinsInstance. type Properties struct { // CreatedTime - READ-ONLY; Time when DigitalTwinsInstance was created. CreatedTime *date.Time `json:"createdTime,omitempty"` // LastUpdatedTime - READ-ONLY; Time when DigitalTwinsInstance was updated. LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state. Possible values include: 'ProvisioningStateProvisioning', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeleted', 'ProvisioningStateWarning', 'ProvisioningStateSuspending', 'ProvisioningStateRestoring', 'ProvisioningStateMoving' + // ProvisioningState - READ-ONLY; The provisioning state. Possible values include: 'ProvisioningStateProvisioning', 'ProvisioningStateDeleting', 'ProvisioningStateUpdating', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeleted', 'ProvisioningStateWarning', 'ProvisioningStateSuspending', 'ProvisioningStateRestoring', 'ProvisioningStateMoving' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // HostName - READ-ONLY; Api endpoint to work with DigitalTwinsInstance. - HostName *string `json:"hostName,omitempty"` + HostName *string `json:"hostName,omitempty"` + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // PublicNetworkAccess - Public network access for the DigitalTwinsInstance. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` } // MarshalJSON is the custom marshaler for Properties. func (p Properties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if p.PrivateEndpointConnections != nil { + objectMap["privateEndpointConnections"] = p.PrivateEndpointConnections + } + if p.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = p.PublicNetworkAccess + } return json.Marshal(objectMap) } @@ -1218,6 +1569,8 @@ type Resource struct { Location *string `json:"location,omitempty"` // Tags - The resource tags. Tags map[string]*string `json:"tags"` + // Identity - The managed identity for the DigitalTwinsInstance. + Identity *Identity `json:"identity,omitempty"` } // MarshalJSON is the custom marshaler for Resource. @@ -1229,21 +1582,32 @@ func (r Resource) MarshalJSON() ([]byte, error) { if r.Tags != nil { objectMap["tags"] = r.Tags } + if r.Identity != nil { + objectMap["identity"] = r.Identity + } return json.Marshal(objectMap) } // ServiceBus properties related to ServiceBus. type ServiceBus struct { - // PrimaryConnectionString - PrimaryConnectionString of the endpoint. Will be obfuscated during read. + // PrimaryConnectionString - PrimaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. PrimaryConnectionString *string `json:"primaryConnectionString,omitempty"` - // SecondaryConnectionString - SecondaryConnectionString of the endpoint. Will be obfuscated during read. + // SecondaryConnectionString - SecondaryConnectionString of the endpoint for key-based authentication. Will be obfuscated during read. SecondaryConnectionString *string `json:"secondaryConnectionString,omitempty"` + // EndpointURI - The URL of the ServiceBus namespace for identity-based authentication. It must include the protocol sb:// + EndpointURI *string `json:"endpointUri,omitempty"` + // EntityPath - The ServiceBus Topic name for identity-based authentication + EntityPath *string `json:"entityPath,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state. Possible values include: 'Provisioning', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'Warning', 'Suspending', 'Restoring', 'Moving', 'Disabled' ProvisioningState EndpointProvisioningState `json:"provisioningState,omitempty"` // CreatedTime - READ-ONLY; Time when the Endpoint was added to DigitalTwinsInstance. CreatedTime *date.Time `json:"createdTime,omitempty"` - // DeadLetterSecret - Dead letter storage secret. Will be obfuscated during read. + // AuthenticationType - Specifies the authentication type being used for connecting to the endpoint. Possible values include: 'KeyBased', 'IdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // DeadLetterSecret - Dead letter storage secret for key-based authentication. Will be obfuscated during read. DeadLetterSecret *string `json:"deadLetterSecret,omitempty"` + // DeadLetterURI - Dead letter storage URL for identity-based authentication. + DeadLetterURI *string `json:"deadLetterUri,omitempty"` // EndpointType - Possible values include: 'EndpointTypeDigitalTwinsEndpointResourceProperties', 'EndpointTypeServiceBus', 'EndpointTypeEventHub', 'EndpointTypeEventGrid' EndpointType EndpointType `json:"endpointType,omitempty"` } @@ -1258,9 +1622,21 @@ func (sb ServiceBus) MarshalJSON() ([]byte, error) { if sb.SecondaryConnectionString != nil { objectMap["secondaryConnectionString"] = sb.SecondaryConnectionString } + if sb.EndpointURI != nil { + objectMap["endpointUri"] = sb.EndpointURI + } + if sb.EntityPath != nil { + objectMap["entityPath"] = sb.EntityPath + } + if sb.AuthenticationType != "" { + objectMap["authenticationType"] = sb.AuthenticationType + } if sb.DeadLetterSecret != nil { objectMap["deadLetterSecret"] = sb.DeadLetterSecret } + if sb.DeadLetterURI != nil { + objectMap["deadLetterUri"] = sb.DeadLetterURI + } if sb.EndpointType != "" { objectMap["endpointType"] = sb.EndpointType } @@ -1291,3 +1667,45 @@ func (sb ServiceBus) AsEndpointResourceProperties() (*EndpointResourceProperties func (sb ServiceBus) AsBasicEndpointResourceProperties() (BasicEndpointResourceProperties, bool) { return &sb, true } + +// 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) (Description, 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) (d Description, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.UpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + d.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("digitaltwins.UpdateFuture") + 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, "digitaltwins.UpdateFuture", "Result", d.Response.Response, "Failure responding to request") + } + } + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/operations.go index ad0e998a3743..00bd6a7127a5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/operations.go @@ -71,7 +71,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 = "2020-10-31" + const APIVersion = "2020-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/privateendpointconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/privateendpointconnections.go new file mode 100644 index 000000000000..b774dc675d9d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/privateendpointconnections.go @@ -0,0 +1,396 @@ +package digitaltwins + +// 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" +) + +// PrivateEndpointConnectionsClient is the azure Digital Twins Client for managing DigitalTwinsInstance +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient 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 NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate update the status of a private endpoint connection with the given name. +// Parameters: +// resourceGroupName - the name of the resource group that contains the DigitalTwinsInstance. +// resourceName - the name of the DigitalTwinsInstance. +// privateEndpointConnectionName - the name of the private endpoint connection. +// privateEndpointConnection - the private endpoint connection with updated properties. +func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (result PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: privateEndpointConnection, + Constraints: []validation.Constraint{{Target: "privateEndpointConnection.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("digitaltwins.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + privateEndpointConnection.ID = nil + privateEndpointConnection.Name = nil + privateEndpointConnection.Type = 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.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(privateEndpointConnection), + 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 PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Request) (future PrivateEndpointConnectionsCreateOrUpdateFuture, 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 PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, 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 delete private endpoint connection with the specified name. +// Parameters: +// resourceGroupName - the name of the resource group that contains the DigitalTwinsInstance. +// resourceName - the name of the DigitalTwinsInstance. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("digitaltwins.PrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-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.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, 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 PrivateEndpointConnectionsClient) 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 +} + +// Get get private endpoint connection properties for the given private endpoint. +// Parameters: +// resourceGroupName - the name of the resource group that contains the DigitalTwinsInstance. +// resourceName - the name of the DigitalTwinsInstance. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("digitaltwins.PrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-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.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) 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 PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list private endpoint connection properties. +// Parameters: +// resourceGroupName - the name of the resource group that contains the DigitalTwinsInstance. +// resourceName - the name of the DigitalTwinsInstance. +func (client PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateEndpointConnectionsResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("digitaltwins.PrivateEndpointConnectionsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateEndpointConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-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.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections", 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 PrivateEndpointConnectionsClient) 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 PrivateEndpointConnectionsClient) ListResponder(resp *http.Response) (result PrivateEndpointConnectionsResponse, 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/digitaltwins/mgmt/2020-12-01/digitaltwins/privatelinkresources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/privatelinkresources.go new file mode 100644 index 000000000000..3f1da7cf8b89 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/privatelinkresources.go @@ -0,0 +1,207 @@ +package digitaltwins + +// 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" +) + +// PrivateLinkResourcesClient is the azure Digital Twins Client for managing DigitalTwinsInstance +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient 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 NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the specified private link resource for the given Digital Twin. +// Parameters: +// resourceGroupName - the name of the resource group that contains the DigitalTwinsInstance. +// resourceName - the name of the DigitalTwinsInstance. +// resourceID - the name of the private link resource. +func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, resourceID string) (result GroupIDInformation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.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}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("digitaltwins.PrivateLinkResourcesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, resourceID) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateLinkResourcesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateLinkResourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, resourceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceId": autorest.Encode("path", resourceID), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-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.DigitalTwins/digitalTwinsInstances/{resourceName}/privateLinkResources/{resourceId}", 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 PrivateLinkResourcesClient) 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 PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result GroupIDInformation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list private link resources for given Digital Twin. +// Parameters: +// resourceGroupName - the name of the resource group that contains the DigitalTwinsInstance. +// resourceName - the name of the DigitalTwinsInstance. +func (client PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result GroupIDInformationResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("digitaltwins.PrivateLinkResourcesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateLinkResourcesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateLinkResourcesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "digitaltwins.PrivateLinkResourcesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateLinkResourcesClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-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.DigitalTwins/digitalTwinsInstances/{resourceName}/privateLinkResources", 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 PrivateLinkResourcesClient) 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 PrivateLinkResourcesClient) ListResponder(resp *http.Response) (result GroupIDInformationResponse, 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/digitaltwins/mgmt/2020-10-31/digitaltwins/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/version.go similarity index 89% rename from vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/version.go index 3dee0e483d14..2b537be54a5a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins/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() + " digitaltwins/2020-10-31" + return "Azure-SDK-For-Go/" + Version() + " digitaltwins/2020-12-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index 42c200383ee7..fe595217cda4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -25,7 +25,7 @@ github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafacto github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl -github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins +github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-12-01/digitaltwins github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns github.com/Azure/azure-sdk-for-go/services/domainservices/mgmt/2020-01-01/aad github.com/Azure/azure-sdk-for-go/services/eventgrid/mgmt/2021-12-01/eventgrid From 0beed58b639c763910b04663c05b7fe0a61fcc39 Mon Sep 17 00:00:00 2001 From: Yichun Ma Date: Mon, 28 Mar 2022 21:32:40 +0800 Subject: [PATCH 2/4] Add new required property authenticationType with keyBased --- .../digital_twins_endpoint_eventgrid_resource.go | 11 ++++++----- .../digital_twins_endpoint_eventhub_resource.go | 1 + .../digital_twins_endpoint_servicebus_resource.go | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go index a917d2ca314f..122b582166b1 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_eventgrid_resource.go @@ -105,11 +105,12 @@ func resourceDigitalTwinsEndpointEventGridCreateUpdate(d *pluginsdk.ResourceData properties := digitaltwins.EndpointResource{ Properties: &digitaltwins.EventGrid{ - EndpointType: digitaltwins.EndpointTypeEventGrid, - TopicEndpoint: utils.String(d.Get("eventgrid_topic_endpoint").(string)), - AccessKey1: utils.String(d.Get("eventgrid_topic_primary_access_key").(string)), - AccessKey2: utils.String(d.Get("eventgrid_topic_secondary_access_key").(string)), - DeadLetterSecret: utils.String(d.Get("dead_letter_storage_secret").(string)), + EndpointType: digitaltwins.EndpointTypeEventGrid, + AuthenticationType: digitaltwins.KeyBased, + TopicEndpoint: utils.String(d.Get("eventgrid_topic_endpoint").(string)), + AccessKey1: utils.String(d.Get("eventgrid_topic_primary_access_key").(string)), + AccessKey2: utils.String(d.Get("eventgrid_topic_secondary_access_key").(string)), + DeadLetterSecret: utils.String(d.Get("dead_letter_storage_secret").(string)), }, } diff --git a/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go index ab0c8d8ccadf..1ab6bbe39388 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_eventhub_resource.go @@ -103,6 +103,7 @@ func resourceDigitalTwinsEndpointEventHubCreateUpdate(d *pluginsdk.ResourceData, properties := digitaltwins.EndpointResource{ Properties: &digitaltwins.EventHub{ EndpointType: digitaltwins.EndpointTypeEventHub, + AuthenticationType: digitaltwins.KeyBased, ConnectionStringPrimaryKey: utils.String(d.Get("eventhub_primary_connection_string").(string)), ConnectionStringSecondaryKey: utils.String(d.Get("eventhub_secondary_connection_string").(string)), DeadLetterSecret: utils.String(d.Get("dead_letter_storage_secret").(string)), diff --git a/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go b/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go index d17a6d426905..65b73dc57672 100644 --- a/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go +++ b/internal/services/digitaltwins/digital_twins_endpoint_servicebus_resource.go @@ -103,6 +103,7 @@ func resourceDigitalTwinsEndpointServiceBusCreateUpdate(d *pluginsdk.ResourceDat properties := digitaltwins.EndpointResource{ Properties: &digitaltwins.ServiceBus{ EndpointType: digitaltwins.EndpointTypeServiceBus, + AuthenticationType: digitaltwins.KeyBased, PrimaryConnectionString: utils.String(d.Get("servicebus_primary_connection_string").(string)), SecondaryConnectionString: utils.String(d.Get("servicebus_secondary_connection_string").(string)), DeadLetterSecret: utils.String(d.Get("dead_letter_storage_secret").(string)), From 01a3b8ae70788dfef93f1ed12e3ddbdaf6c3f6d2 Mon Sep 17 00:00:00 2001 From: Yichun Ma Date: Mon, 28 Mar 2022 22:01:35 +0800 Subject: [PATCH 3/4] Change update to set future due to new api update --- .../digitaltwins/digital_twins_instance_resource.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/services/digitaltwins/digital_twins_instance_resource.go b/internal/services/digitaltwins/digital_twins_instance_resource.go index 450a565e3d59..44df800aad6e 100644 --- a/internal/services/digitaltwins/digital_twins_instance_resource.go +++ b/internal/services/digitaltwins/digital_twins_instance_resource.go @@ -149,10 +149,15 @@ func resourceDigitalTwinsInstanceUpdate(d *pluginsdk.ResourceData, meta interfac props.Tags = tags.Expand(d.Get("tags").(map[string]interface{})) } - if _, err := client.Update(ctx, id.ResourceGroup, id.Name, props); err != nil { + future, err := client.Update(ctx, id.ResourceGroup, id.Name, props) + if err != nil { return fmt.Errorf("updating Digital Twins Instance %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) } + if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for update of the Digital Twins Instance %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + } + return resourceDigitalTwinsInstanceRead(d, meta) } From 71dec6f26480627f6df7acb2e2bb0269e32892a4 Mon Sep 17 00:00:00 2001 From: Yichun Ma Date: Wed, 30 Mar 2022 17:40:02 +0800 Subject: [PATCH 4/4] Update error message Co-authored-by: catriona-m <86247157+catriona-m@users.noreply.github.com> --- .../services/digitaltwins/digital_twins_instance_resource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/digitaltwins/digital_twins_instance_resource.go b/internal/services/digitaltwins/digital_twins_instance_resource.go index 44df800aad6e..493a46c719ec 100644 --- a/internal/services/digitaltwins/digital_twins_instance_resource.go +++ b/internal/services/digitaltwins/digital_twins_instance_resource.go @@ -151,11 +151,11 @@ func resourceDigitalTwinsInstanceUpdate(d *pluginsdk.ResourceData, meta interfac future, err := client.Update(ctx, id.ResourceGroup, id.Name, props) if err != nil { - return fmt.Errorf("updating Digital Twins Instance %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + return fmt.Errorf("updating %s: %+v", *id, err) } if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for update of the Digital Twins Instance %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + return fmt.Errorf("waiting for update of %s: %+v", *id, err) } return resourceDigitalTwinsInstanceRead(d, meta)