From 3a895a9a80c6bccdb32bed6ff00714093be4c302 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 3 Sep 2021 05:33:09 +0000 Subject: [PATCH] CodeGen from PR 15849 in Azure/azure-rest-api-specs [Hub Generated] Public private branch 'dev-azure-kusto-Microsoft.Kusto-2021-08-27' (#15849) * Adds base for updating Microsoft.Kusto from version stable/2021-01-01 to version 2021-08-27 * Updates readme * Updates API version in new specs and examples * Swagger changes * it1 * hh * it2 * it3 * it5 * it6 * it7 * readme * it10 * it11 * it11 * it 12 * it 13 * prettier * python * allowedIpRangeList - remove default * bassel changes * checkNameAvailability * fix lint * checkName * fix * managedPrivate check name * prettier * Update readme.python.md * add attached enum * Dor comments * fix description * readOnly Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- .../kusto/mgmt/2019-01-21/kusto/CHANGELOG.md | 9 +- .../kusto/mgmt/2019-01-21/kusto/_meta.json | 6 +- .../kusto/mgmt/2019-01-21/kusto/clusters.go | 15 +- .../kusto/mgmt/2019-01-21/kusto/databases.go | 9 +- .../mgmt/2019-01-21/kusto/dataconnections.go | 13 +- .../kusto/mgmt/2019-05-15/kusto/CHANGELOG.md | 11 +- .../kusto/mgmt/2019-05-15/kusto/_meta.json | 6 +- .../kusto/mgmt/2019-05-15/kusto/clusters.go | 15 +- .../kusto/mgmt/2019-05-15/kusto/databases.go | 9 +- .../mgmt/2019-05-15/kusto/dataconnections.go | 13 +- .../kusto/mgmt/2019-09-07/kusto/CHANGELOG.md | 12 +- .../kusto/mgmt/2019-09-07/kusto/_meta.json | 6 +- .../kusto/attacheddatabaseconfigurations.go | 6 +- .../kusto/mgmt/2019-09-07/kusto/clusters.go | 18 +- .../kusto/mgmt/2019-09-07/kusto/databases.go | 13 +- .../mgmt/2019-09-07/kusto/dataconnections.go | 13 +- .../kusto/mgmt/2019-11-09/kusto/CHANGELOG.md | 12 +- .../kusto/mgmt/2019-11-09/kusto/_meta.json | 6 +- .../kusto/attacheddatabaseconfigurations.go | 6 +- .../kusto/clusterprincipalassignments.go | 6 +- .../kusto/mgmt/2019-11-09/kusto/clusters.go | 21 +- .../kusto/databaseprincipalassignments.go | 6 +- .../kusto/mgmt/2019-11-09/kusto/databases.go | 13 +- .../mgmt/2019-11-09/kusto/dataconnections.go | 13 +- .../kusto/mgmt/2020-02-15/kusto/CHANGELOG.md | 12 +- .../kusto/mgmt/2020-02-15/kusto/_meta.json | 6 +- .../kusto/attacheddatabaseconfigurations.go | 6 +- .../kusto/clusterprincipalassignments.go | 6 +- .../kusto/mgmt/2020-02-15/kusto/clusters.go | 27 +- .../kusto/databaseprincipalassignments.go | 6 +- .../kusto/mgmt/2020-02-15/kusto/databases.go | 13 +- .../mgmt/2020-02-15/kusto/dataconnections.go | 13 +- .../kusto/mgmt/2020-06-14/kusto/CHANGELOG.md | 12 +- .../kusto/mgmt/2020-06-14/kusto/_meta.json | 6 +- .../kusto/attacheddatabaseconfigurations.go | 6 +- .../kusto/clusterprincipalassignments.go | 6 +- .../kusto/mgmt/2020-06-14/kusto/clusters.go | 27 +- .../kusto/databaseprincipalassignments.go | 6 +- .../kusto/mgmt/2020-06-14/kusto/databases.go | 13 +- .../mgmt/2020-06-14/kusto/dataconnections.go | 16 +- .../kusto/mgmt/2020-09-18/kusto/CHANGELOG.md | 12 +- .../kusto/mgmt/2020-09-18/kusto/_meta.json | 6 +- .../kusto/attacheddatabaseconfigurations.go | 6 +- .../kusto/clusterprincipalassignments.go | 6 +- .../kusto/mgmt/2020-09-18/kusto/clusters.go | 27 +- .../kusto/databaseprincipalassignments.go | 6 +- .../kusto/mgmt/2020-09-18/kusto/databases.go | 13 +- .../mgmt/2020-09-18/kusto/dataconnections.go | 16 +- .../kusto/mgmt/2021-01-01/kusto/CHANGELOG.md | 26 +- .../kusto/mgmt/2021-01-01/kusto/_meta.json | 6 +- .../kusto/attacheddatabaseconfigurations.go | 6 +- .../kusto/clusterprincipalassignments.go | 6 +- .../kusto/mgmt/2021-01-01/kusto/clusters.go | 27 +- .../kusto/databaseprincipalassignments.go | 6 +- .../kusto/mgmt/2021-01-01/kusto/databases.go | 13 +- .../mgmt/2021-01-01/kusto/dataconnections.go | 16 +- .../kusto/mgmt/2021-01-01/kusto/scripts.go | 9 +- .../kusto/mgmt/2021-08-27/kusto/CHANGELOG.md | 2 + .../kusto/mgmt/2021-08-27/kusto/_meta.json | 11 + .../kusto/attacheddatabaseconfigurations.go | 449 ++ .../kusto/mgmt/2021-08-27/kusto/client.go | 42 + .../kusto/clusterprincipalassignments.go | 446 ++ .../kusto/mgmt/2021-08-27/kusto/clusters.go | 1525 ++++++ .../kusto/databaseprincipalassignments.go | 456 ++ .../kusto/mgmt/2021-08-27/kusto/databases.go | 761 +++ .../mgmt/2021-08-27/kusto/dataconnections.go | 618 +++ services/kusto/mgmt/2021-08-27/kusto/enums.go | 600 +++ .../2021-08-27/kusto/kustoapi/interfaces.go | 155 + .../kusto/managedprivateendpoints.go | 534 ++ .../kusto/mgmt/2021-08-27/kusto/models.go | 4761 +++++++++++++++++ .../kusto/mgmt/2021-08-27/kusto/operations.go | 142 + .../2021-08-27/kusto/operationsresults.go | 110 + .../kusto/privateendpointconnections.go | 360 ++ .../2021-08-27/kusto/privatelinkresources.go | 188 + .../kusto/mgmt/2021-08-27/kusto/scripts.go | 545 ++ .../kusto/mgmt/2021-08-27/kusto/version.go | 19 + .../2018-09-07-preview/kusto/CHANGELOG.md | 9 +- .../mgmt/2018-09-07-preview/kusto/_meta.json | 6 +- .../mgmt/2018-09-07-preview/kusto/clusters.go | 15 +- .../2018-09-07-preview/kusto/databases.go | 9 +- .../kusto/eventhubconnections.go | 9 +- 81 files changed, 12100 insertions(+), 317 deletions(-) create mode 100644 services/kusto/mgmt/2021-08-27/kusto/CHANGELOG.md create mode 100644 services/kusto/mgmt/2021-08-27/kusto/_meta.json create mode 100644 services/kusto/mgmt/2021-08-27/kusto/attacheddatabaseconfigurations.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/client.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/clusterprincipalassignments.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/clusters.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/databaseprincipalassignments.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/databases.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/dataconnections.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/enums.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/kustoapi/interfaces.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/managedprivateendpoints.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/models.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/operations.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/operationsresults.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/privateendpointconnections.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/privatelinkresources.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/scripts.go create mode 100644 services/kusto/mgmt/2021-08-27/kusto/version.go diff --git a/services/kusto/mgmt/2019-01-21/kusto/CHANGELOG.md b/services/kusto/mgmt/2019-01-21/kusto/CHANGELOG.md index 4a0e9bec8e2f..a1ecf841edb0 100644 --- a/services/kusto/mgmt/2019-01-21/kusto/CHANGELOG.md +++ b/services/kusto/mgmt/2019-01-21/kusto/CHANGELOG.md @@ -1,9 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. AzureEntityResource.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) diff --git a/services/kusto/mgmt/2019-01-21/kusto/_meta.json b/services/kusto/mgmt/2019-01-21/kusto/_meta.json index a2e6d07b2abc..947d57bedcf9 100644 --- a/services/kusto/mgmt/2019-01-21/kusto/_meta.json +++ b/services/kusto/mgmt/2019-01-21/kusto/_meta.json @@ -1,10 +1,10 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "57e4490a06aad262ca9154dc15b40f5a11bf7af5", "readme": "/_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "tag": "package-2019-01-21", - "use": "@microsoft.azure/autorest.go@2.1.183", + "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.183 --tag=package-2019-01-21 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2019-01-21 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/services/kusto/mgmt/2019-01-21/kusto/clusters.go b/services/kusto/mgmt/2019-01-21/kusto/clusters.go index 98b580c57640..9c9c7d77694b 100644 --- a/services/kusto/mgmt/2019-01-21/kusto/clusters.go +++ b/services/kusto/mgmt/2019-01-21/kusto/clusters.go @@ -147,7 +147,7 @@ func (client ClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -181,6 +181,7 @@ func (client ClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourc // http.Response Body if it receives an error. func (client ClustersClient) CreateOrUpdateSender(req *http.Request) (future ClustersCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -227,7 +228,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", result.Response(), "Failure sending request") return } @@ -259,6 +260,7 @@ func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -672,7 +674,7 @@ func (client ClustersClient) Start(ctx context.Context, resourceGroupName string result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", result.Response(), "Failure sending request") return } @@ -704,6 +706,7 @@ func (client ClustersClient) StartPreparer(ctx context.Context, resourceGroupNam // http.Response Body if it receives an error. func (client ClustersClient) StartSender(req *http.Request) (future ClustersStartFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -749,7 +752,7 @@ func (client ClustersClient) Stop(ctx context.Context, resourceGroupName string, result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", result.Response(), "Failure sending request") return } @@ -781,6 +784,7 @@ func (client ClustersClient) StopPreparer(ctx context.Context, resourceGroupName // http.Response Body if it receives an error. func (client ClustersClient) StopSender(req *http.Request) (future ClustersStopFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -827,7 +831,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", result.Response(), "Failure sending request") return } @@ -861,6 +865,7 @@ func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2019-01-21/kusto/databases.go b/services/kusto/mgmt/2019-01-21/kusto/databases.go index 3e428cd181e9..72b0373f7279 100644 --- a/services/kusto/mgmt/2019-01-21/kusto/databases.go +++ b/services/kusto/mgmt/2019-01-21/kusto/databases.go @@ -225,7 +225,7 @@ func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -260,6 +260,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour // http.Response Body if it receives an error. func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -307,7 +308,7 @@ func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", result.Response(), "Failure sending request") return } @@ -340,6 +341,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -700,7 +702,7 @@ func (client DatabasesClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", result.Response(), "Failure sending request") return } @@ -735,6 +737,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) UpdateSender(req *http.Request) (future DatabasesUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2019-01-21/kusto/dataconnections.go b/services/kusto/mgmt/2019-01-21/kusto/dataconnections.go index ffbce1bfe48d..1905590cbeda 100644 --- a/services/kusto/mgmt/2019-01-21/kusto/dataconnections.go +++ b/services/kusto/mgmt/2019-01-21/kusto/dataconnections.go @@ -147,7 +147,7 @@ func (client DataConnectionsClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -183,6 +183,7 @@ func (client DataConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, // http.Response Body if it receives an error. func (client DataConnectionsClient) CreateOrUpdateSender(req *http.Request) (future DataConnectionsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -200,7 +201,7 @@ func (client DataConnectionsClient) CreateOrUpdateResponder(resp *http.Response) err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -312,7 +313,7 @@ func (client DataConnectionsClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", result.Response(), "Failure sending request") return } @@ -346,6 +347,7 @@ func (client DataConnectionsClient) DeletePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) DeleteSender(req *http.Request) (future DataConnectionsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -552,7 +554,7 @@ func (client DataConnectionsClient) Update(ctx context.Context, resourceGroupNam result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", result.Response(), "Failure sending request") return } @@ -588,6 +590,7 @@ func (client DataConnectionsClient) UpdatePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) UpdateSender(req *http.Request) (future DataConnectionsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -605,7 +608,7 @@ func (client DataConnectionsClient) UpdateResponder(resp *http.Response) (result err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2019-05-15/kusto/CHANGELOG.md b/services/kusto/mgmt/2019-05-15/kusto/CHANGELOG.md index 957959dcae03..a1ecf841edb0 100644 --- a/services/kusto/mgmt/2019-05-15/kusto/CHANGELOG.md +++ b/services/kusto/mgmt/2019-05-15/kusto/CHANGELOG.md @@ -1,11 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. AzureEntityResource.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. SkuDescription.MarshalJSON() ([]byte, error) -1. SkuDescriptionList.MarshalJSON() ([]byte, error) diff --git a/services/kusto/mgmt/2019-05-15/kusto/_meta.json b/services/kusto/mgmt/2019-05-15/kusto/_meta.json index e12e5e2c214b..6f2cedd8a01d 100644 --- a/services/kusto/mgmt/2019-05-15/kusto/_meta.json +++ b/services/kusto/mgmt/2019-05-15/kusto/_meta.json @@ -1,10 +1,10 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "57e4490a06aad262ca9154dc15b40f5a11bf7af5", "readme": "/_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "tag": "package-2019-05-15", - "use": "@microsoft.azure/autorest.go@2.1.183", + "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.183 --tag=package-2019-05-15 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2019-05-15 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/services/kusto/mgmt/2019-05-15/kusto/clusters.go b/services/kusto/mgmt/2019-05-15/kusto/clusters.go index b117459f4f6b..30945951edaf 100644 --- a/services/kusto/mgmt/2019-05-15/kusto/clusters.go +++ b/services/kusto/mgmt/2019-05-15/kusto/clusters.go @@ -160,7 +160,7 @@ func (client ClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -194,6 +194,7 @@ func (client ClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourc // http.Response Body if it receives an error. func (client ClustersClient) CreateOrUpdateSender(req *http.Request) (future ClustersCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -240,7 +241,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", result.Response(), "Failure sending request") return } @@ -272,6 +273,7 @@ func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -685,7 +687,7 @@ func (client ClustersClient) Start(ctx context.Context, resourceGroupName string result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", result.Response(), "Failure sending request") return } @@ -717,6 +719,7 @@ func (client ClustersClient) StartPreparer(ctx context.Context, resourceGroupNam // http.Response Body if it receives an error. func (client ClustersClient) StartSender(req *http.Request) (future ClustersStartFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -762,7 +765,7 @@ func (client ClustersClient) Stop(ctx context.Context, resourceGroupName string, result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", result.Response(), "Failure sending request") return } @@ -794,6 +797,7 @@ func (client ClustersClient) StopPreparer(ctx context.Context, resourceGroupName // http.Response Body if it receives an error. func (client ClustersClient) StopSender(req *http.Request) (future ClustersStopFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -840,7 +844,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", result.Response(), "Failure sending request") return } @@ -874,6 +878,7 @@ func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2019-05-15/kusto/databases.go b/services/kusto/mgmt/2019-05-15/kusto/databases.go index 3fa110789904..81ebff430a51 100644 --- a/services/kusto/mgmt/2019-05-15/kusto/databases.go +++ b/services/kusto/mgmt/2019-05-15/kusto/databases.go @@ -225,7 +225,7 @@ func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -260,6 +260,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour // http.Response Body if it receives an error. func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -307,7 +308,7 @@ func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", result.Response(), "Failure sending request") return } @@ -340,6 +341,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -700,7 +702,7 @@ func (client DatabasesClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", result.Response(), "Failure sending request") return } @@ -735,6 +737,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) UpdateSender(req *http.Request) (future DatabasesUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2019-05-15/kusto/dataconnections.go b/services/kusto/mgmt/2019-05-15/kusto/dataconnections.go index 27582257dd48..7ec3d743b517 100644 --- a/services/kusto/mgmt/2019-05-15/kusto/dataconnections.go +++ b/services/kusto/mgmt/2019-05-15/kusto/dataconnections.go @@ -147,7 +147,7 @@ func (client DataConnectionsClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -183,6 +183,7 @@ func (client DataConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, // http.Response Body if it receives an error. func (client DataConnectionsClient) CreateOrUpdateSender(req *http.Request) (future DataConnectionsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -200,7 +201,7 @@ func (client DataConnectionsClient) CreateOrUpdateResponder(resp *http.Response) err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -312,7 +313,7 @@ func (client DataConnectionsClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", result.Response(), "Failure sending request") return } @@ -346,6 +347,7 @@ func (client DataConnectionsClient) DeletePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) DeleteSender(req *http.Request) (future DataConnectionsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -552,7 +554,7 @@ func (client DataConnectionsClient) Update(ctx context.Context, resourceGroupNam result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", result.Response(), "Failure sending request") return } @@ -588,6 +590,7 @@ func (client DataConnectionsClient) UpdatePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) UpdateSender(req *http.Request) (future DataConnectionsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -605,7 +608,7 @@ func (client DataConnectionsClient) UpdateResponder(resp *http.Response) (result err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2019-09-07/kusto/CHANGELOG.md b/services/kusto/mgmt/2019-09-07/kusto/CHANGELOG.md index 997ce8b01855..a1ecf841edb0 100644 --- a/services/kusto/mgmt/2019-09-07/kusto/CHANGELOG.md +++ b/services/kusto/mgmt/2019-09-07/kusto/CHANGELOG.md @@ -1,12 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. AzureEntityResource.MarshalJSON() ([]byte, error) -1. IdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. SkuDescription.MarshalJSON() ([]byte, error) -1. SkuDescriptionList.MarshalJSON() ([]byte, error) diff --git a/services/kusto/mgmt/2019-09-07/kusto/_meta.json b/services/kusto/mgmt/2019-09-07/kusto/_meta.json index 6abcbcda374d..4f3fb5917816 100644 --- a/services/kusto/mgmt/2019-09-07/kusto/_meta.json +++ b/services/kusto/mgmt/2019-09-07/kusto/_meta.json @@ -1,10 +1,10 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "57e4490a06aad262ca9154dc15b40f5a11bf7af5", "readme": "/_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "tag": "package-2019-09-07", - "use": "@microsoft.azure/autorest.go@2.1.183", + "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.183 --tag=package-2019-09-07 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2019-09-07 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/services/kusto/mgmt/2019-09-07/kusto/attacheddatabaseconfigurations.go b/services/kusto/mgmt/2019-09-07/kusto/attacheddatabaseconfigurations.go index d5ce779f95db..c5f9c97a0bcf 100644 --- a/services/kusto/mgmt/2019-09-07/kusto/attacheddatabaseconfigurations.go +++ b/services/kusto/mgmt/2019-09-07/kusto/attacheddatabaseconfigurations.go @@ -68,7 +68,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdate(ctx context.Co result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -103,6 +103,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdatePreparer(ctx co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future AttachedDatabaseConfigurationsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -150,7 +151,7 @@ func (client AttachedDatabaseConfigurationsClient) Delete(ctx context.Context, r result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", result.Response(), "Failure sending request") return } @@ -183,6 +184,7 @@ func (client AttachedDatabaseConfigurationsClient) DeletePreparer(ctx context.Co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) DeleteSender(req *http.Request) (future AttachedDatabaseConfigurationsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2019-09-07/kusto/clusters.go b/services/kusto/mgmt/2019-09-07/kusto/clusters.go index 43357540bd26..1f2146bc6ada 100644 --- a/services/kusto/mgmt/2019-09-07/kusto/clusters.go +++ b/services/kusto/mgmt/2019-09-07/kusto/clusters.go @@ -165,7 +165,7 @@ func (client ClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -199,6 +199,7 @@ func (client ClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourc // http.Response Body if it receives an error. func (client ClustersClient) CreateOrUpdateSender(req *http.Request) (future ClustersCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -245,7 +246,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", result.Response(), "Failure sending request") return } @@ -277,6 +278,7 @@ func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -330,7 +332,7 @@ func (client ClustersClient) DetachFollowerDatabases(ctx context.Context, resour result, err = client.DetachFollowerDatabasesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", result.Response(), "Failure sending request") return } @@ -365,6 +367,7 @@ func (client ClustersClient) DetachFollowerDatabasesPreparer(ctx context.Context // http.Response Body if it receives an error. func (client ClustersClient) DetachFollowerDatabasesSender(req *http.Request) (future ClustersDetachFollowerDatabasesFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -855,7 +858,7 @@ func (client ClustersClient) Start(ctx context.Context, resourceGroupName string result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", result.Response(), "Failure sending request") return } @@ -887,6 +890,7 @@ func (client ClustersClient) StartPreparer(ctx context.Context, resourceGroupNam // http.Response Body if it receives an error. func (client ClustersClient) StartSender(req *http.Request) (future ClustersStartFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -932,7 +936,7 @@ func (client ClustersClient) Stop(ctx context.Context, resourceGroupName string, result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", result.Response(), "Failure sending request") return } @@ -964,6 +968,7 @@ func (client ClustersClient) StopPreparer(ctx context.Context, resourceGroupName // http.Response Body if it receives an error. func (client ClustersClient) StopSender(req *http.Request) (future ClustersStopFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1010,7 +1015,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", result.Response(), "Failure sending request") return } @@ -1044,6 +1049,7 @@ func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2019-09-07/kusto/databases.go b/services/kusto/mgmt/2019-09-07/kusto/databases.go index 9e8f632f8e19..cfc47ec7481c 100644 --- a/services/kusto/mgmt/2019-09-07/kusto/databases.go +++ b/services/kusto/mgmt/2019-09-07/kusto/databases.go @@ -224,7 +224,7 @@ func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -259,6 +259,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour // http.Response Body if it receives an error. func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -276,7 +277,7 @@ func (client DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (resu err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -306,7 +307,7 @@ func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", result.Response(), "Failure sending request") return } @@ -339,6 +340,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -699,7 +701,7 @@ func (client DatabasesClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", result.Response(), "Failure sending request") return } @@ -734,6 +736,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) UpdateSender(req *http.Request) (future DatabasesUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -751,7 +754,7 @@ func (client DatabasesClient) UpdateResponder(resp *http.Response) (result Datab err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2019-09-07/kusto/dataconnections.go b/services/kusto/mgmt/2019-09-07/kusto/dataconnections.go index d1676950428a..ae83ec36cf61 100644 --- a/services/kusto/mgmt/2019-09-07/kusto/dataconnections.go +++ b/services/kusto/mgmt/2019-09-07/kusto/dataconnections.go @@ -147,7 +147,7 @@ func (client DataConnectionsClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -183,6 +183,7 @@ func (client DataConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, // http.Response Body if it receives an error. func (client DataConnectionsClient) CreateOrUpdateSender(req *http.Request) (future DataConnectionsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -200,7 +201,7 @@ func (client DataConnectionsClient) CreateOrUpdateResponder(resp *http.Response) err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -312,7 +313,7 @@ func (client DataConnectionsClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", result.Response(), "Failure sending request") return } @@ -346,6 +347,7 @@ func (client DataConnectionsClient) DeletePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) DeleteSender(req *http.Request) (future DataConnectionsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -552,7 +554,7 @@ func (client DataConnectionsClient) Update(ctx context.Context, resourceGroupNam result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", result.Response(), "Failure sending request") return } @@ -588,6 +590,7 @@ func (client DataConnectionsClient) UpdatePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) UpdateSender(req *http.Request) (future DataConnectionsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -605,7 +608,7 @@ func (client DataConnectionsClient) UpdateResponder(resp *http.Response) (result err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2019-11-09/kusto/CHANGELOG.md b/services/kusto/mgmt/2019-11-09/kusto/CHANGELOG.md index 997ce8b01855..a1ecf841edb0 100644 --- a/services/kusto/mgmt/2019-11-09/kusto/CHANGELOG.md +++ b/services/kusto/mgmt/2019-11-09/kusto/CHANGELOG.md @@ -1,12 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. AzureEntityResource.MarshalJSON() ([]byte, error) -1. IdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. SkuDescription.MarshalJSON() ([]byte, error) -1. SkuDescriptionList.MarshalJSON() ([]byte, error) diff --git a/services/kusto/mgmt/2019-11-09/kusto/_meta.json b/services/kusto/mgmt/2019-11-09/kusto/_meta.json index cbad30f4bf7e..d242e3549f0a 100644 --- a/services/kusto/mgmt/2019-11-09/kusto/_meta.json +++ b/services/kusto/mgmt/2019-11-09/kusto/_meta.json @@ -1,10 +1,10 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "57e4490a06aad262ca9154dc15b40f5a11bf7af5", "readme": "/_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "tag": "package-2019-11-09", - "use": "@microsoft.azure/autorest.go@2.1.183", + "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.183 --tag=package-2019-11-09 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2019-11-09 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/services/kusto/mgmt/2019-11-09/kusto/attacheddatabaseconfigurations.go b/services/kusto/mgmt/2019-11-09/kusto/attacheddatabaseconfigurations.go index 106f39b5b145..32743dbe76af 100644 --- a/services/kusto/mgmt/2019-11-09/kusto/attacheddatabaseconfigurations.go +++ b/services/kusto/mgmt/2019-11-09/kusto/attacheddatabaseconfigurations.go @@ -68,7 +68,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdate(ctx context.Co result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -103,6 +103,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdatePreparer(ctx co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future AttachedDatabaseConfigurationsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -150,7 +151,7 @@ func (client AttachedDatabaseConfigurationsClient) Delete(ctx context.Context, r result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", result.Response(), "Failure sending request") return } @@ -183,6 +184,7 @@ func (client AttachedDatabaseConfigurationsClient) DeletePreparer(ctx context.Co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) DeleteSender(req *http.Request) (future AttachedDatabaseConfigurationsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2019-11-09/kusto/clusterprincipalassignments.go b/services/kusto/mgmt/2019-11-09/kusto/clusterprincipalassignments.go index ec9bb1a3dab0..f17530467f6c 100644 --- a/services/kusto/mgmt/2019-11-09/kusto/clusterprincipalassignments.go +++ b/services/kusto/mgmt/2019-11-09/kusto/clusterprincipalassignments.go @@ -152,7 +152,7 @@ func (client ClusterPrincipalAssignmentsClient) CreateOrUpdate(ctx context.Conte result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -187,6 +187,7 @@ func (client ClusterPrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx conte // http.Response Body if it receives an error. func (client ClusterPrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future ClusterPrincipalAssignmentsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -234,7 +235,7 @@ func (client ClusterPrincipalAssignmentsClient) Delete(ctx context.Context, reso result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") return } @@ -267,6 +268,7 @@ func (client ClusterPrincipalAssignmentsClient) DeletePreparer(ctx context.Conte // http.Response Body if it receives an error. func (client ClusterPrincipalAssignmentsClient) DeleteSender(req *http.Request) (future ClusterPrincipalAssignmentsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2019-11-09/kusto/clusters.go b/services/kusto/mgmt/2019-11-09/kusto/clusters.go index 68625ebcd6ea..18e0bb9c2060 100644 --- a/services/kusto/mgmt/2019-11-09/kusto/clusters.go +++ b/services/kusto/mgmt/2019-11-09/kusto/clusters.go @@ -165,7 +165,7 @@ func (client ClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -199,6 +199,7 @@ func (client ClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourc // http.Response Body if it receives an error. func (client ClustersClient) CreateOrUpdateSender(req *http.Request) (future ClustersCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -245,7 +246,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", result.Response(), "Failure sending request") return } @@ -277,6 +278,7 @@ func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -330,7 +332,7 @@ func (client ClustersClient) DetachFollowerDatabases(ctx context.Context, resour result, err = client.DetachFollowerDatabasesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", result.Response(), "Failure sending request") return } @@ -365,6 +367,7 @@ func (client ClustersClient) DetachFollowerDatabasesPreparer(ctx context.Context // http.Response Body if it receives an error. func (client ClustersClient) DetachFollowerDatabasesSender(req *http.Request) (future ClustersDetachFollowerDatabasesFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -411,7 +414,7 @@ func (client ClustersClient) DiagnoseVirtualNetwork(ctx context.Context, resourc result, err = client.DiagnoseVirtualNetworkSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", result.Response(), "Failure sending request") return } @@ -443,6 +446,7 @@ func (client ClustersClient) DiagnoseVirtualNetworkPreparer(ctx context.Context, // http.Response Body if it receives an error. func (client ClustersClient) DiagnoseVirtualNetworkSender(req *http.Request) (future ClustersDiagnoseVirtualNetworkFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -934,7 +938,7 @@ func (client ClustersClient) Start(ctx context.Context, resourceGroupName string result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", result.Response(), "Failure sending request") return } @@ -966,6 +970,7 @@ func (client ClustersClient) StartPreparer(ctx context.Context, resourceGroupNam // http.Response Body if it receives an error. func (client ClustersClient) StartSender(req *http.Request) (future ClustersStartFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1011,7 +1016,7 @@ func (client ClustersClient) Stop(ctx context.Context, resourceGroupName string, result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", result.Response(), "Failure sending request") return } @@ -1043,6 +1048,7 @@ func (client ClustersClient) StopPreparer(ctx context.Context, resourceGroupName // http.Response Body if it receives an error. func (client ClustersClient) StopSender(req *http.Request) (future ClustersStopFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1089,7 +1095,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", result.Response(), "Failure sending request") return } @@ -1123,6 +1129,7 @@ func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2019-11-09/kusto/databaseprincipalassignments.go b/services/kusto/mgmt/2019-11-09/kusto/databaseprincipalassignments.go index f923090c76fe..6da480b2285d 100644 --- a/services/kusto/mgmt/2019-11-09/kusto/databaseprincipalassignments.go +++ b/services/kusto/mgmt/2019-11-09/kusto/databaseprincipalassignments.go @@ -155,7 +155,7 @@ func (client DatabasePrincipalAssignmentsClient) CreateOrUpdate(ctx context.Cont result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -191,6 +191,7 @@ func (client DatabasePrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx cont // http.Response Body if it receives an error. func (client DatabasePrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future DatabasePrincipalAssignmentsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -239,7 +240,7 @@ func (client DatabasePrincipalAssignmentsClient) Delete(ctx context.Context, res result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") return } @@ -273,6 +274,7 @@ func (client DatabasePrincipalAssignmentsClient) DeletePreparer(ctx context.Cont // http.Response Body if it receives an error. func (client DatabasePrincipalAssignmentsClient) DeleteSender(req *http.Request) (future DatabasePrincipalAssignmentsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2019-11-09/kusto/databases.go b/services/kusto/mgmt/2019-11-09/kusto/databases.go index 2a2bf3c67187..90de3dd26fd9 100644 --- a/services/kusto/mgmt/2019-11-09/kusto/databases.go +++ b/services/kusto/mgmt/2019-11-09/kusto/databases.go @@ -224,7 +224,7 @@ func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -259,6 +259,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour // http.Response Body if it receives an error. func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -276,7 +277,7 @@ func (client DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (resu err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -306,7 +307,7 @@ func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", result.Response(), "Failure sending request") return } @@ -339,6 +340,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -699,7 +701,7 @@ func (client DatabasesClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", result.Response(), "Failure sending request") return } @@ -734,6 +736,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) UpdateSender(req *http.Request) (future DatabasesUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -751,7 +754,7 @@ func (client DatabasesClient) UpdateResponder(resp *http.Response) (result Datab err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2019-11-09/kusto/dataconnections.go b/services/kusto/mgmt/2019-11-09/kusto/dataconnections.go index ae424bfb3927..1fe7b9b046a4 100644 --- a/services/kusto/mgmt/2019-11-09/kusto/dataconnections.go +++ b/services/kusto/mgmt/2019-11-09/kusto/dataconnections.go @@ -147,7 +147,7 @@ func (client DataConnectionsClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -183,6 +183,7 @@ func (client DataConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, // http.Response Body if it receives an error. func (client DataConnectionsClient) CreateOrUpdateSender(req *http.Request) (future DataConnectionsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -200,7 +201,7 @@ func (client DataConnectionsClient) CreateOrUpdateResponder(resp *http.Response) err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -312,7 +313,7 @@ func (client DataConnectionsClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", result.Response(), "Failure sending request") return } @@ -346,6 +347,7 @@ func (client DataConnectionsClient) DeletePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) DeleteSender(req *http.Request) (future DataConnectionsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -552,7 +554,7 @@ func (client DataConnectionsClient) Update(ctx context.Context, resourceGroupNam result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", result.Response(), "Failure sending request") return } @@ -588,6 +590,7 @@ func (client DataConnectionsClient) UpdatePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) UpdateSender(req *http.Request) (future DataConnectionsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -605,7 +608,7 @@ func (client DataConnectionsClient) UpdateResponder(resp *http.Response) (result err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2020-02-15/kusto/CHANGELOG.md b/services/kusto/mgmt/2020-02-15/kusto/CHANGELOG.md index 997ce8b01855..a1ecf841edb0 100644 --- a/services/kusto/mgmt/2020-02-15/kusto/CHANGELOG.md +++ b/services/kusto/mgmt/2020-02-15/kusto/CHANGELOG.md @@ -1,12 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. AzureEntityResource.MarshalJSON() ([]byte, error) -1. IdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. SkuDescription.MarshalJSON() ([]byte, error) -1. SkuDescriptionList.MarshalJSON() ([]byte, error) diff --git a/services/kusto/mgmt/2020-02-15/kusto/_meta.json b/services/kusto/mgmt/2020-02-15/kusto/_meta.json index 19c01fa01ff3..cd972989b726 100644 --- a/services/kusto/mgmt/2020-02-15/kusto/_meta.json +++ b/services/kusto/mgmt/2020-02-15/kusto/_meta.json @@ -1,10 +1,10 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "57e4490a06aad262ca9154dc15b40f5a11bf7af5", "readme": "/_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "tag": "package-2020-02-15", - "use": "@microsoft.azure/autorest.go@2.1.183", + "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.183 --tag=package-2020-02-15 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2020-02-15 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/services/kusto/mgmt/2020-02-15/kusto/attacheddatabaseconfigurations.go b/services/kusto/mgmt/2020-02-15/kusto/attacheddatabaseconfigurations.go index a68f12cea828..527529d9bb44 100644 --- a/services/kusto/mgmt/2020-02-15/kusto/attacheddatabaseconfigurations.go +++ b/services/kusto/mgmt/2020-02-15/kusto/attacheddatabaseconfigurations.go @@ -68,7 +68,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdate(ctx context.Co result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -103,6 +103,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdatePreparer(ctx co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future AttachedDatabaseConfigurationsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -150,7 +151,7 @@ func (client AttachedDatabaseConfigurationsClient) Delete(ctx context.Context, r result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", result.Response(), "Failure sending request") return } @@ -183,6 +184,7 @@ func (client AttachedDatabaseConfigurationsClient) DeletePreparer(ctx context.Co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) DeleteSender(req *http.Request) (future AttachedDatabaseConfigurationsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-02-15/kusto/clusterprincipalassignments.go b/services/kusto/mgmt/2020-02-15/kusto/clusterprincipalassignments.go index 4fab42698ec2..5186b1068219 100644 --- a/services/kusto/mgmt/2020-02-15/kusto/clusterprincipalassignments.go +++ b/services/kusto/mgmt/2020-02-15/kusto/clusterprincipalassignments.go @@ -152,7 +152,7 @@ func (client ClusterPrincipalAssignmentsClient) CreateOrUpdate(ctx context.Conte result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -187,6 +187,7 @@ func (client ClusterPrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx conte // http.Response Body if it receives an error. func (client ClusterPrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future ClusterPrincipalAssignmentsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -234,7 +235,7 @@ func (client ClusterPrincipalAssignmentsClient) Delete(ctx context.Context, reso result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") return } @@ -267,6 +268,7 @@ func (client ClusterPrincipalAssignmentsClient) DeletePreparer(ctx context.Conte // http.Response Body if it receives an error. func (client ClusterPrincipalAssignmentsClient) DeleteSender(req *http.Request) (future ClusterPrincipalAssignmentsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-02-15/kusto/clusters.go b/services/kusto/mgmt/2020-02-15/kusto/clusters.go index 0234fdb43401..d7493717050e 100644 --- a/services/kusto/mgmt/2020-02-15/kusto/clusters.go +++ b/services/kusto/mgmt/2020-02-15/kusto/clusters.go @@ -57,7 +57,7 @@ func (client ClustersClient) AddLanguageExtensions(ctx context.Context, resource result, err = client.AddLanguageExtensionsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "AddLanguageExtensions", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "AddLanguageExtensions", result.Response(), "Failure sending request") return } @@ -91,6 +91,7 @@ func (client ClustersClient) AddLanguageExtensionsPreparer(ctx context.Context, // http.Response Body if it receives an error. func (client ClustersClient) AddLanguageExtensionsSender(req *http.Request) (future ClustersAddLanguageExtensionsFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -245,7 +246,7 @@ func (client ClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -279,6 +280,7 @@ func (client ClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourc // http.Response Body if it receives an error. func (client ClustersClient) CreateOrUpdateSender(req *http.Request) (future ClustersCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -325,7 +327,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", result.Response(), "Failure sending request") return } @@ -357,6 +359,7 @@ func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -410,7 +413,7 @@ func (client ClustersClient) DetachFollowerDatabases(ctx context.Context, resour result, err = client.DetachFollowerDatabasesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", result.Response(), "Failure sending request") return } @@ -445,6 +448,7 @@ func (client ClustersClient) DetachFollowerDatabasesPreparer(ctx context.Context // http.Response Body if it receives an error. func (client ClustersClient) DetachFollowerDatabasesSender(req *http.Request) (future ClustersDetachFollowerDatabasesFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -491,7 +495,7 @@ func (client ClustersClient) DiagnoseVirtualNetwork(ctx context.Context, resourc result, err = client.DiagnoseVirtualNetworkSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", result.Response(), "Failure sending request") return } @@ -523,6 +527,7 @@ func (client ClustersClient) DiagnoseVirtualNetworkPreparer(ctx context.Context, // http.Response Body if it receives an error. func (client ClustersClient) DiagnoseVirtualNetworkSender(req *http.Request) (future ClustersDiagnoseVirtualNetworkFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1091,7 +1096,7 @@ func (client ClustersClient) RemoveLanguageExtensions(ctx context.Context, resou result, err = client.RemoveLanguageExtensionsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "RemoveLanguageExtensions", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "RemoveLanguageExtensions", result.Response(), "Failure sending request") return } @@ -1125,6 +1130,7 @@ func (client ClustersClient) RemoveLanguageExtensionsPreparer(ctx context.Contex // http.Response Body if it receives an error. func (client ClustersClient) RemoveLanguageExtensionsSender(req *http.Request) (future ClustersRemoveLanguageExtensionsFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1170,7 +1176,7 @@ func (client ClustersClient) Start(ctx context.Context, resourceGroupName string result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", result.Response(), "Failure sending request") return } @@ -1202,6 +1208,7 @@ func (client ClustersClient) StartPreparer(ctx context.Context, resourceGroupNam // http.Response Body if it receives an error. func (client ClustersClient) StartSender(req *http.Request) (future ClustersStartFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1247,7 +1254,7 @@ func (client ClustersClient) Stop(ctx context.Context, resourceGroupName string, result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", result.Response(), "Failure sending request") return } @@ -1279,6 +1286,7 @@ func (client ClustersClient) StopPreparer(ctx context.Context, resourceGroupName // http.Response Body if it receives an error. func (client ClustersClient) StopSender(req *http.Request) (future ClustersStopFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1325,7 +1333,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", result.Response(), "Failure sending request") return } @@ -1359,6 +1367,7 @@ func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-02-15/kusto/databaseprincipalassignments.go b/services/kusto/mgmt/2020-02-15/kusto/databaseprincipalassignments.go index e1bb6060f329..6aa7779da297 100644 --- a/services/kusto/mgmt/2020-02-15/kusto/databaseprincipalassignments.go +++ b/services/kusto/mgmt/2020-02-15/kusto/databaseprincipalassignments.go @@ -155,7 +155,7 @@ func (client DatabasePrincipalAssignmentsClient) CreateOrUpdate(ctx context.Cont result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -191,6 +191,7 @@ func (client DatabasePrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx cont // http.Response Body if it receives an error. func (client DatabasePrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future DatabasePrincipalAssignmentsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -239,7 +240,7 @@ func (client DatabasePrincipalAssignmentsClient) Delete(ctx context.Context, res result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") return } @@ -273,6 +274,7 @@ func (client DatabasePrincipalAssignmentsClient) DeletePreparer(ctx context.Cont // http.Response Body if it receives an error. func (client DatabasePrincipalAssignmentsClient) DeleteSender(req *http.Request) (future DatabasePrincipalAssignmentsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-02-15/kusto/databases.go b/services/kusto/mgmt/2020-02-15/kusto/databases.go index daaa2ac54111..997baec4c6b9 100644 --- a/services/kusto/mgmt/2020-02-15/kusto/databases.go +++ b/services/kusto/mgmt/2020-02-15/kusto/databases.go @@ -224,7 +224,7 @@ func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -259,6 +259,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour // http.Response Body if it receives an error. func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -276,7 +277,7 @@ func (client DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (resu err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -306,7 +307,7 @@ func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", result.Response(), "Failure sending request") return } @@ -339,6 +340,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -699,7 +701,7 @@ func (client DatabasesClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", result.Response(), "Failure sending request") return } @@ -734,6 +736,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) UpdateSender(req *http.Request) (future DatabasesUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -751,7 +754,7 @@ func (client DatabasesClient) UpdateResponder(resp *http.Response) (result Datab err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2020-02-15/kusto/dataconnections.go b/services/kusto/mgmt/2020-02-15/kusto/dataconnections.go index 578e2e9ac7b3..addacb45b5e0 100644 --- a/services/kusto/mgmt/2020-02-15/kusto/dataconnections.go +++ b/services/kusto/mgmt/2020-02-15/kusto/dataconnections.go @@ -147,7 +147,7 @@ func (client DataConnectionsClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -183,6 +183,7 @@ func (client DataConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, // http.Response Body if it receives an error. func (client DataConnectionsClient) CreateOrUpdateSender(req *http.Request) (future DataConnectionsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -200,7 +201,7 @@ func (client DataConnectionsClient) CreateOrUpdateResponder(resp *http.Response) err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -312,7 +313,7 @@ func (client DataConnectionsClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", result.Response(), "Failure sending request") return } @@ -346,6 +347,7 @@ func (client DataConnectionsClient) DeletePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) DeleteSender(req *http.Request) (future DataConnectionsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -552,7 +554,7 @@ func (client DataConnectionsClient) Update(ctx context.Context, resourceGroupNam result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", result.Response(), "Failure sending request") return } @@ -588,6 +590,7 @@ func (client DataConnectionsClient) UpdatePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) UpdateSender(req *http.Request) (future DataConnectionsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -605,7 +608,7 @@ func (client DataConnectionsClient) UpdateResponder(resp *http.Response) (result err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2020-06-14/kusto/CHANGELOG.md b/services/kusto/mgmt/2020-06-14/kusto/CHANGELOG.md index 997ce8b01855..a1ecf841edb0 100644 --- a/services/kusto/mgmt/2020-06-14/kusto/CHANGELOG.md +++ b/services/kusto/mgmt/2020-06-14/kusto/CHANGELOG.md @@ -1,12 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. AzureEntityResource.MarshalJSON() ([]byte, error) -1. IdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. SkuDescription.MarshalJSON() ([]byte, error) -1. SkuDescriptionList.MarshalJSON() ([]byte, error) diff --git a/services/kusto/mgmt/2020-06-14/kusto/_meta.json b/services/kusto/mgmt/2020-06-14/kusto/_meta.json index 982b48600e8a..994e9f549670 100644 --- a/services/kusto/mgmt/2020-06-14/kusto/_meta.json +++ b/services/kusto/mgmt/2020-06-14/kusto/_meta.json @@ -1,10 +1,10 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "57e4490a06aad262ca9154dc15b40f5a11bf7af5", "readme": "/_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "tag": "package-2020-06-14", - "use": "@microsoft.azure/autorest.go@2.1.183", + "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.183 --tag=package-2020-06-14 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2020-06-14 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/services/kusto/mgmt/2020-06-14/kusto/attacheddatabaseconfigurations.go b/services/kusto/mgmt/2020-06-14/kusto/attacheddatabaseconfigurations.go index adafdd8ebd8c..21af4f72d4e0 100644 --- a/services/kusto/mgmt/2020-06-14/kusto/attacheddatabaseconfigurations.go +++ b/services/kusto/mgmt/2020-06-14/kusto/attacheddatabaseconfigurations.go @@ -68,7 +68,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdate(ctx context.Co result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -103,6 +103,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdatePreparer(ctx co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future AttachedDatabaseConfigurationsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -150,7 +151,7 @@ func (client AttachedDatabaseConfigurationsClient) Delete(ctx context.Context, r result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", result.Response(), "Failure sending request") return } @@ -183,6 +184,7 @@ func (client AttachedDatabaseConfigurationsClient) DeletePreparer(ctx context.Co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) DeleteSender(req *http.Request) (future AttachedDatabaseConfigurationsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-06-14/kusto/clusterprincipalassignments.go b/services/kusto/mgmt/2020-06-14/kusto/clusterprincipalassignments.go index 21253a87fe80..7e8cfcb4fa50 100644 --- a/services/kusto/mgmt/2020-06-14/kusto/clusterprincipalassignments.go +++ b/services/kusto/mgmt/2020-06-14/kusto/clusterprincipalassignments.go @@ -152,7 +152,7 @@ func (client ClusterPrincipalAssignmentsClient) CreateOrUpdate(ctx context.Conte result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -187,6 +187,7 @@ func (client ClusterPrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx conte // http.Response Body if it receives an error. func (client ClusterPrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future ClusterPrincipalAssignmentsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -234,7 +235,7 @@ func (client ClusterPrincipalAssignmentsClient) Delete(ctx context.Context, reso result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") return } @@ -267,6 +268,7 @@ func (client ClusterPrincipalAssignmentsClient) DeletePreparer(ctx context.Conte // http.Response Body if it receives an error. func (client ClusterPrincipalAssignmentsClient) DeleteSender(req *http.Request) (future ClusterPrincipalAssignmentsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-06-14/kusto/clusters.go b/services/kusto/mgmt/2020-06-14/kusto/clusters.go index 86e3296376de..3ee01471b2e7 100644 --- a/services/kusto/mgmt/2020-06-14/kusto/clusters.go +++ b/services/kusto/mgmt/2020-06-14/kusto/clusters.go @@ -57,7 +57,7 @@ func (client ClustersClient) AddLanguageExtensions(ctx context.Context, resource result, err = client.AddLanguageExtensionsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "AddLanguageExtensions", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "AddLanguageExtensions", result.Response(), "Failure sending request") return } @@ -91,6 +91,7 @@ func (client ClustersClient) AddLanguageExtensionsPreparer(ctx context.Context, // http.Response Body if it receives an error. func (client ClustersClient) AddLanguageExtensionsSender(req *http.Request) (future ClustersAddLanguageExtensionsFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -245,7 +246,7 @@ func (client ClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -279,6 +280,7 @@ func (client ClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourc // http.Response Body if it receives an error. func (client ClustersClient) CreateOrUpdateSender(req *http.Request) (future ClustersCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -325,7 +327,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", result.Response(), "Failure sending request") return } @@ -357,6 +359,7 @@ func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -410,7 +413,7 @@ func (client ClustersClient) DetachFollowerDatabases(ctx context.Context, resour result, err = client.DetachFollowerDatabasesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", result.Response(), "Failure sending request") return } @@ -445,6 +448,7 @@ func (client ClustersClient) DetachFollowerDatabasesPreparer(ctx context.Context // http.Response Body if it receives an error. func (client ClustersClient) DetachFollowerDatabasesSender(req *http.Request) (future ClustersDetachFollowerDatabasesFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -491,7 +495,7 @@ func (client ClustersClient) DiagnoseVirtualNetwork(ctx context.Context, resourc result, err = client.DiagnoseVirtualNetworkSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", result.Response(), "Failure sending request") return } @@ -523,6 +527,7 @@ func (client ClustersClient) DiagnoseVirtualNetworkPreparer(ctx context.Context, // http.Response Body if it receives an error. func (client ClustersClient) DiagnoseVirtualNetworkSender(req *http.Request) (future ClustersDiagnoseVirtualNetworkFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1091,7 +1096,7 @@ func (client ClustersClient) RemoveLanguageExtensions(ctx context.Context, resou result, err = client.RemoveLanguageExtensionsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "RemoveLanguageExtensions", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "RemoveLanguageExtensions", result.Response(), "Failure sending request") return } @@ -1125,6 +1130,7 @@ func (client ClustersClient) RemoveLanguageExtensionsPreparer(ctx context.Contex // http.Response Body if it receives an error. func (client ClustersClient) RemoveLanguageExtensionsSender(req *http.Request) (future ClustersRemoveLanguageExtensionsFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1170,7 +1176,7 @@ func (client ClustersClient) Start(ctx context.Context, resourceGroupName string result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", result.Response(), "Failure sending request") return } @@ -1202,6 +1208,7 @@ func (client ClustersClient) StartPreparer(ctx context.Context, resourceGroupNam // http.Response Body if it receives an error. func (client ClustersClient) StartSender(req *http.Request) (future ClustersStartFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1247,7 +1254,7 @@ func (client ClustersClient) Stop(ctx context.Context, resourceGroupName string, result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", result.Response(), "Failure sending request") return } @@ -1279,6 +1286,7 @@ func (client ClustersClient) StopPreparer(ctx context.Context, resourceGroupName // http.Response Body if it receives an error. func (client ClustersClient) StopSender(req *http.Request) (future ClustersStopFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1325,7 +1333,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", result.Response(), "Failure sending request") return } @@ -1359,6 +1367,7 @@ func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-06-14/kusto/databaseprincipalassignments.go b/services/kusto/mgmt/2020-06-14/kusto/databaseprincipalassignments.go index 5a2b7453c001..123d5e3394e5 100644 --- a/services/kusto/mgmt/2020-06-14/kusto/databaseprincipalassignments.go +++ b/services/kusto/mgmt/2020-06-14/kusto/databaseprincipalassignments.go @@ -155,7 +155,7 @@ func (client DatabasePrincipalAssignmentsClient) CreateOrUpdate(ctx context.Cont result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -191,6 +191,7 @@ func (client DatabasePrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx cont // http.Response Body if it receives an error. func (client DatabasePrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future DatabasePrincipalAssignmentsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -239,7 +240,7 @@ func (client DatabasePrincipalAssignmentsClient) Delete(ctx context.Context, res result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") return } @@ -273,6 +274,7 @@ func (client DatabasePrincipalAssignmentsClient) DeletePreparer(ctx context.Cont // http.Response Body if it receives an error. func (client DatabasePrincipalAssignmentsClient) DeleteSender(req *http.Request) (future DatabasePrincipalAssignmentsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-06-14/kusto/databases.go b/services/kusto/mgmt/2020-06-14/kusto/databases.go index 9be5aad287a8..2853f06f0d68 100644 --- a/services/kusto/mgmt/2020-06-14/kusto/databases.go +++ b/services/kusto/mgmt/2020-06-14/kusto/databases.go @@ -224,7 +224,7 @@ func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -259,6 +259,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour // http.Response Body if it receives an error. func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -276,7 +277,7 @@ func (client DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (resu err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -306,7 +307,7 @@ func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", result.Response(), "Failure sending request") return } @@ -339,6 +340,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -699,7 +701,7 @@ func (client DatabasesClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", result.Response(), "Failure sending request") return } @@ -734,6 +736,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) UpdateSender(req *http.Request) (future DatabasesUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -751,7 +754,7 @@ func (client DatabasesClient) UpdateResponder(resp *http.Response) (result Datab err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2020-06-14/kusto/dataconnections.go b/services/kusto/mgmt/2020-06-14/kusto/dataconnections.go index 599dff1b45b7..597dc3294432 100644 --- a/services/kusto/mgmt/2020-06-14/kusto/dataconnections.go +++ b/services/kusto/mgmt/2020-06-14/kusto/dataconnections.go @@ -147,7 +147,7 @@ func (client DataConnectionsClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -183,6 +183,7 @@ func (client DataConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, // http.Response Body if it receives an error. func (client DataConnectionsClient) CreateOrUpdateSender(req *http.Request) (future DataConnectionsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -200,7 +201,7 @@ func (client DataConnectionsClient) CreateOrUpdateResponder(resp *http.Response) err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -231,7 +232,7 @@ func (client DataConnectionsClient) DataConnectionValidationMethod(ctx context.C result, err = client.DataConnectionValidationMethodSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "DataConnectionValidationMethod", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "DataConnectionValidationMethod", result.Response(), "Failure sending request") return } @@ -266,6 +267,7 @@ func (client DataConnectionsClient) DataConnectionValidationMethodPreparer(ctx c // http.Response Body if it receives an error. func (client DataConnectionsClient) DataConnectionValidationMethodSender(req *http.Request) (future DataConnectionsDataConnectionValidationMethodFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -314,7 +316,7 @@ func (client DataConnectionsClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", result.Response(), "Failure sending request") return } @@ -348,6 +350,7 @@ func (client DataConnectionsClient) DeletePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) DeleteSender(req *http.Request) (future DataConnectionsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -554,7 +557,7 @@ func (client DataConnectionsClient) Update(ctx context.Context, resourceGroupNam result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", result.Response(), "Failure sending request") return } @@ -590,6 +593,7 @@ func (client DataConnectionsClient) UpdatePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) UpdateSender(req *http.Request) (future DataConnectionsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -607,7 +611,7 @@ func (client DataConnectionsClient) UpdateResponder(resp *http.Response) (result err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2020-09-18/kusto/CHANGELOG.md b/services/kusto/mgmt/2020-09-18/kusto/CHANGELOG.md index 997ce8b01855..a1ecf841edb0 100644 --- a/services/kusto/mgmt/2020-09-18/kusto/CHANGELOG.md +++ b/services/kusto/mgmt/2020-09-18/kusto/CHANGELOG.md @@ -1,12 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. AzureEntityResource.MarshalJSON() ([]byte, error) -1. IdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. SkuDescription.MarshalJSON() ([]byte, error) -1. SkuDescriptionList.MarshalJSON() ([]byte, error) diff --git a/services/kusto/mgmt/2020-09-18/kusto/_meta.json b/services/kusto/mgmt/2020-09-18/kusto/_meta.json index b96297ade5be..4a9b475cb9fc 100644 --- a/services/kusto/mgmt/2020-09-18/kusto/_meta.json +++ b/services/kusto/mgmt/2020-09-18/kusto/_meta.json @@ -1,10 +1,10 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "57e4490a06aad262ca9154dc15b40f5a11bf7af5", "readme": "/_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "tag": "package-2020-09-18", - "use": "@microsoft.azure/autorest.go@2.1.183", + "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.183 --tag=package-2020-09-18 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2020-09-18 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/services/kusto/mgmt/2020-09-18/kusto/attacheddatabaseconfigurations.go b/services/kusto/mgmt/2020-09-18/kusto/attacheddatabaseconfigurations.go index 0929d9fd14c5..9e870a67d80a 100644 --- a/services/kusto/mgmt/2020-09-18/kusto/attacheddatabaseconfigurations.go +++ b/services/kusto/mgmt/2020-09-18/kusto/attacheddatabaseconfigurations.go @@ -68,7 +68,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdate(ctx context.Co result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -103,6 +103,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdatePreparer(ctx co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future AttachedDatabaseConfigurationsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -150,7 +151,7 @@ func (client AttachedDatabaseConfigurationsClient) Delete(ctx context.Context, r result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", result.Response(), "Failure sending request") return } @@ -183,6 +184,7 @@ func (client AttachedDatabaseConfigurationsClient) DeletePreparer(ctx context.Co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) DeleteSender(req *http.Request) (future AttachedDatabaseConfigurationsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-09-18/kusto/clusterprincipalassignments.go b/services/kusto/mgmt/2020-09-18/kusto/clusterprincipalassignments.go index e070ea1cafb7..e06b6452dc43 100644 --- a/services/kusto/mgmt/2020-09-18/kusto/clusterprincipalassignments.go +++ b/services/kusto/mgmt/2020-09-18/kusto/clusterprincipalassignments.go @@ -152,7 +152,7 @@ func (client ClusterPrincipalAssignmentsClient) CreateOrUpdate(ctx context.Conte result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -187,6 +187,7 @@ func (client ClusterPrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx conte // http.Response Body if it receives an error. func (client ClusterPrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future ClusterPrincipalAssignmentsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -234,7 +235,7 @@ func (client ClusterPrincipalAssignmentsClient) Delete(ctx context.Context, reso result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") return } @@ -267,6 +268,7 @@ func (client ClusterPrincipalAssignmentsClient) DeletePreparer(ctx context.Conte // http.Response Body if it receives an error. func (client ClusterPrincipalAssignmentsClient) DeleteSender(req *http.Request) (future ClusterPrincipalAssignmentsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-09-18/kusto/clusters.go b/services/kusto/mgmt/2020-09-18/kusto/clusters.go index ba5df01b34e4..eca5f1ecdf1c 100644 --- a/services/kusto/mgmt/2020-09-18/kusto/clusters.go +++ b/services/kusto/mgmt/2020-09-18/kusto/clusters.go @@ -57,7 +57,7 @@ func (client ClustersClient) AddLanguageExtensions(ctx context.Context, resource result, err = client.AddLanguageExtensionsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "AddLanguageExtensions", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "AddLanguageExtensions", result.Response(), "Failure sending request") return } @@ -91,6 +91,7 @@ func (client ClustersClient) AddLanguageExtensionsPreparer(ctx context.Context, // http.Response Body if it receives an error. func (client ClustersClient) AddLanguageExtensionsSender(req *http.Request) (future ClustersAddLanguageExtensionsFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -244,7 +245,7 @@ func (client ClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -278,6 +279,7 @@ func (client ClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourc // http.Response Body if it receives an error. func (client ClustersClient) CreateOrUpdateSender(req *http.Request) (future ClustersCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -324,7 +326,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", result.Response(), "Failure sending request") return } @@ -356,6 +358,7 @@ func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -409,7 +412,7 @@ func (client ClustersClient) DetachFollowerDatabases(ctx context.Context, resour result, err = client.DetachFollowerDatabasesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", result.Response(), "Failure sending request") return } @@ -444,6 +447,7 @@ func (client ClustersClient) DetachFollowerDatabasesPreparer(ctx context.Context // http.Response Body if it receives an error. func (client ClustersClient) DetachFollowerDatabasesSender(req *http.Request) (future ClustersDetachFollowerDatabasesFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -490,7 +494,7 @@ func (client ClustersClient) DiagnoseVirtualNetwork(ctx context.Context, resourc result, err = client.DiagnoseVirtualNetworkSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", result.Response(), "Failure sending request") return } @@ -522,6 +526,7 @@ func (client ClustersClient) DiagnoseVirtualNetworkPreparer(ctx context.Context, // http.Response Body if it receives an error. func (client ClustersClient) DiagnoseVirtualNetworkSender(req *http.Request) (future ClustersDiagnoseVirtualNetworkFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1090,7 +1095,7 @@ func (client ClustersClient) RemoveLanguageExtensions(ctx context.Context, resou result, err = client.RemoveLanguageExtensionsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "RemoveLanguageExtensions", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "RemoveLanguageExtensions", result.Response(), "Failure sending request") return } @@ -1124,6 +1129,7 @@ func (client ClustersClient) RemoveLanguageExtensionsPreparer(ctx context.Contex // http.Response Body if it receives an error. func (client ClustersClient) RemoveLanguageExtensionsSender(req *http.Request) (future ClustersRemoveLanguageExtensionsFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1169,7 +1175,7 @@ func (client ClustersClient) Start(ctx context.Context, resourceGroupName string result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", result.Response(), "Failure sending request") return } @@ -1201,6 +1207,7 @@ func (client ClustersClient) StartPreparer(ctx context.Context, resourceGroupNam // http.Response Body if it receives an error. func (client ClustersClient) StartSender(req *http.Request) (future ClustersStartFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1246,7 +1253,7 @@ func (client ClustersClient) Stop(ctx context.Context, resourceGroupName string, result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", result.Response(), "Failure sending request") return } @@ -1278,6 +1285,7 @@ func (client ClustersClient) StopPreparer(ctx context.Context, resourceGroupName // http.Response Body if it receives an error. func (client ClustersClient) StopSender(req *http.Request) (future ClustersStopFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1324,7 +1332,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", result.Response(), "Failure sending request") return } @@ -1358,6 +1366,7 @@ func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-09-18/kusto/databaseprincipalassignments.go b/services/kusto/mgmt/2020-09-18/kusto/databaseprincipalassignments.go index 75285a6c45bc..a6cf3d977621 100644 --- a/services/kusto/mgmt/2020-09-18/kusto/databaseprincipalassignments.go +++ b/services/kusto/mgmt/2020-09-18/kusto/databaseprincipalassignments.go @@ -155,7 +155,7 @@ func (client DatabasePrincipalAssignmentsClient) CreateOrUpdate(ctx context.Cont result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -191,6 +191,7 @@ func (client DatabasePrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx cont // http.Response Body if it receives an error. func (client DatabasePrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future DatabasePrincipalAssignmentsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -239,7 +240,7 @@ func (client DatabasePrincipalAssignmentsClient) Delete(ctx context.Context, res result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") return } @@ -273,6 +274,7 @@ func (client DatabasePrincipalAssignmentsClient) DeletePreparer(ctx context.Cont // http.Response Body if it receives an error. func (client DatabasePrincipalAssignmentsClient) DeleteSender(req *http.Request) (future DatabasePrincipalAssignmentsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2020-09-18/kusto/databases.go b/services/kusto/mgmt/2020-09-18/kusto/databases.go index 61d2f8f09b5d..6114c0ec05e9 100644 --- a/services/kusto/mgmt/2020-09-18/kusto/databases.go +++ b/services/kusto/mgmt/2020-09-18/kusto/databases.go @@ -224,7 +224,7 @@ func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -259,6 +259,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour // http.Response Body if it receives an error. func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -276,7 +277,7 @@ func (client DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (resu err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -306,7 +307,7 @@ func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", result.Response(), "Failure sending request") return } @@ -339,6 +340,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -699,7 +701,7 @@ func (client DatabasesClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", result.Response(), "Failure sending request") return } @@ -734,6 +736,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) UpdateSender(req *http.Request) (future DatabasesUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -751,7 +754,7 @@ func (client DatabasesClient) UpdateResponder(resp *http.Response) (result Datab err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2020-09-18/kusto/dataconnections.go b/services/kusto/mgmt/2020-09-18/kusto/dataconnections.go index a5c870698b0e..d274303a2700 100644 --- a/services/kusto/mgmt/2020-09-18/kusto/dataconnections.go +++ b/services/kusto/mgmt/2020-09-18/kusto/dataconnections.go @@ -147,7 +147,7 @@ func (client DataConnectionsClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -183,6 +183,7 @@ func (client DataConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, // http.Response Body if it receives an error. func (client DataConnectionsClient) CreateOrUpdateSender(req *http.Request) (future DataConnectionsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -200,7 +201,7 @@ func (client DataConnectionsClient) CreateOrUpdateResponder(resp *http.Response) err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -231,7 +232,7 @@ func (client DataConnectionsClient) DataConnectionValidationMethod(ctx context.C result, err = client.DataConnectionValidationMethodSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "DataConnectionValidationMethod", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "DataConnectionValidationMethod", result.Response(), "Failure sending request") return } @@ -266,6 +267,7 @@ func (client DataConnectionsClient) DataConnectionValidationMethodPreparer(ctx c // http.Response Body if it receives an error. func (client DataConnectionsClient) DataConnectionValidationMethodSender(req *http.Request) (future DataConnectionsDataConnectionValidationMethodFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -314,7 +316,7 @@ func (client DataConnectionsClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", result.Response(), "Failure sending request") return } @@ -348,6 +350,7 @@ func (client DataConnectionsClient) DeletePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) DeleteSender(req *http.Request) (future DataConnectionsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -554,7 +557,7 @@ func (client DataConnectionsClient) Update(ctx context.Context, resourceGroupNam result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", result.Response(), "Failure sending request") return } @@ -590,6 +593,7 @@ func (client DataConnectionsClient) UpdatePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) UpdateSender(req *http.Request) (future DataConnectionsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -607,7 +611,7 @@ func (client DataConnectionsClient) UpdateResponder(resp *http.Response) (result err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2021-01-01/kusto/CHANGELOG.md b/services/kusto/mgmt/2021-01-01/kusto/CHANGELOG.md index 2e08442824ce..a1ecf841edb0 100644 --- a/services/kusto/mgmt/2021-01-01/kusto/CHANGELOG.md +++ b/services/kusto/mgmt/2021-01-01/kusto/CHANGELOG.md @@ -1,26 +1,2 @@ -# Change History +# Unreleased -## Breaking Changes - -### Removed Constants - -1. Kind.KindKindDatabase -1. Kind.KindKindReadOnlyFollowing -1. Kind.KindKindReadWrite - -## Additive Changes - -### New Constants - -1. Kind.KindDatabase -1. Kind.KindReadOnlyFollowing -1. Kind.KindReadWrite - -### New Funcs - -1. AzureEntityResource.MarshalJSON() ([]byte, error) -1. IdentityUserAssignedIdentitiesValue.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. SkuDescription.MarshalJSON() ([]byte, error) -1. SkuDescriptionList.MarshalJSON() ([]byte, error) diff --git a/services/kusto/mgmt/2021-01-01/kusto/_meta.json b/services/kusto/mgmt/2021-01-01/kusto/_meta.json index 4364ef4f5d62..e5d4aa8cc0ef 100644 --- a/services/kusto/mgmt/2021-01-01/kusto/_meta.json +++ b/services/kusto/mgmt/2021-01-01/kusto/_meta.json @@ -1,10 +1,10 @@ { - "commit": "e5839301dfd424559851119c99ef0a2699fbd228", + "commit": "57e4490a06aad262ca9154dc15b40f5a11bf7af5", "readme": "/_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "tag": "package-2021-01", - "use": "@microsoft.azure/autorest.go@2.1.183", + "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.183 --tag=package-2021-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" } diff --git a/services/kusto/mgmt/2021-01-01/kusto/attacheddatabaseconfigurations.go b/services/kusto/mgmt/2021-01-01/kusto/attacheddatabaseconfigurations.go index 8e204cbc6522..685c24f52d5b 100644 --- a/services/kusto/mgmt/2021-01-01/kusto/attacheddatabaseconfigurations.go +++ b/services/kusto/mgmt/2021-01-01/kusto/attacheddatabaseconfigurations.go @@ -68,7 +68,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdate(ctx context.Co result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -103,6 +103,7 @@ func (client AttachedDatabaseConfigurationsClient) CreateOrUpdatePreparer(ctx co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future AttachedDatabaseConfigurationsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -150,7 +151,7 @@ func (client AttachedDatabaseConfigurationsClient) Delete(ctx context.Context, r result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", result.Response(), "Failure sending request") return } @@ -183,6 +184,7 @@ func (client AttachedDatabaseConfigurationsClient) DeletePreparer(ctx context.Co // http.Response Body if it receives an error. func (client AttachedDatabaseConfigurationsClient) DeleteSender(req *http.Request) (future AttachedDatabaseConfigurationsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2021-01-01/kusto/clusterprincipalassignments.go b/services/kusto/mgmt/2021-01-01/kusto/clusterprincipalassignments.go index 76866e01635e..f694d435cee7 100644 --- a/services/kusto/mgmt/2021-01-01/kusto/clusterprincipalassignments.go +++ b/services/kusto/mgmt/2021-01-01/kusto/clusterprincipalassignments.go @@ -152,7 +152,7 @@ func (client ClusterPrincipalAssignmentsClient) CreateOrUpdate(ctx context.Conte result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -187,6 +187,7 @@ func (client ClusterPrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx conte // http.Response Body if it receives an error. func (client ClusterPrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future ClusterPrincipalAssignmentsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -234,7 +235,7 @@ func (client ClusterPrincipalAssignmentsClient) Delete(ctx context.Context, reso result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") return } @@ -267,6 +268,7 @@ func (client ClusterPrincipalAssignmentsClient) DeletePreparer(ctx context.Conte // http.Response Body if it receives an error. func (client ClusterPrincipalAssignmentsClient) DeleteSender(req *http.Request) (future ClusterPrincipalAssignmentsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2021-01-01/kusto/clusters.go b/services/kusto/mgmt/2021-01-01/kusto/clusters.go index 024bf2571dd5..654e53d67715 100644 --- a/services/kusto/mgmt/2021-01-01/kusto/clusters.go +++ b/services/kusto/mgmt/2021-01-01/kusto/clusters.go @@ -57,7 +57,7 @@ func (client ClustersClient) AddLanguageExtensions(ctx context.Context, resource result, err = client.AddLanguageExtensionsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "AddLanguageExtensions", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "AddLanguageExtensions", result.Response(), "Failure sending request") return } @@ -91,6 +91,7 @@ func (client ClustersClient) AddLanguageExtensionsPreparer(ctx context.Context, // http.Response Body if it receives an error. func (client ClustersClient) AddLanguageExtensionsSender(req *http.Request) (future ClustersAddLanguageExtensionsFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -248,7 +249,7 @@ func (client ClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -291,6 +292,7 @@ func (client ClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourc // http.Response Body if it receives an error. func (client ClustersClient) CreateOrUpdateSender(req *http.Request) (future ClustersCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -337,7 +339,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", result.Response(), "Failure sending request") return } @@ -369,6 +371,7 @@ func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -422,7 +425,7 @@ func (client ClustersClient) DetachFollowerDatabases(ctx context.Context, resour result, err = client.DetachFollowerDatabasesSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", result.Response(), "Failure sending request") return } @@ -457,6 +460,7 @@ func (client ClustersClient) DetachFollowerDatabasesPreparer(ctx context.Context // http.Response Body if it receives an error. func (client ClustersClient) DetachFollowerDatabasesSender(req *http.Request) (future ClustersDetachFollowerDatabasesFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -503,7 +507,7 @@ func (client ClustersClient) DiagnoseVirtualNetwork(ctx context.Context, resourc result, err = client.DiagnoseVirtualNetworkSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", result.Response(), "Failure sending request") return } @@ -535,6 +539,7 @@ func (client ClustersClient) DiagnoseVirtualNetworkPreparer(ctx context.Context, // http.Response Body if it receives an error. func (client ClustersClient) DiagnoseVirtualNetworkSender(req *http.Request) (future ClustersDiagnoseVirtualNetworkFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1103,7 +1108,7 @@ func (client ClustersClient) RemoveLanguageExtensions(ctx context.Context, resou result, err = client.RemoveLanguageExtensionsSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "RemoveLanguageExtensions", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "RemoveLanguageExtensions", result.Response(), "Failure sending request") return } @@ -1137,6 +1142,7 @@ func (client ClustersClient) RemoveLanguageExtensionsPreparer(ctx context.Contex // http.Response Body if it receives an error. func (client ClustersClient) RemoveLanguageExtensionsSender(req *http.Request) (future ClustersRemoveLanguageExtensionsFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1182,7 +1188,7 @@ func (client ClustersClient) Start(ctx context.Context, resourceGroupName string result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", result.Response(), "Failure sending request") return } @@ -1214,6 +1220,7 @@ func (client ClustersClient) StartPreparer(ctx context.Context, resourceGroupNam // http.Response Body if it receives an error. func (client ClustersClient) StartSender(req *http.Request) (future ClustersStartFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1259,7 +1266,7 @@ func (client ClustersClient) Stop(ctx context.Context, resourceGroupName string, result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", result.Response(), "Failure sending request") return } @@ -1291,6 +1298,7 @@ func (client ClustersClient) StopPreparer(ctx context.Context, resourceGroupName // http.Response Body if it receives an error. func (client ClustersClient) StopSender(req *http.Request) (future ClustersStopFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -1339,7 +1347,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", result.Response(), "Failure sending request") return } @@ -1377,6 +1385,7 @@ func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2021-01-01/kusto/databaseprincipalassignments.go b/services/kusto/mgmt/2021-01-01/kusto/databaseprincipalassignments.go index 27402ab1e689..8efb42c1775d 100644 --- a/services/kusto/mgmt/2021-01-01/kusto/databaseprincipalassignments.go +++ b/services/kusto/mgmt/2021-01-01/kusto/databaseprincipalassignments.go @@ -155,7 +155,7 @@ func (client DatabasePrincipalAssignmentsClient) CreateOrUpdate(ctx context.Cont result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -191,6 +191,7 @@ func (client DatabasePrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx cont // http.Response Body if it receives an error. func (client DatabasePrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future DatabasePrincipalAssignmentsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -239,7 +240,7 @@ func (client DatabasePrincipalAssignmentsClient) Delete(ctx context.Context, res result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") return } @@ -273,6 +274,7 @@ func (client DatabasePrincipalAssignmentsClient) DeletePreparer(ctx context.Cont // http.Response Body if it receives an error. func (client DatabasePrincipalAssignmentsClient) DeleteSender(req *http.Request) (future DatabasePrincipalAssignmentsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2021-01-01/kusto/databases.go b/services/kusto/mgmt/2021-01-01/kusto/databases.go index 6f38b9f98086..331b8e4c818e 100644 --- a/services/kusto/mgmt/2021-01-01/kusto/databases.go +++ b/services/kusto/mgmt/2021-01-01/kusto/databases.go @@ -224,7 +224,7 @@ func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -259,6 +259,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour // http.Response Body if it receives an error. func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -276,7 +277,7 @@ func (client DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (resu err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -306,7 +307,7 @@ func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", result.Response(), "Failure sending request") return } @@ -339,6 +340,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -699,7 +701,7 @@ func (client DatabasesClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", result.Response(), "Failure sending request") return } @@ -734,6 +736,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) UpdateSender(req *http.Request) (future DatabasesUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -751,7 +754,7 @@ func (client DatabasesClient) UpdateResponder(resp *http.Response) (result Datab err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2021-01-01/kusto/dataconnections.go b/services/kusto/mgmt/2021-01-01/kusto/dataconnections.go index 7ec3626dbfb4..27b0fe6e00b7 100644 --- a/services/kusto/mgmt/2021-01-01/kusto/dataconnections.go +++ b/services/kusto/mgmt/2021-01-01/kusto/dataconnections.go @@ -147,7 +147,7 @@ func (client DataConnectionsClient) CreateOrUpdate(ctx context.Context, resource result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -183,6 +183,7 @@ func (client DataConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, // http.Response Body if it receives an error. func (client DataConnectionsClient) CreateOrUpdateSender(req *http.Request) (future DataConnectionsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -200,7 +201,7 @@ func (client DataConnectionsClient) CreateOrUpdateResponder(resp *http.Response) err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return @@ -231,7 +232,7 @@ func (client DataConnectionsClient) DataConnectionValidationMethod(ctx context.C result, err = client.DataConnectionValidationMethodSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "DataConnectionValidationMethod", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "DataConnectionValidationMethod", result.Response(), "Failure sending request") return } @@ -266,6 +267,7 @@ func (client DataConnectionsClient) DataConnectionValidationMethodPreparer(ctx c // http.Response Body if it receives an error. func (client DataConnectionsClient) DataConnectionValidationMethodSender(req *http.Request) (future DataConnectionsDataConnectionValidationMethodFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -314,7 +316,7 @@ func (client DataConnectionsClient) Delete(ctx context.Context, resourceGroupNam result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", result.Response(), "Failure sending request") return } @@ -348,6 +350,7 @@ func (client DataConnectionsClient) DeletePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) DeleteSender(req *http.Request) (future DataConnectionsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -554,7 +557,7 @@ func (client DataConnectionsClient) Update(ctx context.Context, resourceGroupNam result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", result.Response(), "Failure sending request") return } @@ -590,6 +593,7 @@ func (client DataConnectionsClient) UpdatePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client DataConnectionsClient) UpdateSender(req *http.Request) (future DataConnectionsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -607,7 +611,7 @@ func (client DataConnectionsClient) UpdateResponder(resp *http.Response) (result err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), + autorest.ByUnmarshallingJSON(&result.Value), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/services/kusto/mgmt/2021-01-01/kusto/scripts.go b/services/kusto/mgmt/2021-01-01/kusto/scripts.go index e2dfa0a3cad5..84a8d4d2839a 100644 --- a/services/kusto/mgmt/2021-01-01/kusto/scripts.go +++ b/services/kusto/mgmt/2021-01-01/kusto/scripts.go @@ -156,7 +156,7 @@ func (client ScriptsClient) CreateOrUpdate(ctx context.Context, resourceGroupNam result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -193,6 +193,7 @@ func (client ScriptsClient) CreateOrUpdatePreparer(ctx context.Context, resource // http.Response Body if it receives an error. func (client ScriptsClient) CreateOrUpdateSender(req *http.Request) (future ScriptsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -241,7 +242,7 @@ func (client ScriptsClient) Delete(ctx context.Context, resourceGroupName string result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "Delete", result.Response(), "Failure sending request") return } @@ -275,6 +276,7 @@ func (client ScriptsClient) DeletePreparer(ctx context.Context, resourceGroupNam // http.Response Body if it receives an error. func (client ScriptsClient) DeleteSender(req *http.Request) (future ScriptsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -481,7 +483,7 @@ func (client ScriptsClient) Update(ctx context.Context, resourceGroupName string result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "Update", result.Response(), "Failure sending request") return } @@ -518,6 +520,7 @@ func (client ScriptsClient) UpdatePreparer(ctx context.Context, resourceGroupNam // http.Response Body if it receives an error. func (client ScriptsClient) UpdateSender(req *http.Request) (future ScriptsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/kusto/mgmt/2021-08-27/kusto/CHANGELOG.md b/services/kusto/mgmt/2021-08-27/kusto/CHANGELOG.md new file mode 100644 index 000000000000..a1ecf841edb0 --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/CHANGELOG.md @@ -0,0 +1,2 @@ +# Unreleased + diff --git a/services/kusto/mgmt/2021-08-27/kusto/_meta.json b/services/kusto/mgmt/2021-08-27/kusto/_meta.json new file mode 100644 index 000000000000..3450a63e9c2f --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "57e4490a06aad262ca9154dc15b40f5a11bf7af5", + "readme": "/_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", + "tag": "package-2021-08-27", + "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-2021-08-27 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" + } +} \ No newline at end of file diff --git a/services/kusto/mgmt/2021-08-27/kusto/attacheddatabaseconfigurations.go b/services/kusto/mgmt/2021-08-27/kusto/attacheddatabaseconfigurations.go new file mode 100644 index 000000000000..af9da01d7883 --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/attacheddatabaseconfigurations.go @@ -0,0 +1,449 @@ +package kusto + +// 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" +) + +// AttachedDatabaseConfigurationsClient is the the Azure Kusto management API provides a RESTful set of web services +// that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, +// update, and delete clusters and databases. +type AttachedDatabaseConfigurationsClient struct { + BaseClient +} + +// NewAttachedDatabaseConfigurationsClient creates an instance of the AttachedDatabaseConfigurationsClient client. +func NewAttachedDatabaseConfigurationsClient(subscriptionID string) AttachedDatabaseConfigurationsClient { + return NewAttachedDatabaseConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAttachedDatabaseConfigurationsClientWithBaseURI creates an instance of the AttachedDatabaseConfigurationsClient +// 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 NewAttachedDatabaseConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) AttachedDatabaseConfigurationsClient { + return AttachedDatabaseConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks that the attached database configuration resource name is valid and is not already in +// use. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// resourceName - the name of the resource. +func (client AttachedDatabaseConfigurationsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, resourceName AttachedDatabaseConfigurationsCheckNameRequest) (result CheckNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AttachedDatabaseConfigurationsClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "resourceName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.AttachedDatabaseConfigurationsClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, resourceGroupName, clusterName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client AttachedDatabaseConfigurationsClient) CheckNameAvailabilityPreparer(ctx context.Context, resourceGroupName string, clusterName string, resourceName AttachedDatabaseConfigurationsCheckNameRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurationCheckNameAvailability", pathParameters), + autorest.WithJSON(resourceName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client AttachedDatabaseConfigurationsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client AttachedDatabaseConfigurationsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate creates or updates an attached database configuration. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// attachedDatabaseConfigurationName - the name of the attached database configuration. +// parameters - the database parameters supplied to the CreateOrUpdate operation. +func (client AttachedDatabaseConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string, parameters AttachedDatabaseConfiguration) (result AttachedDatabaseConfigurationsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AttachedDatabaseConfigurationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.AttachedDatabaseConfigurationProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AttachedDatabaseConfigurationProperties.DatabaseName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AttachedDatabaseConfigurationProperties.ClusterResourceID", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AttachedDatabaseConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string, parameters AttachedDatabaseConfiguration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "attachedDatabaseConfigurationName": autorest.Encode("path", attachedDatabaseConfigurationName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AttachedDatabaseConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future AttachedDatabaseConfigurationsCreateOrUpdateFuture, 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 AttachedDatabaseConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result AttachedDatabaseConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the attached database configuration with the given name. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// attachedDatabaseConfigurationName - the name of the attached database configuration. +func (client AttachedDatabaseConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (result AttachedDatabaseConfigurationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AttachedDatabaseConfigurationsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, attachedDatabaseConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AttachedDatabaseConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "attachedDatabaseConfigurationName": autorest.Encode("path", attachedDatabaseConfigurationName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", 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 AttachedDatabaseConfigurationsClient) DeleteSender(req *http.Request) (future AttachedDatabaseConfigurationsDeleteFuture, 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 AttachedDatabaseConfigurationsClient) 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 returns an attached database configuration. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// attachedDatabaseConfigurationName - the name of the attached database configuration. +func (client AttachedDatabaseConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (result AttachedDatabaseConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AttachedDatabaseConfigurationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, attachedDatabaseConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AttachedDatabaseConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "attachedDatabaseConfigurationName": autorest.Encode("path", attachedDatabaseConfigurationName), + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", 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 AttachedDatabaseConfigurationsClient) 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 AttachedDatabaseConfigurationsClient) GetResponder(resp *http.Response) (result AttachedDatabaseConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByCluster returns the list of attached database configurations of the given Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client AttachedDatabaseConfigurationsClient) ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result AttachedDatabaseConfigurationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AttachedDatabaseConfigurationsClient.ListByCluster") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByClusterPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "ListByCluster", nil, "Failure preparing request") + return + } + + resp, err := client.ListByClusterSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "ListByCluster", resp, "Failure sending request") + return + } + + result, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsClient", "ListByCluster", resp, "Failure responding to request") + return + } + + return +} + +// ListByClusterPreparer prepares the ListByCluster request. +func (client AttachedDatabaseConfigurationsClient) ListByClusterPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByClusterSender sends the ListByCluster request. The method will close the +// http.Response Body if it receives an error. +func (client AttachedDatabaseConfigurationsClient) ListByClusterSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByClusterResponder handles the response to the ListByCluster request. The method always +// closes the http.Response Body. +func (client AttachedDatabaseConfigurationsClient) ListByClusterResponder(resp *http.Response) (result AttachedDatabaseConfigurationListResult, 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/services/kusto/mgmt/2021-08-27/kusto/client.go b/services/kusto/mgmt/2021-08-27/kusto/client.go new file mode 100644 index 000000000000..01afe5762990 --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/client.go @@ -0,0 +1,42 @@ +// Package kusto implements the Azure ARM Kusto service API version 2021-08-27. +// +// The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to +// manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. +package kusto + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Kusto + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Kusto. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/kusto/mgmt/2021-08-27/kusto/clusterprincipalassignments.go b/services/kusto/mgmt/2021-08-27/kusto/clusterprincipalassignments.go new file mode 100644 index 000000000000..30661bbda56e --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/clusterprincipalassignments.go @@ -0,0 +1,446 @@ +package kusto + +// 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" +) + +// ClusterPrincipalAssignmentsClient is the the Azure Kusto management API provides a RESTful set of web services that +// interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and +// delete clusters and databases. +type ClusterPrincipalAssignmentsClient struct { + BaseClient +} + +// NewClusterPrincipalAssignmentsClient creates an instance of the ClusterPrincipalAssignmentsClient client. +func NewClusterPrincipalAssignmentsClient(subscriptionID string) ClusterPrincipalAssignmentsClient { + return NewClusterPrincipalAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewClusterPrincipalAssignmentsClientWithBaseURI creates an instance of the ClusterPrincipalAssignmentsClient 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 NewClusterPrincipalAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) ClusterPrincipalAssignmentsClient { + return ClusterPrincipalAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks that the principal assignment name is valid and is not already in use. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// principalAssignmentName - the name of the principal assignment. +func (client ClusterPrincipalAssignmentsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName ClusterPrincipalAssignmentCheckNameRequest) (result CheckNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClusterPrincipalAssignmentsClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: principalAssignmentName, + Constraints: []validation.Constraint{{Target: "principalAssignmentName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "principalAssignmentName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.ClusterPrincipalAssignmentsClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, resourceGroupName, clusterName, principalAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client ClusterPrincipalAssignmentsClient) CheckNameAvailabilityPreparer(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName ClusterPrincipalAssignmentCheckNameRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability", pathParameters), + autorest.WithJSON(principalAssignmentName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client ClusterPrincipalAssignmentsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client ClusterPrincipalAssignmentsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate create a Kusto cluster principalAssignment. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// principalAssignmentName - the name of the Kusto principalAssignment. +// parameters - the Kusto cluster principalAssignment's parameters supplied for the operation. +func (client ClusterPrincipalAssignmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string, parameters ClusterPrincipalAssignment) (result ClusterPrincipalAssignmentsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClusterPrincipalAssignmentsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ClusterPrincipalProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterPrincipalProperties.PrincipalID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, principalAssignmentName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ClusterPrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string, parameters ClusterPrincipalAssignment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "principalAssignmentName": autorest.Encode("path", principalAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ClusterPrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future ClusterPrincipalAssignmentsCreateOrUpdateFuture, 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 ClusterPrincipalAssignmentsClient) CreateOrUpdateResponder(resp *http.Response) (result ClusterPrincipalAssignment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Kusto cluster principalAssignment. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// principalAssignmentName - the name of the Kusto principalAssignment. +func (client ClusterPrincipalAssignmentsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string) (result ClusterPrincipalAssignmentsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClusterPrincipalAssignmentsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, principalAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ClusterPrincipalAssignmentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "principalAssignmentName": autorest.Encode("path", principalAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}", 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 ClusterPrincipalAssignmentsClient) DeleteSender(req *http.Request) (future ClusterPrincipalAssignmentsDeleteFuture, 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 ClusterPrincipalAssignmentsClient) 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 gets a Kusto cluster principalAssignment. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// principalAssignmentName - the name of the Kusto principalAssignment. +func (client ClusterPrincipalAssignmentsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string) (result ClusterPrincipalAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClusterPrincipalAssignmentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, principalAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ClusterPrincipalAssignmentsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "principalAssignmentName": autorest.Encode("path", principalAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}", 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 ClusterPrincipalAssignmentsClient) 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 ClusterPrincipalAssignmentsClient) GetResponder(resp *http.Response) (result ClusterPrincipalAssignment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all Kusto cluster principalAssignments. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClusterPrincipalAssignmentsClient) List(ctx context.Context, resourceGroupName string, clusterName string) (result ClusterPrincipalAssignmentListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClusterPrincipalAssignmentsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ClusterPrincipalAssignmentsClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments", 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 ClusterPrincipalAssignmentsClient) 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 ClusterPrincipalAssignmentsClient) ListResponder(resp *http.Response) (result ClusterPrincipalAssignmentListResult, 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/services/kusto/mgmt/2021-08-27/kusto/clusters.go b/services/kusto/mgmt/2021-08-27/kusto/clusters.go new file mode 100644 index 000000000000..bfc46d3fbfa0 --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/clusters.go @@ -0,0 +1,1525 @@ +package kusto + +// 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" +) + +// ClustersClient is the the Azure Kusto management API provides a RESTful set of web services that interact with Azure +// Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and +// databases. +type ClustersClient struct { + BaseClient +} + +// NewClustersClient creates an instance of the ClustersClient client. +func NewClustersClient(subscriptionID string) ClustersClient { + return NewClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewClustersClientWithBaseURI creates an instance of the ClustersClient 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 NewClustersClientWithBaseURI(baseURI string, subscriptionID string) ClustersClient { + return ClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// AddLanguageExtensions add a list of language extensions that can run within KQL queries. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// languageExtensionsToAdd - the language extensions to add. +func (client ClustersClient) AddLanguageExtensions(ctx context.Context, resourceGroupName string, clusterName string, languageExtensionsToAdd LanguageExtensionsList) (result ClustersAddLanguageExtensionsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.AddLanguageExtensions") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddLanguageExtensionsPreparer(ctx, resourceGroupName, clusterName, languageExtensionsToAdd) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "AddLanguageExtensions", nil, "Failure preparing request") + return + } + + result, err = client.AddLanguageExtensionsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "AddLanguageExtensions", result.Response(), "Failure sending request") + return + } + + return +} + +// AddLanguageExtensionsPreparer prepares the AddLanguageExtensions request. +func (client ClustersClient) AddLanguageExtensionsPreparer(ctx context.Context, resourceGroupName string, clusterName string, languageExtensionsToAdd LanguageExtensionsList) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions", pathParameters), + autorest.WithJSON(languageExtensionsToAdd), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddLanguageExtensionsSender sends the AddLanguageExtensions request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) AddLanguageExtensionsSender(req *http.Request) (future ClustersAddLanguageExtensionsFuture, 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 +} + +// AddLanguageExtensionsResponder handles the response to the AddLanguageExtensions request. The method always +// closes the http.Response Body. +func (client ClustersClient) AddLanguageExtensionsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// CheckNameAvailability checks that the cluster name is valid and is not already in use. +// Parameters: +// location - azure location (region) name. +// clusterName - the name of the cluster. +func (client ClustersClient) CheckNameAvailability(ctx context.Context, location string, clusterName ClusterCheckNameRequest) (result CheckNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "clusterName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.ClustersClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, location, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client ClustersClient) CheckNameAvailabilityPreparer(ctx context.Context, location string, clusterName ClusterCheckNameRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability", pathParameters), + autorest.WithJSON(clusterName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client ClustersClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate create or update a Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// parameters - the Kusto cluster parameters supplied to the CreateOrUpdate operation. +// ifMatch - the ETag of the cluster. Omit this value to always overwrite the current cluster. Specify the +// last-seen ETag value to prevent accidentally overwriting concurrent changes. +// ifNoneMatch - set to '*' to allow a new cluster to be created, but to prevent updating an existing cluster. +// Other values will result in a 412 Pre-condition Failed response. +func (client ClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, ifMatch string, ifNoneMatch string) (result ClustersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.OptimizedAutoscale", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.OptimizedAutoscale.Version", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.OptimizedAutoscale.IsEnabled", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.OptimizedAutoscale.Minimum", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.OptimizedAutoscale.Maximum", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.ClusterProperties.VirtualNetworkConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ClusterProperties.VirtualNetworkConfiguration.SubnetID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.VirtualNetworkConfiguration.EnginePublicIPID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ClusterProperties.VirtualNetworkConfiguration.DataManagementPublicIPID", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("kusto.ClustersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, parameters, ifMatch, ifNoneMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, ifMatch string, ifNoneMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = nil + parameters.Etag = 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.Kusto/clusters/{clusterName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + if len(ifNoneMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch))) + } + 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 ClustersClient) CreateOrUpdateSender(req *http.Request) (future ClustersCreateOrUpdateFuture, 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 ClustersClient) CreateOrUpdateResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string) (result ClustersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}", 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 ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, 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 ClustersClient) 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 +} + +// DetachFollowerDatabases detaches all followers of a database owned by this cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// followerDatabaseToRemove - the follower databases properties to remove. +func (client ClustersClient) DetachFollowerDatabases(ctx context.Context, resourceGroupName string, clusterName string, followerDatabaseToRemove FollowerDatabaseDefinition) (result ClustersDetachFollowerDatabasesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.DetachFollowerDatabases") + 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: followerDatabaseToRemove, + Constraints: []validation.Constraint{{Target: "followerDatabaseToRemove.ClusterResourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "followerDatabaseToRemove.AttachedDatabaseConfigurationName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.ClustersClient", "DetachFollowerDatabases", err.Error()) + } + + req, err := client.DetachFollowerDatabasesPreparer(ctx, resourceGroupName, clusterName, followerDatabaseToRemove) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", nil, "Failure preparing request") + return + } + + result, err = client.DetachFollowerDatabasesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DetachFollowerDatabases", result.Response(), "Failure sending request") + return + } + + return +} + +// DetachFollowerDatabasesPreparer prepares the DetachFollowerDatabases request. +func (client ClustersClient) DetachFollowerDatabasesPreparer(ctx context.Context, resourceGroupName string, clusterName string, followerDatabaseToRemove FollowerDatabaseDefinition) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + followerDatabaseToRemove.DatabaseName = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases", pathParameters), + autorest.WithJSON(followerDatabaseToRemove), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DetachFollowerDatabasesSender sends the DetachFollowerDatabases request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) DetachFollowerDatabasesSender(req *http.Request) (future ClustersDetachFollowerDatabasesFuture, 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 +} + +// DetachFollowerDatabasesResponder handles the response to the DetachFollowerDatabases request. The method always +// closes the http.Response Body. +func (client ClustersClient) DetachFollowerDatabasesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// DiagnoseVirtualNetwork diagnoses network connectivity status for external resources on which the service is +// dependent on. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) DiagnoseVirtualNetwork(ctx context.Context, resourceGroupName string, clusterName string) (result ClustersDiagnoseVirtualNetworkFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.DiagnoseVirtualNetwork") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DiagnoseVirtualNetworkPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", nil, "Failure preparing request") + return + } + + result, err = client.DiagnoseVirtualNetworkSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "DiagnoseVirtualNetwork", result.Response(), "Failure sending request") + return + } + + return +} + +// DiagnoseVirtualNetworkPreparer prepares the DiagnoseVirtualNetwork request. +func (client ClustersClient) DiagnoseVirtualNetworkPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiagnoseVirtualNetworkSender sends the DiagnoseVirtualNetwork request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) DiagnoseVirtualNetworkSender(req *http.Request) (future ClustersDiagnoseVirtualNetworkFuture, 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 +} + +// DiagnoseVirtualNetworkResponder handles the response to the DiagnoseVirtualNetwork request. The method always +// closes the http.Response Body. +func (client ClustersClient) DiagnoseVirtualNetworkResponder(resp *http.Response) (result DiagnoseVirtualNetworkResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets a Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string) (result Cluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}", 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 ClustersClient) 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 ClustersClient) GetResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all Kusto clusters within a subscription. +func (client ClustersClient) List(ctx context.Context) (result ClusterListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters", 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 ClustersClient) 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 ClustersClient) ListResponder(resp *http.Response) (result ClusterListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all Kusto clusters within a resource group. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ClusterListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ClustersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ClusterListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListFollowerDatabases returns a list of databases that are owned by this cluster and were followed by another +// cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) ListFollowerDatabases(ctx context.Context, resourceGroupName string, clusterName string) (result FollowerDatabaseListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListFollowerDatabases") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListFollowerDatabasesPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListFollowerDatabases", nil, "Failure preparing request") + return + } + + resp, err := client.ListFollowerDatabasesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListFollowerDatabases", resp, "Failure sending request") + return + } + + result, err = client.ListFollowerDatabasesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListFollowerDatabases", resp, "Failure responding to request") + return + } + + return +} + +// ListFollowerDatabasesPreparer prepares the ListFollowerDatabases request. +func (client ClustersClient) ListFollowerDatabasesPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFollowerDatabasesSender sends the ListFollowerDatabases request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListFollowerDatabasesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListFollowerDatabasesResponder handles the response to the ListFollowerDatabases request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListFollowerDatabasesResponder(resp *http.Response) (result FollowerDatabaseListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListLanguageExtensions returns a list of language extensions that can run within KQL queries. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) ListLanguageExtensions(ctx context.Context, resourceGroupName string, clusterName string) (result LanguageExtensionsList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListLanguageExtensions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListLanguageExtensionsPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListLanguageExtensions", nil, "Failure preparing request") + return + } + + resp, err := client.ListLanguageExtensionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListLanguageExtensions", resp, "Failure sending request") + return + } + + result, err = client.ListLanguageExtensionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListLanguageExtensions", resp, "Failure responding to request") + return + } + + return +} + +// ListLanguageExtensionsPreparer prepares the ListLanguageExtensions request. +func (client ClustersClient) ListLanguageExtensionsPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListLanguageExtensionsSender sends the ListLanguageExtensions request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListLanguageExtensionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListLanguageExtensionsResponder handles the response to the ListLanguageExtensions request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListLanguageExtensionsResponder(resp *http.Response) (result LanguageExtensionsList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOutboundNetworkDependenciesEndpoints gets the network endpoints of all outbound dependencies of a Kusto cluster +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, clusterName string) (result OutboundNetworkDependenciesEndpointListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListOutboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.ondelr.Response.Response != nil { + sc = result.ondelr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOutboundNetworkDependenciesEndpointsNextResults + req, err := client.ListOutboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") + return + } + + resp, err := client.ListOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.ondelr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListOutboundNetworkDependenciesEndpoints", resp, "Failure sending request") + return + } + + result.ondelr, err = client.ListOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListOutboundNetworkDependenciesEndpoints", resp, "Failure responding to request") + return + } + if result.ondelr.hasNextLink() && result.ondelr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListOutboundNetworkDependenciesEndpointsPreparer prepares the ListOutboundNetworkDependenciesEndpoints request. +func (client ClustersClient) ListOutboundNetworkDependenciesEndpointsPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/outboundNetworkDependenciesEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOutboundNetworkDependenciesEndpointsSender sends the ListOutboundNetworkDependenciesEndpoints request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListOutboundNetworkDependenciesEndpointsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListOutboundNetworkDependenciesEndpointsResponder handles the response to the ListOutboundNetworkDependenciesEndpoints request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result OutboundNetworkDependenciesEndpointListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOutboundNetworkDependenciesEndpointsNextResults retrieves the next set of results, if any. +func (client ClustersClient) listOutboundNetworkDependenciesEndpointsNextResults(ctx context.Context, lastResults OutboundNetworkDependenciesEndpointListResult) (result OutboundNetworkDependenciesEndpointListResult, err error) { + req, err := lastResults.outboundNetworkDependenciesEndpointListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "kusto.ClustersClient", "listOutboundNetworkDependenciesEndpointsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "kusto.ClustersClient", "listOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "listOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOutboundNetworkDependenciesEndpointsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ClustersClient) ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, clusterName string) (result OutboundNetworkDependenciesEndpointListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListOutboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOutboundNetworkDependenciesEndpoints(ctx, resourceGroupName, clusterName) + return +} + +// ListSkus lists eligible SKUs for Kusto resource provider. +func (client ClustersClient) ListSkus(ctx context.Context) (result SkuDescriptionList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListSkus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListSkusPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkus", nil, "Failure preparing request") + return + } + + resp, err := client.ListSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkus", resp, "Failure sending request") + return + } + + result, err = client.ListSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkus", resp, "Failure responding to request") + return + } + + return +} + +// ListSkusPreparer prepares the ListSkus request. +func (client ClustersClient) ListSkusPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSkusSender sends the ListSkus request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListSkusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSkusResponder handles the response to the ListSkus request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListSkusResponder(resp *http.Response) (result SkuDescriptionList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSkusByResource returns the SKUs available for the provided resource. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) ListSkusByResource(ctx context.Context, resourceGroupName string, clusterName string) (result ListResourceSkusResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListSkusByResource") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListSkusByResourcePreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkusByResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListSkusByResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkusByResource", resp, "Failure sending request") + return + } + + result, err = client.ListSkusByResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "ListSkusByResource", resp, "Failure responding to request") + return + } + + return +} + +// ListSkusByResourcePreparer prepares the ListSkusByResource request. +func (client ClustersClient) ListSkusByResourcePreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSkusByResourceSender sends the ListSkusByResource request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) ListSkusByResourceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSkusByResourceResponder handles the response to the ListSkusByResource request. The method always +// closes the http.Response Body. +func (client ClustersClient) ListSkusByResourceResponder(resp *http.Response) (result ListResourceSkusResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RemoveLanguageExtensions remove a list of language extensions that can run within KQL queries. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// languageExtensionsToRemove - the language extensions to remove. +func (client ClustersClient) RemoveLanguageExtensions(ctx context.Context, resourceGroupName string, clusterName string, languageExtensionsToRemove LanguageExtensionsList) (result ClustersRemoveLanguageExtensionsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.RemoveLanguageExtensions") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemoveLanguageExtensionsPreparer(ctx, resourceGroupName, clusterName, languageExtensionsToRemove) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "RemoveLanguageExtensions", nil, "Failure preparing request") + return + } + + result, err = client.RemoveLanguageExtensionsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "RemoveLanguageExtensions", result.Response(), "Failure sending request") + return + } + + return +} + +// RemoveLanguageExtensionsPreparer prepares the RemoveLanguageExtensions request. +func (client ClustersClient) RemoveLanguageExtensionsPreparer(ctx context.Context, resourceGroupName string, clusterName string, languageExtensionsToRemove LanguageExtensionsList) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions", pathParameters), + autorest.WithJSON(languageExtensionsToRemove), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemoveLanguageExtensionsSender sends the RemoveLanguageExtensions request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) RemoveLanguageExtensionsSender(req *http.Request) (future ClustersRemoveLanguageExtensionsFuture, 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 +} + +// RemoveLanguageExtensionsResponder handles the response to the RemoveLanguageExtensions request. The method always +// closes the http.Response Body. +func (client ClustersClient) RemoveLanguageExtensionsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start starts a Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) Start(ctx context.Context, resourceGroupName string, clusterName string) (result ClustersStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StartPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client ClustersClient) StartPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) StartSender(req *http.Request) (future ClustersStartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client ClustersClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stops a Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ClustersClient) Stop(ctx context.Context, resourceGroupName string, clusterName string) (result ClustersStopFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Stop") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StopPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", nil, "Failure preparing request") + return + } + + result, err = client.StopSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", result.Response(), "Failure sending request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client ClustersClient) StopPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) StopSender(req *http.Request) (future ClustersStopFuture, 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 +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client ClustersClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update a Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// parameters - the Kusto cluster parameters supplied to the Update operation. +// ifMatch - the ETag of the cluster. Omit this value to always overwrite the current cluster. Specify the +// last-seen ETag value to prevent accidentally overwriting concurrent changes. +func (client ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdate, ifMatch string) (result ClustersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdate, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ClustersClient) UpdateResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/kusto/mgmt/2021-08-27/kusto/databaseprincipalassignments.go b/services/kusto/mgmt/2021-08-27/kusto/databaseprincipalassignments.go new file mode 100644 index 000000000000..c1371fcd4d6e --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/databaseprincipalassignments.go @@ -0,0 +1,456 @@ +package kusto + +// 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" +) + +// DatabasePrincipalAssignmentsClient is the the Azure Kusto management API provides a RESTful set of web services that +// interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and +// delete clusters and databases. +type DatabasePrincipalAssignmentsClient struct { + BaseClient +} + +// NewDatabasePrincipalAssignmentsClient creates an instance of the DatabasePrincipalAssignmentsClient client. +func NewDatabasePrincipalAssignmentsClient(subscriptionID string) DatabasePrincipalAssignmentsClient { + return NewDatabasePrincipalAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatabasePrincipalAssignmentsClientWithBaseURI creates an instance of the DatabasePrincipalAssignmentsClient +// 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 NewDatabasePrincipalAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) DatabasePrincipalAssignmentsClient { + return DatabasePrincipalAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks that the database principal assignment is valid and is not already in use. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// principalAssignmentName - the name of the resource. +func (client DatabasePrincipalAssignmentsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName DatabasePrincipalAssignmentCheckNameRequest) (result CheckNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasePrincipalAssignmentsClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: principalAssignmentName, + Constraints: []validation.Constraint{{Target: "principalAssignmentName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "principalAssignmentName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.DatabasePrincipalAssignmentsClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, resourceGroupName, clusterName, databaseName, principalAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client DatabasePrincipalAssignmentsClient) CheckNameAvailabilityPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName DatabasePrincipalAssignmentCheckNameRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability", pathParameters), + autorest.WithJSON(principalAssignmentName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasePrincipalAssignmentsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client DatabasePrincipalAssignmentsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate creates a Kusto cluster database principalAssignment. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// principalAssignmentName - the name of the Kusto principalAssignment. +// parameters - the Kusto principalAssignments parameters supplied for the operation. +func (client DatabasePrincipalAssignmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string, parameters DatabasePrincipalAssignment) (result DatabasePrincipalAssignmentsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasePrincipalAssignmentsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DatabasePrincipalProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DatabasePrincipalProperties.PrincipalID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DatabasePrincipalAssignmentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string, parameters DatabasePrincipalAssignment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "principalAssignmentName": autorest.Encode("path", principalAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasePrincipalAssignmentsClient) CreateOrUpdateSender(req *http.Request) (future DatabasePrincipalAssignmentsCreateOrUpdateFuture, 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 DatabasePrincipalAssignmentsClient) CreateOrUpdateResponder(resp *http.Response) (result DatabasePrincipalAssignment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Kusto principalAssignment. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// principalAssignmentName - the name of the Kusto principalAssignment. +func (client DatabasePrincipalAssignmentsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string) (result DatabasePrincipalAssignmentsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasePrincipalAssignmentsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, databaseName, principalAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DatabasePrincipalAssignmentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "principalAssignmentName": autorest.Encode("path", principalAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}", 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 DatabasePrincipalAssignmentsClient) DeleteSender(req *http.Request) (future DatabasePrincipalAssignmentsDeleteFuture, 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 DatabasePrincipalAssignmentsClient) 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 gets a Kusto cluster database principalAssignment. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// principalAssignmentName - the name of the Kusto principalAssignment. +func (client DatabasePrincipalAssignmentsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string) (result DatabasePrincipalAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasePrincipalAssignmentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, databaseName, principalAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DatabasePrincipalAssignmentsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "principalAssignmentName": autorest.Encode("path", principalAssignmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}", 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 DatabasePrincipalAssignmentsClient) 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 DatabasePrincipalAssignmentsClient) GetResponder(resp *http.Response) (result DatabasePrincipalAssignment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all Kusto cluster database principalAssignments. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +func (client DatabasePrincipalAssignmentsClient) List(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result DatabasePrincipalAssignmentListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasePrincipalAssignmentsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, resourceGroupName, clusterName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client DatabasePrincipalAssignmentsClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments", 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 DatabasePrincipalAssignmentsClient) 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 DatabasePrincipalAssignmentsClient) ListResponder(resp *http.Response) (result DatabasePrincipalAssignmentListResult, 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/services/kusto/mgmt/2021-08-27/kusto/databases.go b/services/kusto/mgmt/2021-08-27/kusto/databases.go new file mode 100644 index 000000000000..31f3dbe0bc56 --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/databases.go @@ -0,0 +1,761 @@ +package kusto + +// 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" +) + +// DatabasesClient is the the Azure Kusto management API provides a RESTful set of web services that interact with +// Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete +// clusters and databases. +type DatabasesClient struct { + BaseClient +} + +// NewDatabasesClient creates an instance of the DatabasesClient client. +func NewDatabasesClient(subscriptionID string) DatabasesClient { + return NewDatabasesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDatabasesClientWithBaseURI creates an instance of the DatabasesClient 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 NewDatabasesClientWithBaseURI(baseURI string, subscriptionID string) DatabasesClient { + return DatabasesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// AddPrincipals add Database principals permissions. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// databasePrincipalsToAdd - list of database principals to add. +func (client DatabasesClient) AddPrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToAdd DatabasePrincipalListRequest) (result DatabasePrincipalListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.AddPrincipals") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddPrincipalsPreparer(ctx, resourceGroupName, clusterName, databaseName, databasePrincipalsToAdd) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "AddPrincipals", nil, "Failure preparing request") + return + } + + resp, err := client.AddPrincipalsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "AddPrincipals", resp, "Failure sending request") + return + } + + result, err = client.AddPrincipalsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "AddPrincipals", resp, "Failure responding to request") + return + } + + return +} + +// AddPrincipalsPreparer prepares the AddPrincipals request. +func (client DatabasesClient) AddPrincipalsPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToAdd DatabasePrincipalListRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals", pathParameters), + autorest.WithJSON(databasePrincipalsToAdd), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddPrincipalsSender sends the AddPrincipals request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) AddPrincipalsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// AddPrincipalsResponder handles the response to the AddPrincipals request. The method always +// closes the http.Response Body. +func (client DatabasesClient) AddPrincipalsResponder(resp *http.Response) (result DatabasePrincipalListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CheckNameAvailability checks that the databases resource name is valid and is not already in use. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// resourceName - the name of the resource. +func (client DatabasesClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, resourceName CheckNameRequest) (result CheckNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.DatabasesClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, resourceGroupName, clusterName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client DatabasesClient) CheckNameAvailabilityPreparer(ctx context.Context, resourceGroupName string, clusterName string, resourceName CheckNameRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability", pathParameters), + autorest.WithJSON(resourceName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client DatabasesClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate creates or updates a database. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// parameters - the database parameters supplied to the CreateOrUpdate operation. +func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters BasicDatabase) (result DatabasesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, databaseName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters BasicDatabase) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, 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 DatabasesClient) CreateOrUpdateResponder(resp *http.Response) (result DatabaseModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the database with the given name. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result DatabasesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}", 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 DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, 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 DatabasesClient) 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 returns a database. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +func (client DatabasesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result DatabaseModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DatabasesClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}", 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 DatabasesClient) 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 DatabasesClient) GetResponder(resp *http.Response) (result DatabaseModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByCluster returns the list of databases of the given Kusto cluster. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client DatabasesClient) ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result DatabaseListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListByCluster") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByClusterPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListByCluster", nil, "Failure preparing request") + return + } + + resp, err := client.ListByClusterSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListByCluster", resp, "Failure sending request") + return + } + + result, err = client.ListByClusterResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListByCluster", resp, "Failure responding to request") + return + } + + return +} + +// ListByClusterPreparer prepares the ListByCluster request. +func (client DatabasesClient) ListByClusterPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByClusterSender sends the ListByCluster request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) ListByClusterSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByClusterResponder handles the response to the ListByCluster request. The method always +// closes the http.Response Body. +func (client DatabasesClient) ListByClusterResponder(resp *http.Response) (result DatabaseListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListPrincipals returns a list of database principals of the given Kusto cluster and database. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +func (client DatabasesClient) ListPrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result DatabasePrincipalListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.ListPrincipals") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPrincipalsPreparer(ctx, resourceGroupName, clusterName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListPrincipals", nil, "Failure preparing request") + return + } + + resp, err := client.ListPrincipalsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListPrincipals", resp, "Failure sending request") + return + } + + result, err = client.ListPrincipalsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "ListPrincipals", resp, "Failure responding to request") + return + } + + return +} + +// ListPrincipalsPreparer prepares the ListPrincipals request. +func (client DatabasesClient) ListPrincipalsPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPrincipalsSender sends the ListPrincipals request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) ListPrincipalsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPrincipalsResponder handles the response to the ListPrincipals request. The method always +// closes the http.Response Body. +func (client DatabasesClient) ListPrincipalsResponder(resp *http.Response) (result DatabasePrincipalListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RemovePrincipals remove Database principals permissions. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// databasePrincipalsToRemove - list of database principals to remove. +func (client DatabasesClient) RemovePrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToRemove DatabasePrincipalListRequest) (result DatabasePrincipalListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.RemovePrincipals") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RemovePrincipalsPreparer(ctx, resourceGroupName, clusterName, databaseName, databasePrincipalsToRemove) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "RemovePrincipals", nil, "Failure preparing request") + return + } + + resp, err := client.RemovePrincipalsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "RemovePrincipals", resp, "Failure sending request") + return + } + + result, err = client.RemovePrincipalsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "RemovePrincipals", resp, "Failure responding to request") + return + } + + return +} + +// RemovePrincipalsPreparer prepares the RemovePrincipals request. +func (client DatabasesClient) RemovePrincipalsPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToRemove DatabasePrincipalListRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals", pathParameters), + autorest.WithJSON(databasePrincipalsToRemove), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RemovePrincipalsSender sends the RemovePrincipals request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) RemovePrincipalsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RemovePrincipalsResponder handles the response to the RemovePrincipals request. The method always +// closes the http.Response Body. +func (client DatabasesClient) RemovePrincipalsResponder(resp *http.Response) (result DatabasePrincipalListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a database. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// parameters - the database parameters supplied to the Update operation. +func (client DatabasesClient) Update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters BasicDatabase) (result DatabasesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DatabasesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, databaseName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters BasicDatabase) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DatabasesClient) UpdateSender(req *http.Request) (future DatabasesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DatabasesClient) UpdateResponder(resp *http.Response) (result DatabaseModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/kusto/mgmt/2021-08-27/kusto/dataconnections.go b/services/kusto/mgmt/2021-08-27/kusto/dataconnections.go new file mode 100644 index 000000000000..eac77967d8f9 --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/dataconnections.go @@ -0,0 +1,618 @@ +package kusto + +// 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" +) + +// DataConnectionsClient is the the Azure Kusto management API provides a RESTful set of web services that interact +// with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete +// clusters and databases. +type DataConnectionsClient struct { + BaseClient +} + +// NewDataConnectionsClient creates an instance of the DataConnectionsClient client. +func NewDataConnectionsClient(subscriptionID string) DataConnectionsClient { + return NewDataConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataConnectionsClientWithBaseURI creates an instance of the DataConnectionsClient 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 NewDataConnectionsClientWithBaseURI(baseURI string, subscriptionID string) DataConnectionsClient { + return DataConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks that the data connection name is valid and is not already in use. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// dataConnectionName - the name of the data connection. +func (client DataConnectionsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName DataConnectionCheckNameRequest) (result CheckNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: dataConnectionName, + Constraints: []validation.Constraint{{Target: "dataConnectionName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "dataConnectionName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.DataConnectionsClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client DataConnectionsClient) CheckNameAvailabilityPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName DataConnectionCheckNameRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability", pathParameters), + autorest.WithJSON(dataConnectionName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client DataConnectionsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client DataConnectionsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate creates or updates a data connection. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// dataConnectionName - the name of the data connection. +// parameters - the data connection parameters supplied to the CreateOrUpdate operation. +func (client DataConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters BasicDataConnection) (result DataConnectionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DataConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters BasicDataConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "dataConnectionName": autorest.Encode("path", dataConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DataConnectionsClient) CreateOrUpdateSender(req *http.Request) (future DataConnectionsCreateOrUpdateFuture, 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 DataConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result DataConnectionModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DataConnectionValidationMethod checks that the data connection parameters are valid. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// parameters - the data connection parameters supplied to the CreateOrUpdate operation. +func (client DataConnectionsClient) DataConnectionValidationMethod(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DataConnectionValidation) (result DataConnectionsDataConnectionValidationMethodFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.DataConnectionValidationMethod") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DataConnectionValidationMethodPreparer(ctx, resourceGroupName, clusterName, databaseName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "DataConnectionValidationMethod", nil, "Failure preparing request") + return + } + + result, err = client.DataConnectionValidationMethodSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "DataConnectionValidationMethod", result.Response(), "Failure sending request") + return + } + + return +} + +// DataConnectionValidationMethodPreparer prepares the DataConnectionValidationMethod request. +func (client DataConnectionsClient) DataConnectionValidationMethodPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DataConnectionValidation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DataConnectionValidationMethodSender sends the DataConnectionValidationMethod request. The method will close the +// http.Response Body if it receives an error. +func (client DataConnectionsClient) DataConnectionValidationMethodSender(req *http.Request) (future DataConnectionsDataConnectionValidationMethodFuture, 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 +} + +// DataConnectionValidationMethodResponder handles the response to the DataConnectionValidationMethod request. The method always +// closes the http.Response Body. +func (client DataConnectionsClient) DataConnectionValidationMethodResponder(resp *http.Response) (result DataConnectionValidationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the data connection with the given name. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// dataConnectionName - the name of the data connection. +func (client DataConnectionsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (result DataConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DataConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "dataConnectionName": autorest.Encode("path", dataConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", 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 DataConnectionsClient) DeleteSender(req *http.Request) (future DataConnectionsDeleteFuture, 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 DataConnectionsClient) 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 returns a data connection. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// dataConnectionName - the name of the data connection. +func (client DataConnectionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (result DataConnectionModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "dataConnectionName": autorest.Encode("path", dataConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", 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 DataConnectionsClient) 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 DataConnectionsClient) GetResponder(resp *http.Response) (result DataConnectionModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDatabase returns the list of data connections of the given Kusto database. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +func (client DataConnectionsClient) ListByDatabase(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result DataConnectionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.ListByDatabase") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, clusterName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "ListByDatabase", resp, "Failure responding to request") + return + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client DataConnectionsClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseSender sends the ListByDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client DataConnectionsClient) ListByDatabaseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByDatabaseResponder handles the response to the ListByDatabase request. The method always +// closes the http.Response Body. +func (client DataConnectionsClient) ListByDatabaseResponder(resp *http.Response) (result DataConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a data connection. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// dataConnectionName - the name of the data connection. +// parameters - the data connection parameters supplied to the Update operation. +func (client DataConnectionsClient) Update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters BasicDataConnection) (result DataConnectionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectionsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DataConnectionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters BasicDataConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "dataConnectionName": autorest.Encode("path", dataConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DataConnectionsClient) UpdateSender(req *http.Request) (future DataConnectionsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DataConnectionsClient) UpdateResponder(resp *http.Response) (result DataConnectionModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/kusto/mgmt/2021-08-27/kusto/enums.go b/services/kusto/mgmt/2021-08-27/kusto/enums.go new file mode 100644 index 000000000000..cf66033d7c0a --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/enums.go @@ -0,0 +1,600 @@ +package kusto + +// 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. + +// AzureScaleType enumerates the values for azure scale type. +type AzureScaleType string + +const ( + // Automatic ... + Automatic AzureScaleType = "automatic" + // Manual ... + Manual AzureScaleType = "manual" + // None ... + None AzureScaleType = "none" +) + +// PossibleAzureScaleTypeValues returns an array of possible values for the AzureScaleType const type. +func PossibleAzureScaleTypeValues() []AzureScaleType { + return []AzureScaleType{Automatic, Manual, None} +} + +// AzureSkuName enumerates the values for azure sku name. +type AzureSkuName string + +const ( + // DevNoSLAStandardD11V2 ... + DevNoSLAStandardD11V2 AzureSkuName = "Dev(No SLA)_Standard_D11_v2" + // DevNoSLAStandardE2aV4 ... + DevNoSLAStandardE2aV4 AzureSkuName = "Dev(No SLA)_Standard_E2a_v4" + // StandardD11V2 ... + StandardD11V2 AzureSkuName = "Standard_D11_v2" + // StandardD12V2 ... + StandardD12V2 AzureSkuName = "Standard_D12_v2" + // StandardD13V2 ... + StandardD13V2 AzureSkuName = "Standard_D13_v2" + // StandardD14V2 ... + StandardD14V2 AzureSkuName = "Standard_D14_v2" + // StandardDS13V21TBPS ... + StandardDS13V21TBPS AzureSkuName = "Standard_DS13_v2+1TB_PS" + // StandardDS13V22TBPS ... + StandardDS13V22TBPS AzureSkuName = "Standard_DS13_v2+2TB_PS" + // StandardDS14V23TBPS ... + StandardDS14V23TBPS AzureSkuName = "Standard_DS14_v2+3TB_PS" + // StandardDS14V24TBPS ... + StandardDS14V24TBPS AzureSkuName = "Standard_DS14_v2+4TB_PS" + // StandardE16asV43TBPS ... + StandardE16asV43TBPS AzureSkuName = "Standard_E16as_v4+3TB_PS" + // StandardE16asV44TBPS ... + StandardE16asV44TBPS AzureSkuName = "Standard_E16as_v4+4TB_PS" + // StandardE16aV4 ... + StandardE16aV4 AzureSkuName = "Standard_E16a_v4" + // StandardE2aV4 ... + StandardE2aV4 AzureSkuName = "Standard_E2a_v4" + // StandardE4aV4 ... + StandardE4aV4 AzureSkuName = "Standard_E4a_v4" + // StandardE64iV3 ... + StandardE64iV3 AzureSkuName = "Standard_E64i_v3" + // StandardE80idsV4 ... + StandardE80idsV4 AzureSkuName = "Standard_E80ids_v4" + // StandardE8asV41TBPS ... + StandardE8asV41TBPS AzureSkuName = "Standard_E8as_v4+1TB_PS" + // StandardE8asV42TBPS ... + StandardE8asV42TBPS AzureSkuName = "Standard_E8as_v4+2TB_PS" + // StandardE8aV4 ... + StandardE8aV4 AzureSkuName = "Standard_E8a_v4" + // StandardL16s ... + StandardL16s AzureSkuName = "Standard_L16s" + // StandardL16sV2 ... + StandardL16sV2 AzureSkuName = "Standard_L16s_v2" + // StandardL4s ... + StandardL4s AzureSkuName = "Standard_L4s" + // StandardL8s ... + StandardL8s AzureSkuName = "Standard_L8s" + // StandardL8sV2 ... + StandardL8sV2 AzureSkuName = "Standard_L8s_v2" +) + +// PossibleAzureSkuNameValues returns an array of possible values for the AzureSkuName const type. +func PossibleAzureSkuNameValues() []AzureSkuName { + return []AzureSkuName{DevNoSLAStandardD11V2, DevNoSLAStandardE2aV4, StandardD11V2, StandardD12V2, StandardD13V2, StandardD14V2, StandardDS13V21TBPS, StandardDS13V22TBPS, StandardDS14V23TBPS, StandardDS14V24TBPS, StandardE16asV43TBPS, StandardE16asV44TBPS, StandardE16aV4, StandardE2aV4, StandardE4aV4, StandardE64iV3, StandardE80idsV4, StandardE8asV41TBPS, StandardE8asV42TBPS, StandardE8aV4, StandardL16s, StandardL16sV2, StandardL4s, StandardL8s, StandardL8sV2} +} + +// AzureSkuTier enumerates the values for azure sku tier. +type AzureSkuTier string + +const ( + // Basic ... + Basic AzureSkuTier = "Basic" + // Standard ... + Standard AzureSkuTier = "Standard" +) + +// PossibleAzureSkuTierValues returns an array of possible values for the AzureSkuTier const type. +func PossibleAzureSkuTierValues() []AzureSkuTier { + return []AzureSkuTier{Basic, Standard} +} + +// BlobStorageEventType enumerates the values for blob storage event type. +type BlobStorageEventType string + +const ( + // MicrosoftStorageBlobCreated ... + MicrosoftStorageBlobCreated BlobStorageEventType = "Microsoft.Storage.BlobCreated" + // MicrosoftStorageBlobRenamed ... + MicrosoftStorageBlobRenamed BlobStorageEventType = "Microsoft.Storage.BlobRenamed" +) + +// PossibleBlobStorageEventTypeValues returns an array of possible values for the BlobStorageEventType const type. +func PossibleBlobStorageEventTypeValues() []BlobStorageEventType { + return []BlobStorageEventType{MicrosoftStorageBlobCreated, MicrosoftStorageBlobRenamed} +} + +// ClusterNetworkAccessFlag enumerates the values for cluster network access flag. +type ClusterNetworkAccessFlag string + +const ( + // Disabled ... + Disabled ClusterNetworkAccessFlag = "Disabled" + // Enabled ... + Enabled ClusterNetworkAccessFlag = "Enabled" +) + +// PossibleClusterNetworkAccessFlagValues returns an array of possible values for the ClusterNetworkAccessFlag const type. +func PossibleClusterNetworkAccessFlagValues() []ClusterNetworkAccessFlag { + return []ClusterNetworkAccessFlag{Disabled, Enabled} +} + +// ClusterPrincipalRole enumerates the values for cluster principal role. +type ClusterPrincipalRole string + +const ( + // AllDatabasesAdmin ... + AllDatabasesAdmin ClusterPrincipalRole = "AllDatabasesAdmin" + // AllDatabasesViewer ... + AllDatabasesViewer ClusterPrincipalRole = "AllDatabasesViewer" +) + +// PossibleClusterPrincipalRoleValues returns an array of possible values for the ClusterPrincipalRole const type. +func PossibleClusterPrincipalRoleValues() []ClusterPrincipalRole { + return []ClusterPrincipalRole{AllDatabasesAdmin, AllDatabasesViewer} +} + +// Compression enumerates the values for compression. +type Compression string + +const ( + // CompressionGZip ... + CompressionGZip Compression = "GZip" + // CompressionNone ... + CompressionNone Compression = "None" +) + +// PossibleCompressionValues returns an array of possible values for the Compression const type. +func PossibleCompressionValues() []Compression { + return []Compression{CompressionGZip, CompressionNone} +} + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // Application ... + Application CreatedByType = "Application" + // Key ... + Key CreatedByType = "Key" + // ManagedIdentity ... + ManagedIdentity CreatedByType = "ManagedIdentity" + // User ... + User CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{Application, Key, ManagedIdentity, User} +} + +// DatabasePrincipalRole enumerates the values for database principal role. +type DatabasePrincipalRole string + +const ( + // DatabasePrincipalRoleAdmin ... + DatabasePrincipalRoleAdmin DatabasePrincipalRole = "Admin" + // DatabasePrincipalRoleIngestor ... + DatabasePrincipalRoleIngestor DatabasePrincipalRole = "Ingestor" + // DatabasePrincipalRoleMonitor ... + DatabasePrincipalRoleMonitor DatabasePrincipalRole = "Monitor" + // DatabasePrincipalRoleUnrestrictedViewer ... + DatabasePrincipalRoleUnrestrictedViewer DatabasePrincipalRole = "UnrestrictedViewer" + // DatabasePrincipalRoleUser ... + DatabasePrincipalRoleUser DatabasePrincipalRole = "User" + // DatabasePrincipalRoleViewer ... + DatabasePrincipalRoleViewer DatabasePrincipalRole = "Viewer" +) + +// PossibleDatabasePrincipalRoleValues returns an array of possible values for the DatabasePrincipalRole const type. +func PossibleDatabasePrincipalRoleValues() []DatabasePrincipalRole { + return []DatabasePrincipalRole{DatabasePrincipalRoleAdmin, DatabasePrincipalRoleIngestor, DatabasePrincipalRoleMonitor, DatabasePrincipalRoleUnrestrictedViewer, DatabasePrincipalRoleUser, DatabasePrincipalRoleViewer} +} + +// DatabasePrincipalType enumerates the values for database principal type. +type DatabasePrincipalType string + +const ( + // DatabasePrincipalTypeApp ... + DatabasePrincipalTypeApp DatabasePrincipalType = "App" + // DatabasePrincipalTypeGroup ... + DatabasePrincipalTypeGroup DatabasePrincipalType = "Group" + // DatabasePrincipalTypeUser ... + DatabasePrincipalTypeUser DatabasePrincipalType = "User" +) + +// PossibleDatabasePrincipalTypeValues returns an array of possible values for the DatabasePrincipalType const type. +func PossibleDatabasePrincipalTypeValues() []DatabasePrincipalType { + return []DatabasePrincipalType{DatabasePrincipalTypeApp, DatabasePrincipalTypeGroup, DatabasePrincipalTypeUser} +} + +// DefaultPrincipalsModificationKind enumerates the values for default principals modification kind. +type DefaultPrincipalsModificationKind string + +const ( + // DefaultPrincipalsModificationKindNone ... + DefaultPrincipalsModificationKindNone DefaultPrincipalsModificationKind = "None" + // DefaultPrincipalsModificationKindReplace ... + DefaultPrincipalsModificationKindReplace DefaultPrincipalsModificationKind = "Replace" + // DefaultPrincipalsModificationKindUnion ... + DefaultPrincipalsModificationKindUnion DefaultPrincipalsModificationKind = "Union" +) + +// PossibleDefaultPrincipalsModificationKindValues returns an array of possible values for the DefaultPrincipalsModificationKind const type. +func PossibleDefaultPrincipalsModificationKindValues() []DefaultPrincipalsModificationKind { + return []DefaultPrincipalsModificationKind{DefaultPrincipalsModificationKindNone, DefaultPrincipalsModificationKindReplace, DefaultPrincipalsModificationKindUnion} +} + +// EngineType enumerates the values for engine type. +type EngineType string + +const ( + // V2 ... + V2 EngineType = "V2" + // V3 ... + V3 EngineType = "V3" +) + +// PossibleEngineTypeValues returns an array of possible values for the EngineType const type. +func PossibleEngineTypeValues() []EngineType { + return []EngineType{V2, V3} +} + +// EventGridDataFormat enumerates the values for event grid data format. +type EventGridDataFormat string + +const ( + // APACHEAVRO ... + APACHEAVRO EventGridDataFormat = "APACHEAVRO" + // AVRO ... + AVRO EventGridDataFormat = "AVRO" + // CSV ... + CSV EventGridDataFormat = "CSV" + // JSON ... + JSON EventGridDataFormat = "JSON" + // MULTIJSON ... + MULTIJSON EventGridDataFormat = "MULTIJSON" + // ORC ... + ORC EventGridDataFormat = "ORC" + // PARQUET ... + PARQUET EventGridDataFormat = "PARQUET" + // PSV ... + PSV EventGridDataFormat = "PSV" + // RAW ... + RAW EventGridDataFormat = "RAW" + // SCSV ... + SCSV EventGridDataFormat = "SCSV" + // SINGLEJSON ... + SINGLEJSON EventGridDataFormat = "SINGLEJSON" + // SOHSV ... + SOHSV EventGridDataFormat = "SOHSV" + // TSV ... + TSV EventGridDataFormat = "TSV" + // TSVE ... + TSVE EventGridDataFormat = "TSVE" + // TXT ... + TXT EventGridDataFormat = "TXT" + // W3CLOGFILE ... + W3CLOGFILE EventGridDataFormat = "W3CLOGFILE" +) + +// PossibleEventGridDataFormatValues returns an array of possible values for the EventGridDataFormat const type. +func PossibleEventGridDataFormatValues() []EventGridDataFormat { + return []EventGridDataFormat{APACHEAVRO, AVRO, CSV, JSON, MULTIJSON, ORC, PARQUET, PSV, RAW, SCSV, SINGLEJSON, SOHSV, TSV, TSVE, TXT, W3CLOGFILE} +} + +// EventHubDataFormat enumerates the values for event hub data format. +type EventHubDataFormat string + +const ( + // EventHubDataFormatAPACHEAVRO ... + EventHubDataFormatAPACHEAVRO EventHubDataFormat = "APACHEAVRO" + // EventHubDataFormatAVRO ... + EventHubDataFormatAVRO EventHubDataFormat = "AVRO" + // EventHubDataFormatCSV ... + EventHubDataFormatCSV EventHubDataFormat = "CSV" + // EventHubDataFormatJSON ... + EventHubDataFormatJSON EventHubDataFormat = "JSON" + // EventHubDataFormatMULTIJSON ... + EventHubDataFormatMULTIJSON EventHubDataFormat = "MULTIJSON" + // EventHubDataFormatORC ... + EventHubDataFormatORC EventHubDataFormat = "ORC" + // EventHubDataFormatPARQUET ... + EventHubDataFormatPARQUET EventHubDataFormat = "PARQUET" + // EventHubDataFormatPSV ... + EventHubDataFormatPSV EventHubDataFormat = "PSV" + // EventHubDataFormatRAW ... + EventHubDataFormatRAW EventHubDataFormat = "RAW" + // EventHubDataFormatSCSV ... + EventHubDataFormatSCSV EventHubDataFormat = "SCSV" + // EventHubDataFormatSINGLEJSON ... + EventHubDataFormatSINGLEJSON EventHubDataFormat = "SINGLEJSON" + // EventHubDataFormatSOHSV ... + EventHubDataFormatSOHSV EventHubDataFormat = "SOHSV" + // EventHubDataFormatTSV ... + EventHubDataFormatTSV EventHubDataFormat = "TSV" + // EventHubDataFormatTSVE ... + EventHubDataFormatTSVE EventHubDataFormat = "TSVE" + // EventHubDataFormatTXT ... + EventHubDataFormatTXT EventHubDataFormat = "TXT" + // EventHubDataFormatW3CLOGFILE ... + EventHubDataFormatW3CLOGFILE EventHubDataFormat = "W3CLOGFILE" +) + +// PossibleEventHubDataFormatValues returns an array of possible values for the EventHubDataFormat const type. +func PossibleEventHubDataFormatValues() []EventHubDataFormat { + return []EventHubDataFormat{EventHubDataFormatAPACHEAVRO, EventHubDataFormatAVRO, EventHubDataFormatCSV, EventHubDataFormatJSON, EventHubDataFormatMULTIJSON, EventHubDataFormatORC, EventHubDataFormatPARQUET, EventHubDataFormatPSV, EventHubDataFormatRAW, EventHubDataFormatSCSV, EventHubDataFormatSINGLEJSON, EventHubDataFormatSOHSV, EventHubDataFormatTSV, EventHubDataFormatTSVE, EventHubDataFormatTXT, EventHubDataFormatW3CLOGFILE} +} + +// IdentityType enumerates the values for identity type. +type IdentityType string + +const ( + // IdentityTypeNone ... + IdentityTypeNone IdentityType = "None" + // IdentityTypeSystemAssigned ... + IdentityTypeSystemAssigned IdentityType = "SystemAssigned" + // IdentityTypeSystemAssignedUserAssigned ... + IdentityTypeSystemAssignedUserAssigned IdentityType = "SystemAssigned, UserAssigned" + // IdentityTypeUserAssigned ... + IdentityTypeUserAssigned IdentityType = "UserAssigned" +) + +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() []IdentityType { + return []IdentityType{IdentityTypeNone, IdentityTypeSystemAssigned, IdentityTypeSystemAssignedUserAssigned, IdentityTypeUserAssigned} +} + +// IotHubDataFormat enumerates the values for iot hub data format. +type IotHubDataFormat string + +const ( + // IotHubDataFormatAPACHEAVRO ... + IotHubDataFormatAPACHEAVRO IotHubDataFormat = "APACHEAVRO" + // IotHubDataFormatAVRO ... + IotHubDataFormatAVRO IotHubDataFormat = "AVRO" + // IotHubDataFormatCSV ... + IotHubDataFormatCSV IotHubDataFormat = "CSV" + // IotHubDataFormatJSON ... + IotHubDataFormatJSON IotHubDataFormat = "JSON" + // IotHubDataFormatMULTIJSON ... + IotHubDataFormatMULTIJSON IotHubDataFormat = "MULTIJSON" + // IotHubDataFormatORC ... + IotHubDataFormatORC IotHubDataFormat = "ORC" + // IotHubDataFormatPARQUET ... + IotHubDataFormatPARQUET IotHubDataFormat = "PARQUET" + // IotHubDataFormatPSV ... + IotHubDataFormatPSV IotHubDataFormat = "PSV" + // IotHubDataFormatRAW ... + IotHubDataFormatRAW IotHubDataFormat = "RAW" + // IotHubDataFormatSCSV ... + IotHubDataFormatSCSV IotHubDataFormat = "SCSV" + // IotHubDataFormatSINGLEJSON ... + IotHubDataFormatSINGLEJSON IotHubDataFormat = "SINGLEJSON" + // IotHubDataFormatSOHSV ... + IotHubDataFormatSOHSV IotHubDataFormat = "SOHSV" + // IotHubDataFormatTSV ... + IotHubDataFormatTSV IotHubDataFormat = "TSV" + // IotHubDataFormatTSVE ... + IotHubDataFormatTSVE IotHubDataFormat = "TSVE" + // IotHubDataFormatTXT ... + IotHubDataFormatTXT IotHubDataFormat = "TXT" + // IotHubDataFormatW3CLOGFILE ... + IotHubDataFormatW3CLOGFILE IotHubDataFormat = "W3CLOGFILE" +) + +// PossibleIotHubDataFormatValues returns an array of possible values for the IotHubDataFormat const type. +func PossibleIotHubDataFormatValues() []IotHubDataFormat { + return []IotHubDataFormat{IotHubDataFormatAPACHEAVRO, IotHubDataFormatAVRO, IotHubDataFormatCSV, IotHubDataFormatJSON, IotHubDataFormatMULTIJSON, IotHubDataFormatORC, IotHubDataFormatPARQUET, IotHubDataFormatPSV, IotHubDataFormatRAW, IotHubDataFormatSCSV, IotHubDataFormatSINGLEJSON, IotHubDataFormatSOHSV, IotHubDataFormatTSV, IotHubDataFormatTSVE, IotHubDataFormatTXT, IotHubDataFormatW3CLOGFILE} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindDatabase ... + KindDatabase Kind = "Database" + // KindReadOnlyFollowing ... + KindReadOnlyFollowing Kind = "ReadOnlyFollowing" + // KindReadWrite ... + KindReadWrite Kind = "ReadWrite" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindDatabase, KindReadOnlyFollowing, KindReadWrite} +} + +// KindBasicDataConnection enumerates the values for kind basic data connection. +type KindBasicDataConnection string + +const ( + // KindDataConnection ... + KindDataConnection KindBasicDataConnection = "DataConnection" + // KindEventGrid ... + KindEventGrid KindBasicDataConnection = "EventGrid" + // KindEventHub ... + KindEventHub KindBasicDataConnection = "EventHub" + // KindIotHub ... + KindIotHub KindBasicDataConnection = "IotHub" +) + +// PossibleKindBasicDataConnectionValues returns an array of possible values for the KindBasicDataConnection const type. +func PossibleKindBasicDataConnectionValues() []KindBasicDataConnection { + return []KindBasicDataConnection{KindDataConnection, KindEventGrid, KindEventHub, KindIotHub} +} + +// LanguageExtensionName enumerates the values for language extension name. +type LanguageExtensionName string + +const ( + // PYTHON ... + PYTHON LanguageExtensionName = "PYTHON" + // R ... + R LanguageExtensionName = "R" +) + +// PossibleLanguageExtensionNameValues returns an array of possible values for the LanguageExtensionName const type. +func PossibleLanguageExtensionNameValues() []LanguageExtensionName { + return []LanguageExtensionName{PYTHON, R} +} + +// PrincipalsModificationKind enumerates the values for principals modification kind. +type PrincipalsModificationKind string + +const ( + // PrincipalsModificationKindNone ... + PrincipalsModificationKindNone PrincipalsModificationKind = "None" + // PrincipalsModificationKindReplace ... + PrincipalsModificationKindReplace PrincipalsModificationKind = "Replace" + // PrincipalsModificationKindUnion ... + PrincipalsModificationKindUnion PrincipalsModificationKind = "Union" +) + +// PossiblePrincipalsModificationKindValues returns an array of possible values for the PrincipalsModificationKind const type. +func PossiblePrincipalsModificationKindValues() []PrincipalsModificationKind { + return []PrincipalsModificationKind{PrincipalsModificationKindNone, PrincipalsModificationKindReplace, PrincipalsModificationKindUnion} +} + +// PrincipalType enumerates the values for principal type. +type PrincipalType string + +const ( + // PrincipalTypeApp ... + PrincipalTypeApp PrincipalType = "App" + // PrincipalTypeGroup ... + PrincipalTypeGroup PrincipalType = "Group" + // PrincipalTypeUser ... + PrincipalTypeUser PrincipalType = "User" +) + +// PossiblePrincipalTypeValues returns an array of possible values for the PrincipalType const type. +func PossiblePrincipalTypeValues() []PrincipalType { + return []PrincipalType{PrincipalTypeApp, PrincipalTypeGroup, PrincipalTypeUser} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Creating ... + Creating ProvisioningState = "Creating" + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Moving ... + Moving ProvisioningState = "Moving" + // Running ... + Running ProvisioningState = "Running" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Creating, Deleting, Failed, Moving, Running, Succeeded} +} + +// 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. +type Reason string + +const ( + // AlreadyExists ... + AlreadyExists Reason = "AlreadyExists" + // Invalid ... + Invalid Reason = "Invalid" +) + +// PossibleReasonValues returns an array of possible values for the Reason const type. +func PossibleReasonValues() []Reason { + return []Reason{AlreadyExists, Invalid} +} + +// State enumerates the values for state. +type State string + +const ( + // StateCreating ... + StateCreating State = "Creating" + // StateDeleted ... + StateDeleted State = "Deleted" + // StateDeleting ... + StateDeleting State = "Deleting" + // StateRunning ... + StateRunning State = "Running" + // StateStarting ... + StateStarting State = "Starting" + // StateStopped ... + StateStopped State = "Stopped" + // StateStopping ... + StateStopping State = "Stopping" + // StateUnavailable ... + StateUnavailable State = "Unavailable" + // StateUpdating ... + StateUpdating State = "Updating" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{StateCreating, StateDeleted, StateDeleting, StateRunning, StateStarting, StateStopped, StateStopping, StateUnavailable, StateUpdating} +} + +// Status enumerates the values for status. +type Status string + +const ( + // StatusCanceled ... + StatusCanceled Status = "Canceled" + // StatusFailed ... + StatusFailed Status = "Failed" + // StatusRunning ... + StatusRunning Status = "Running" + // StatusSucceeded ... + StatusSucceeded Status = "Succeeded" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{StatusCanceled, StatusFailed, StatusRunning, StatusSucceeded} +} + +// Type enumerates the values for type. +type Type string + +const ( + // MicrosoftKustoclustersattachedDatabaseConfigurations ... + MicrosoftKustoclustersattachedDatabaseConfigurations Type = "Microsoft.Kusto/clusters/attachedDatabaseConfigurations" + // MicrosoftKustoclustersdatabases ... + MicrosoftKustoclustersdatabases Type = "Microsoft.Kusto/clusters/databases" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{MicrosoftKustoclustersattachedDatabaseConfigurations, MicrosoftKustoclustersdatabases} +} diff --git a/services/kusto/mgmt/2021-08-27/kusto/kustoapi/interfaces.go b/services/kusto/mgmt/2021-08-27/kusto/kustoapi/interfaces.go new file mode 100644 index 000000000000..1b93ed2184aa --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/kustoapi/interfaces.go @@ -0,0 +1,155 @@ +package kustoapi + +// 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/azure-sdk-for-go/services/kusto/mgmt/2021-08-27/kusto" +) + +// ClustersClientAPI contains the set of methods on the ClustersClient type. +type ClustersClientAPI interface { + AddLanguageExtensions(ctx context.Context, resourceGroupName string, clusterName string, languageExtensionsToAdd kusto.LanguageExtensionsList) (result kusto.ClustersAddLanguageExtensionsFuture, err error) + CheckNameAvailability(ctx context.Context, location string, clusterName kusto.ClusterCheckNameRequest) (result kusto.CheckNameResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters kusto.Cluster, ifMatch string, ifNoneMatch string) (result kusto.ClustersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.ClustersDeleteFuture, err error) + DetachFollowerDatabases(ctx context.Context, resourceGroupName string, clusterName string, followerDatabaseToRemove kusto.FollowerDatabaseDefinition) (result kusto.ClustersDetachFollowerDatabasesFuture, err error) + DiagnoseVirtualNetwork(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.ClustersDiagnoseVirtualNetworkFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.Cluster, err error) + List(ctx context.Context) (result kusto.ClusterListResult, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result kusto.ClusterListResult, err error) + ListFollowerDatabases(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.FollowerDatabaseListResult, err error) + ListLanguageExtensions(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.LanguageExtensionsList, err error) + ListOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.OutboundNetworkDependenciesEndpointListResultPage, err error) + ListOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.OutboundNetworkDependenciesEndpointListResultIterator, err error) + ListSkus(ctx context.Context) (result kusto.SkuDescriptionList, err error) + ListSkusByResource(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.ListResourceSkusResult, err error) + RemoveLanguageExtensions(ctx context.Context, resourceGroupName string, clusterName string, languageExtensionsToRemove kusto.LanguageExtensionsList) (result kusto.ClustersRemoveLanguageExtensionsFuture, err error) + Start(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.ClustersStartFuture, err error) + Stop(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.ClustersStopFuture, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, parameters kusto.ClusterUpdate, ifMatch string) (result kusto.ClustersUpdateFuture, err error) +} + +var _ ClustersClientAPI = (*kusto.ClustersClient)(nil) + +// ClusterPrincipalAssignmentsClientAPI contains the set of methods on the ClusterPrincipalAssignmentsClient type. +type ClusterPrincipalAssignmentsClientAPI interface { + CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName kusto.ClusterPrincipalAssignmentCheckNameRequest) (result kusto.CheckNameResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string, parameters kusto.ClusterPrincipalAssignment) (result kusto.ClusterPrincipalAssignmentsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string) (result kusto.ClusterPrincipalAssignmentsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string) (result kusto.ClusterPrincipalAssignment, err error) + List(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.ClusterPrincipalAssignmentListResult, err error) +} + +var _ ClusterPrincipalAssignmentsClientAPI = (*kusto.ClusterPrincipalAssignmentsClient)(nil) + +// DatabasesClientAPI contains the set of methods on the DatabasesClient type. +type DatabasesClientAPI interface { + AddPrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToAdd kusto.DatabasePrincipalListRequest) (result kusto.DatabasePrincipalListResult, err error) + CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, resourceName kusto.CheckNameRequest) (result kusto.CheckNameResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters kusto.BasicDatabase) (result kusto.DatabasesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result kusto.DatabasesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result kusto.DatabaseModel, err error) + ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.DatabaseListResult, err error) + ListPrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result kusto.DatabasePrincipalListResult, err error) + RemovePrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToRemove kusto.DatabasePrincipalListRequest) (result kusto.DatabasePrincipalListResult, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters kusto.BasicDatabase) (result kusto.DatabasesUpdateFuture, err error) +} + +var _ DatabasesClientAPI = (*kusto.DatabasesClient)(nil) + +// AttachedDatabaseConfigurationsClientAPI contains the set of methods on the AttachedDatabaseConfigurationsClient type. +type AttachedDatabaseConfigurationsClientAPI interface { + CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, resourceName kusto.AttachedDatabaseConfigurationsCheckNameRequest) (result kusto.CheckNameResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string, parameters kusto.AttachedDatabaseConfiguration) (result kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (result kusto.AttachedDatabaseConfigurationsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string) (result kusto.AttachedDatabaseConfiguration, err error) + ListByCluster(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.AttachedDatabaseConfigurationListResult, err error) +} + +var _ AttachedDatabaseConfigurationsClientAPI = (*kusto.AttachedDatabaseConfigurationsClient)(nil) + +// ManagedPrivateEndpointsClientAPI contains the set of methods on the ManagedPrivateEndpointsClient type. +type ManagedPrivateEndpointsClientAPI interface { + CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, resourceName kusto.ManagedPrivateEndpointsCheckNameRequest) (result kusto.CheckNameResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, parameters kusto.ManagedPrivateEndpoint) (result kusto.ManagedPrivateEndpointsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string) (result kusto.ManagedPrivateEndpointsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string) (result kusto.ManagedPrivateEndpoint, err error) + List(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.ManagedPrivateEndpointListResult, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, parameters kusto.ManagedPrivateEndpoint) (result kusto.ManagedPrivateEndpointsUpdateFuture, err error) +} + +var _ ManagedPrivateEndpointsClientAPI = (*kusto.ManagedPrivateEndpointsClient)(nil) + +// DatabasePrincipalAssignmentsClientAPI contains the set of methods on the DatabasePrincipalAssignmentsClient type. +type DatabasePrincipalAssignmentsClientAPI interface { + CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName kusto.DatabasePrincipalAssignmentCheckNameRequest) (result kusto.CheckNameResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string, parameters kusto.DatabasePrincipalAssignment) (result kusto.DatabasePrincipalAssignmentsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string) (result kusto.DatabasePrincipalAssignmentsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string) (result kusto.DatabasePrincipalAssignment, err error) + List(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result kusto.DatabasePrincipalAssignmentListResult, err error) +} + +var _ DatabasePrincipalAssignmentsClientAPI = (*kusto.DatabasePrincipalAssignmentsClient)(nil) + +// ScriptsClientAPI contains the set of methods on the ScriptsClient type. +type ScriptsClientAPI interface { + CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName kusto.ScriptCheckNameRequest) (result kusto.CheckNameResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, parameters kusto.Script) (result kusto.ScriptsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string) (result kusto.ScriptsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string) (result kusto.Script, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result kusto.ScriptListResult, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, parameters kusto.Script) (result kusto.ScriptsUpdateFuture, err error) +} + +var _ ScriptsClientAPI = (*kusto.ScriptsClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, parameters kusto.PrivateEndpointConnection) (result kusto.PrivateEndpointConnectionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string) (result kusto.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string) (result kusto.PrivateEndpointConnection, err error) + List(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.PrivateEndpointConnectionListResult, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*kusto.PrivateEndpointConnectionsClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, clusterName string, privateLinkResourceName string) (result kusto.PrivateLinkResource, err error) + List(ctx context.Context, resourceGroupName string, clusterName string) (result kusto.PrivateLinkResourceListResult, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*kusto.PrivateLinkResourcesClient)(nil) + +// DataConnectionsClientAPI contains the set of methods on the DataConnectionsClient type. +type DataConnectionsClientAPI interface { + CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName kusto.DataConnectionCheckNameRequest) (result kusto.CheckNameResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters kusto.BasicDataConnection) (result kusto.DataConnectionsCreateOrUpdateFuture, err error) + DataConnectionValidationMethod(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters kusto.DataConnectionValidation) (result kusto.DataConnectionsDataConnectionValidationMethodFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (result kusto.DataConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string) (result kusto.DataConnectionModel, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result kusto.DataConnectionListResult, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters kusto.BasicDataConnection) (result kusto.DataConnectionsUpdateFuture, err error) +} + +var _ DataConnectionsClientAPI = (*kusto.DataConnectionsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result kusto.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result kusto.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*kusto.OperationsClient)(nil) + +// OperationsResultsClientAPI contains the set of methods on the OperationsResultsClient type. +type OperationsResultsClientAPI interface { + Get(ctx context.Context, location string, operationID string) (result kusto.OperationResult, err error) +} + +var _ OperationsResultsClientAPI = (*kusto.OperationsResultsClient)(nil) diff --git a/services/kusto/mgmt/2021-08-27/kusto/managedprivateendpoints.go b/services/kusto/mgmt/2021-08-27/kusto/managedprivateendpoints.go new file mode 100644 index 000000000000..323b6a05744f --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/managedprivateendpoints.go @@ -0,0 +1,534 @@ +package kusto + +// 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" +) + +// ManagedPrivateEndpointsClient is the the Azure Kusto management API provides a RESTful set of web services that +// interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and +// delete clusters and databases. +type ManagedPrivateEndpointsClient struct { + BaseClient +} + +// NewManagedPrivateEndpointsClient creates an instance of the ManagedPrivateEndpointsClient client. +func NewManagedPrivateEndpointsClient(subscriptionID string) ManagedPrivateEndpointsClient { + return NewManagedPrivateEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagedPrivateEndpointsClientWithBaseURI creates an instance of the ManagedPrivateEndpointsClient 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 NewManagedPrivateEndpointsClientWithBaseURI(baseURI string, subscriptionID string) ManagedPrivateEndpointsClient { + return ManagedPrivateEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks that the managed private endpoints resource name is valid and is not already in use. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// resourceName - the name of the resource. +func (client ManagedPrivateEndpointsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, resourceName ManagedPrivateEndpointsCheckNameRequest) (result CheckNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedPrivateEndpointsClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "resourceName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.ManagedPrivateEndpointsClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, resourceGroupName, clusterName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client ManagedPrivateEndpointsClient) CheckNameAvailabilityPreparer(ctx context.Context, resourceGroupName string, clusterName string, resourceName ManagedPrivateEndpointsCheckNameRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpointsCheckNameAvailability", pathParameters), + autorest.WithJSON(resourceName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedPrivateEndpointsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client ManagedPrivateEndpointsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate creates a managed private endpoint. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// managedPrivateEndpointName - the name of the managed private endpoint. +// parameters - the managed private endpoint parameters. +func (client ManagedPrivateEndpointsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, parameters ManagedPrivateEndpoint) (result ManagedPrivateEndpointsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedPrivateEndpointsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ManagedPrivateEndpointProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedPrivateEndpointProperties.PrivateLinkResourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ManagedPrivateEndpointProperties.GroupID", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("kusto.ManagedPrivateEndpointsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, managedPrivateEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ManagedPrivateEndpointsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, parameters ManagedPrivateEndpoint) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "managedPrivateEndpointName": autorest.Encode("path", managedPrivateEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = 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.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedPrivateEndpointsClient) CreateOrUpdateSender(req *http.Request) (future ManagedPrivateEndpointsCreateOrUpdateFuture, 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 ManagedPrivateEndpointsClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedPrivateEndpoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a managed private endpoint. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// managedPrivateEndpointName - the name of the managed private endpoint. +func (client ManagedPrivateEndpointsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string) (result ManagedPrivateEndpointsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedPrivateEndpointsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, managedPrivateEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ManagedPrivateEndpointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "managedPrivateEndpointName": autorest.Encode("path", managedPrivateEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}", 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 ManagedPrivateEndpointsClient) DeleteSender(req *http.Request) (future ManagedPrivateEndpointsDeleteFuture, 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 ManagedPrivateEndpointsClient) 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 gets a managed private endpoint. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// managedPrivateEndpointName - the name of the managed private endpoint. +func (client ManagedPrivateEndpointsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string) (result ManagedPrivateEndpoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedPrivateEndpointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, managedPrivateEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ManagedPrivateEndpointsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "managedPrivateEndpointName": autorest.Encode("path", managedPrivateEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}", 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 ManagedPrivateEndpointsClient) 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 ManagedPrivateEndpointsClient) GetResponder(resp *http.Response) (result ManagedPrivateEndpoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List returns the list of managed private endpoints. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client ManagedPrivateEndpointsClient) List(ctx context.Context, resourceGroupName string, clusterName string) (result ManagedPrivateEndpointListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedPrivateEndpointsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagedPrivateEndpointsClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints", 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 ManagedPrivateEndpointsClient) 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 ManagedPrivateEndpointsClient) ListResponder(resp *http.Response) (result ManagedPrivateEndpointListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a managed private endpoint. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// managedPrivateEndpointName - the name of the managed private endpoint. +// parameters - the managed private endpoint parameters. +func (client ManagedPrivateEndpointsClient) Update(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, parameters ManagedPrivateEndpoint) (result ManagedPrivateEndpointsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedPrivateEndpointsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, managedPrivateEndpointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ManagedPrivateEndpointsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, parameters ManagedPrivateEndpoint) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "managedPrivateEndpointName": autorest.Encode("path", managedPrivateEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedPrivateEndpointsClient) UpdateSender(req *http.Request) (future ManagedPrivateEndpointsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ManagedPrivateEndpointsClient) UpdateResponder(resp *http.Response) (result ManagedPrivateEndpoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/kusto/mgmt/2021-08-27/kusto/models.go b/services/kusto/mgmt/2021-08-27/kusto/models.go new file mode 100644 index 000000000000..ec2af4d9ac97 --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/models.go @@ -0,0 +1,4761 @@ +package kusto + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2021-08-27/kusto" + +// AcceptedAudiences represents an accepted audience trusted by the cluster. +type AcceptedAudiences struct { + // Value - GUID or valid URL representing an accepted audience. + Value *string `json:"value,omitempty"` +} + +// AttachedDatabaseConfiguration class representing an attached database configuration. +type AttachedDatabaseConfiguration struct { + autorest.Response `json:"-"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // AttachedDatabaseConfigurationProperties - The properties of the attached database configuration. + *AttachedDatabaseConfigurationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AttachedDatabaseConfiguration. +func (adc AttachedDatabaseConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if adc.Location != nil { + objectMap["location"] = adc.Location + } + if adc.AttachedDatabaseConfigurationProperties != nil { + objectMap["properties"] = adc.AttachedDatabaseConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AttachedDatabaseConfiguration struct. +func (adc *AttachedDatabaseConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + adc.Location = &location + } + case "properties": + if v != nil { + var attachedDatabaseConfigurationProperties AttachedDatabaseConfigurationProperties + err = json.Unmarshal(*v, &attachedDatabaseConfigurationProperties) + if err != nil { + return err + } + adc.AttachedDatabaseConfigurationProperties = &attachedDatabaseConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + adc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + adc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adc.Type = &typeVar + } + } + } + + return nil +} + +// AttachedDatabaseConfigurationListResult the list attached database configurations operation response. +type AttachedDatabaseConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - The list of attached database configurations. + Value *[]AttachedDatabaseConfiguration `json:"value,omitempty"` +} + +// AttachedDatabaseConfigurationProperties class representing the an attached database configuration +// properties of kind specific. +type AttachedDatabaseConfigurationProperties struct { + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // DatabaseName - The name of the database which you would like to attach, use * if you want to follow all current and future databases. + DatabaseName *string `json:"databaseName,omitempty"` + // ClusterResourceID - The resource id of the cluster where the databases you would like to attach reside. + ClusterResourceID *string `json:"clusterResourceId,omitempty"` + // AttachedDatabaseNames - READ-ONLY; The list of databases from the clusterResourceId which are currently attached to the cluster. + AttachedDatabaseNames *[]string `json:"attachedDatabaseNames,omitempty"` + // DefaultPrincipalsModificationKind - The default principals modification kind. Possible values include: 'DefaultPrincipalsModificationKindUnion', 'DefaultPrincipalsModificationKindReplace', 'DefaultPrincipalsModificationKindNone' + DefaultPrincipalsModificationKind DefaultPrincipalsModificationKind `json:"defaultPrincipalsModificationKind,omitempty"` + // TableLevelSharingProperties - Table level sharing specifications + TableLevelSharingProperties *TableLevelSharingProperties `json:"tableLevelSharingProperties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AttachedDatabaseConfigurationProperties. +func (adcp AttachedDatabaseConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if adcp.DatabaseName != nil { + objectMap["databaseName"] = adcp.DatabaseName + } + if adcp.ClusterResourceID != nil { + objectMap["clusterResourceId"] = adcp.ClusterResourceID + } + if adcp.DefaultPrincipalsModificationKind != "" { + objectMap["defaultPrincipalsModificationKind"] = adcp.DefaultPrincipalsModificationKind + } + if adcp.TableLevelSharingProperties != nil { + objectMap["tableLevelSharingProperties"] = adcp.TableLevelSharingProperties + } + return json.Marshal(objectMap) +} + +// AttachedDatabaseConfigurationsCheckNameRequest the result returned from a AttachedDatabaseConfigurations +// check name availability request. +type AttachedDatabaseConfigurationsCheckNameRequest struct { + // Name - Attached database resource name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, for instance Microsoft.Kusto/clusters/attachedDatabaseConfigurations. + Type *string `json:"type,omitempty"` +} + +// AttachedDatabaseConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type AttachedDatabaseConfigurationsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AttachedDatabaseConfigurationsClient) (AttachedDatabaseConfiguration, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AttachedDatabaseConfigurationsCreateOrUpdateFuture) 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 AttachedDatabaseConfigurationsCreateOrUpdateFuture.Result. +func (future *AttachedDatabaseConfigurationsCreateOrUpdateFuture) result(client AttachedDatabaseConfigurationsClient) (adc AttachedDatabaseConfiguration, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + adc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if adc.Response.Response, err = future.GetResult(sender); err == nil && adc.Response.Response.StatusCode != http.StatusNoContent { + adc, err = client.CreateOrUpdateResponder(adc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture", "Result", adc.Response.Response, "Failure responding to request") + } + } + return +} + +// AttachedDatabaseConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AttachedDatabaseConfigurationsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AttachedDatabaseConfigurationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AttachedDatabaseConfigurationsDeleteFuture) 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 AttachedDatabaseConfigurationsDeleteFuture.Result. +func (future *AttachedDatabaseConfigurationsDeleteFuture) result(client AttachedDatabaseConfigurationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.AttachedDatabaseConfigurationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AzureCapacity azure capacity definition. +type AzureCapacity struct { + // ScaleType - Scale type. Possible values include: 'Automatic', 'Manual', 'None' + ScaleType AzureScaleType `json:"scaleType,omitempty"` + // Minimum - Minimum allowed capacity. + Minimum *int32 `json:"minimum,omitempty"` + // Maximum - Maximum allowed capacity. + Maximum *int32 `json:"maximum,omitempty"` + // Default - The default capacity that would be used. + Default *int32 `json:"default,omitempty"` +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AzureResourceSku azure resource SKU definition. +type AzureResourceSku struct { + // ResourceType - Resource Namespace and Type. + ResourceType *string `json:"resourceType,omitempty"` + // Sku - The SKU details. + Sku *AzureSku `json:"sku,omitempty"` + // Capacity - The number of instances of the cluster. + Capacity *AzureCapacity `json:"capacity,omitempty"` +} + +// AzureSku azure SKU definition. +type AzureSku struct { + // Name - SKU name. Possible values include: 'StandardDS13V21TBPS', 'StandardDS13V22TBPS', 'StandardDS14V23TBPS', 'StandardDS14V24TBPS', 'StandardD13V2', 'StandardD14V2', 'StandardL8s', 'StandardL16s', 'StandardL8sV2', 'StandardL16sV2', 'StandardD11V2', 'StandardD12V2', 'StandardL4s', 'DevNoSLAStandardD11V2', 'StandardE64iV3', 'StandardE80idsV4', 'StandardE2aV4', 'StandardE4aV4', 'StandardE8aV4', 'StandardE16aV4', 'StandardE8asV41TBPS', 'StandardE8asV42TBPS', 'StandardE16asV43TBPS', 'StandardE16asV44TBPS', 'DevNoSLAStandardE2aV4' + Name AzureSkuName `json:"name,omitempty"` + // Capacity - The number of instances of the cluster. + Capacity *int32 `json:"capacity,omitempty"` + // Tier - SKU tier. Possible values include: 'Basic', 'Standard' + Tier AzureSkuTier `json:"tier,omitempty"` +} + +// CheckNameRequest the result returned from a database check name availability request. +type CheckNameRequest struct { + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: 'MicrosoftKustoclustersdatabases', 'MicrosoftKustoclustersattachedDatabaseConfigurations' + Type Type `json:"type,omitempty"` +} + +// CheckNameResult the result returned from a check name availability request. +type CheckNameResult struct { + autorest.Response `json:"-"` + // NameAvailable - Specifies a Boolean value that indicates if the name is available. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Name - The name that was checked. + Name *string `json:"name,omitempty"` + // Message - Message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated. + Message *string `json:"message,omitempty"` + // Reason - Message providing the reason why the given name is invalid. Possible values include: 'Invalid', 'AlreadyExists' + Reason Reason `json:"reason,omitempty"` +} + +// CloudError an error response from Kusto. +type CloudError struct { + // Error - An error response from Kusto. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from Kusto. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for displaying in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + +// Cluster class representing a Kusto cluster. +type Cluster struct { + autorest.Response `json:"-"` + // Sku - The SKU of the cluster. + Sku *AzureSku `json:"sku,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` + // Zones - The availability zones of the cluster. + Zones *[]string `json:"zones,omitempty"` + // Identity - The identity of the cluster, if configured. + Identity *Identity `json:"identity,omitempty"` + // ClusterProperties - The cluster properties. + *ClusterProperties `json:"properties,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.Sku != nil { + objectMap["sku"] = c.Sku + } + if c.Zones != nil { + objectMap["zones"] = c.Zones + } + if c.Identity != nil { + objectMap["identity"] = c.Identity + } + if c.ClusterProperties != nil { + objectMap["properties"] = c.ClusterProperties + } + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + if c.Location != nil { + objectMap["location"] = c.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Cluster struct. +func (c *Cluster) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku AzureSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + c.Sku = &sku + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + c.SystemData = &systemData + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + c.Zones = &zones + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + c.Identity = &identity + } + case "properties": + if v != nil { + var clusterProperties ClusterProperties + err = json.Unmarshal(*v, &clusterProperties) + if err != nil { + return err + } + c.ClusterProperties = &clusterProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + c.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ClusterCheckNameRequest the result returned from a cluster check name availability request. +type ClusterCheckNameRequest struct { + // Name - Cluster name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, Microsoft.Kusto/clusters. + Type *string `json:"type,omitempty"` +} + +// ClusterListResult the list Kusto clusters operation response. +type ClusterListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto clusters. + Value *[]Cluster `json:"value,omitempty"` +} + +// ClusterPrincipalAssignment class representing a cluster principal assignment. +type ClusterPrincipalAssignment struct { + autorest.Response `json:"-"` + // ClusterPrincipalProperties - The cluster principal. + *ClusterPrincipalProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterPrincipalAssignment. +func (cpa ClusterPrincipalAssignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpa.ClusterPrincipalProperties != nil { + objectMap["properties"] = cpa.ClusterPrincipalProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ClusterPrincipalAssignment struct. +func (cpa *ClusterPrincipalAssignment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var clusterPrincipalProperties ClusterPrincipalProperties + err = json.Unmarshal(*v, &clusterPrincipalProperties) + if err != nil { + return err + } + cpa.ClusterPrincipalProperties = &clusterPrincipalProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cpa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cpa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cpa.Type = &typeVar + } + } + } + + return nil +} + +// ClusterPrincipalAssignmentCheckNameRequest a principal assignment check name availability request. +type ClusterPrincipalAssignmentCheckNameRequest struct { + // Name - Principal Assignment resource name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, Microsoft.Kusto/clusters/principalAssignments. + Type *string `json:"type,omitempty"` +} + +// ClusterPrincipalAssignmentListResult the list Kusto cluster principal assignments operation response. +type ClusterPrincipalAssignmentListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto cluster principal assignments. + Value *[]ClusterPrincipalAssignment `json:"value,omitempty"` +} + +// ClusterPrincipalAssignmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ClusterPrincipalAssignmentsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClusterPrincipalAssignmentsClient) (ClusterPrincipalAssignment, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClusterPrincipalAssignmentsCreateOrUpdateFuture) 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 ClusterPrincipalAssignmentsCreateOrUpdateFuture.Result. +func (future *ClusterPrincipalAssignmentsCreateOrUpdateFuture) result(client ClusterPrincipalAssignmentsClient) (cpa ClusterPrincipalAssignment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cpa.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ClusterPrincipalAssignmentsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cpa.Response.Response, err = future.GetResult(sender); err == nil && cpa.Response.Response.StatusCode != http.StatusNoContent { + cpa, err = client.CreateOrUpdateResponder(cpa.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsCreateOrUpdateFuture", "Result", cpa.Response.Response, "Failure responding to request") + } + } + return +} + +// ClusterPrincipalAssignmentsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ClusterPrincipalAssignmentsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClusterPrincipalAssignmentsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClusterPrincipalAssignmentsDeleteFuture) 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 ClusterPrincipalAssignmentsDeleteFuture.Result. +func (future *ClusterPrincipalAssignmentsDeleteFuture) result(client ClusterPrincipalAssignmentsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ClusterPrincipalAssignmentsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ClusterPrincipalProperties a class representing cluster principal property. +type ClusterPrincipalProperties struct { + // PrincipalID - The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name. + PrincipalID *string `json:"principalId,omitempty"` + // Role - Cluster principal role. Possible values include: 'AllDatabasesAdmin', 'AllDatabasesViewer' + Role ClusterPrincipalRole `json:"role,omitempty"` + // TenantID - The tenant id of the principal + TenantID *string `json:"tenantId,omitempty"` + // PrincipalType - Principal type. Possible values include: 'PrincipalTypeApp', 'PrincipalTypeGroup', 'PrincipalTypeUser' + PrincipalType PrincipalType `json:"principalType,omitempty"` + // TenantName - READ-ONLY; The tenant name of the principal + TenantName *string `json:"tenantName,omitempty"` + // PrincipalName - READ-ONLY; The principal name + PrincipalName *string `json:"principalName,omitempty"` + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterPrincipalProperties. +func (cpp ClusterPrincipalProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpp.PrincipalID != nil { + objectMap["principalId"] = cpp.PrincipalID + } + if cpp.Role != "" { + objectMap["role"] = cpp.Role + } + if cpp.TenantID != nil { + objectMap["tenantId"] = cpp.TenantID + } + if cpp.PrincipalType != "" { + objectMap["principalType"] = cpp.PrincipalType + } + return json.Marshal(objectMap) +} + +// ClusterProperties class representing the Kusto cluster properties. +type ClusterProperties struct { + // State - READ-ONLY; The state of the resource. Possible values include: 'StateCreating', 'StateUnavailable', 'StateRunning', 'StateDeleting', 'StateDeleted', 'StateStopping', 'StateStopped', 'StateStarting', 'StateUpdating' + State State `json:"state,omitempty"` + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // URI - READ-ONLY; The cluster URI. + URI *string `json:"uri,omitempty"` + // DataIngestionURI - READ-ONLY; The cluster data ingestion URI. + DataIngestionURI *string `json:"dataIngestionUri,omitempty"` + // StateReason - READ-ONLY; The reason for the cluster's current state. + StateReason *string `json:"stateReason,omitempty"` + // TrustedExternalTenants - The cluster's external tenants. + TrustedExternalTenants *[]TrustedExternalTenant `json:"trustedExternalTenants,omitempty"` + // OptimizedAutoscale - Optimized auto scale definition. + OptimizedAutoscale *OptimizedAutoscale `json:"optimizedAutoscale,omitempty"` + // EnableDiskEncryption - A boolean value that indicates if the cluster's disks are encrypted. + EnableDiskEncryption *bool `json:"enableDiskEncryption,omitempty"` + // EnableStreamingIngest - A boolean value that indicates if the streaming ingest is enabled. + EnableStreamingIngest *bool `json:"enableStreamingIngest,omitempty"` + // VirtualNetworkConfiguration - Virtual network definition. + VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` + // KeyVaultProperties - KeyVault properties for the cluster encryption. + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + // EnablePurge - A boolean value that indicates if the purge operations are enabled. + EnablePurge *bool `json:"enablePurge,omitempty"` + // LanguageExtensions - READ-ONLY; List of the cluster's language extensions. + LanguageExtensions *LanguageExtensionsList `json:"languageExtensions,omitempty"` + // EnableDoubleEncryption - A boolean value that indicates if double encryption is enabled. + EnableDoubleEncryption *bool `json:"enableDoubleEncryption,omitempty"` + // PublicNetworkAccess - Public network access to the cluster is enabled by default. When disabled, only private endpoint connection to the cluster is allowed. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // AllowedIPRangeList - The list of ips in the format of CIDR allowed to connect to the cluster. + AllowedIPRangeList *[]string `json:"allowedIpRangeList,omitempty"` + // EngineType - The engine type. Possible values include: 'V2', 'V3' + EngineType EngineType `json:"engineType,omitempty"` + // AcceptedAudiences - The cluster's accepted audiences. + AcceptedAudiences *[]AcceptedAudiences `json:"acceptedAudiences,omitempty"` + // EnableAutoStop - A boolean value that indicates if the cluster could be automatically stopped (due to lack of data or no activity for many days). + EnableAutoStop *bool `json:"enableAutoStop,omitempty"` + // RestrictOutboundNetworkAccess - Whether or not to restrict outbound network access. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + RestrictOutboundNetworkAccess ClusterNetworkAccessFlag `json:"restrictOutboundNetworkAccess,omitempty"` + // AllowedFqdnList - List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. + AllowedFqdnList *[]string `json:"allowedFqdnList,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterProperties. +func (cp ClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.TrustedExternalTenants != nil { + objectMap["trustedExternalTenants"] = cp.TrustedExternalTenants + } + if cp.OptimizedAutoscale != nil { + objectMap["optimizedAutoscale"] = cp.OptimizedAutoscale + } + if cp.EnableDiskEncryption != nil { + objectMap["enableDiskEncryption"] = cp.EnableDiskEncryption + } + if cp.EnableStreamingIngest != nil { + objectMap["enableStreamingIngest"] = cp.EnableStreamingIngest + } + if cp.VirtualNetworkConfiguration != nil { + objectMap["virtualNetworkConfiguration"] = cp.VirtualNetworkConfiguration + } + if cp.KeyVaultProperties != nil { + objectMap["keyVaultProperties"] = cp.KeyVaultProperties + } + if cp.EnablePurge != nil { + objectMap["enablePurge"] = cp.EnablePurge + } + if cp.EnableDoubleEncryption != nil { + objectMap["enableDoubleEncryption"] = cp.EnableDoubleEncryption + } + if cp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = cp.PublicNetworkAccess + } + if cp.AllowedIPRangeList != nil { + objectMap["allowedIpRangeList"] = cp.AllowedIPRangeList + } + if cp.EngineType != "" { + objectMap["engineType"] = cp.EngineType + } + if cp.AcceptedAudiences != nil { + objectMap["acceptedAudiences"] = cp.AcceptedAudiences + } + if cp.EnableAutoStop != nil { + objectMap["enableAutoStop"] = cp.EnableAutoStop + } + if cp.RestrictOutboundNetworkAccess != "" { + objectMap["restrictOutboundNetworkAccess"] = cp.RestrictOutboundNetworkAccess + } + if cp.AllowedFqdnList != nil { + objectMap["allowedFqdnList"] = cp.AllowedFqdnList + } + return json.Marshal(objectMap) +} + +// ClustersAddLanguageExtensionsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ClustersAddLanguageExtensionsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersAddLanguageExtensionsFuture) 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 ClustersAddLanguageExtensionsFuture.Result. +func (future *ClustersAddLanguageExtensionsFuture) result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersAddLanguageExtensionsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ClustersAddLanguageExtensionsFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ClustersCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (Cluster, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersCreateOrUpdateFuture) 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 ClustersCreateOrUpdateFuture.Result. +func (future *ClustersCreateOrUpdateFuture) result(client ClustersClient) (c Cluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + c.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ClustersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { + c, err = client.CreateOrUpdateResponder(c.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersCreateOrUpdateFuture", "Result", c.Response.Response, "Failure responding to request") + } + } + return +} + +// ClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ClustersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersDeleteFuture) 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 ClustersDeleteFuture.Result. +func (future *ClustersDeleteFuture) result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersDetachFollowerDatabasesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ClustersDetachFollowerDatabasesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersDetachFollowerDatabasesFuture) 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 ClustersDetachFollowerDatabasesFuture.Result. +func (future *ClustersDetachFollowerDatabasesFuture) result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersDetachFollowerDatabasesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ClustersDetachFollowerDatabasesFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersDiagnoseVirtualNetworkFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ClustersDiagnoseVirtualNetworkFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (DiagnoseVirtualNetworkResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersDiagnoseVirtualNetworkFuture) 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 ClustersDiagnoseVirtualNetworkFuture.Result. +func (future *ClustersDiagnoseVirtualNetworkFuture) result(client ClustersClient) (dvnr DiagnoseVirtualNetworkResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersDiagnoseVirtualNetworkFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dvnr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ClustersDiagnoseVirtualNetworkFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dvnr.Response.Response, err = future.GetResult(sender); err == nil && dvnr.Response.Response.StatusCode != http.StatusNoContent { + dvnr, err = client.DiagnoseVirtualNetworkResponder(dvnr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersDiagnoseVirtualNetworkFuture", "Result", dvnr.Response.Response, "Failure responding to request") + } + } + return +} + +// ClustersRemoveLanguageExtensionsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ClustersRemoveLanguageExtensionsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersRemoveLanguageExtensionsFuture) 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 ClustersRemoveLanguageExtensionsFuture.Result. +func (future *ClustersRemoveLanguageExtensionsFuture) result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersRemoveLanguageExtensionsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ClustersRemoveLanguageExtensionsFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ClustersStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersStartFuture) 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 ClustersStartFuture.Result. +func (future *ClustersStartFuture) result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ClustersStartFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ClustersStopFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersStopFuture) 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 ClustersStopFuture.Result. +func (future *ClustersStopFuture) result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ClustersStopFuture") + return + } + ar.Response = future.Response() + return +} + +// ClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ClustersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ClustersClient) (Cluster, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ClustersUpdateFuture) 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 ClustersUpdateFuture.Result. +func (future *ClustersUpdateFuture) result(client ClustersClient) (c Cluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + c.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ClustersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { + c, err = client.UpdateResponder(c.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ClustersUpdateFuture", "Result", c.Response.Response, "Failure responding to request") + } + } + return +} + +// ClusterUpdate class representing an update to a Kusto cluster. +type ClusterUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Sku - The SKU of the cluster. + Sku *AzureSku `json:"sku,omitempty"` + // Identity - The identity of the cluster, if configured. + Identity *Identity `json:"identity,omitempty"` + // ClusterProperties - The cluster properties. + *ClusterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterUpdate. +func (cu ClusterUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cu.Tags != nil { + objectMap["tags"] = cu.Tags + } + if cu.Location != nil { + objectMap["location"] = cu.Location + } + if cu.Sku != nil { + objectMap["sku"] = cu.Sku + } + if cu.Identity != nil { + objectMap["identity"] = cu.Identity + } + if cu.ClusterProperties != nil { + objectMap["properties"] = cu.ClusterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ClusterUpdate struct. +func (cu *ClusterUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cu.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cu.Location = &location + } + case "sku": + if v != nil { + var sku AzureSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + cu.Sku = &sku + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + cu.Identity = &identity + } + case "properties": + if v != nil { + var clusterProperties ClusterProperties + err = json.Unmarshal(*v, &clusterProperties) + if err != nil { + return err + } + cu.ClusterProperties = &clusterProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cu.Type = &typeVar + } + } + } + + return nil +} + +// BasicDatabase class representing a Kusto database. +type BasicDatabase interface { + AsReadWriteDatabase() (*ReadWriteDatabase, bool) + AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) + AsDatabase() (*Database, bool) +} + +// Database class representing a Kusto database. +type Database struct { + autorest.Response `json:"-"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicDatabase(body []byte) (BasicDatabase, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindReadWrite): + var rwd ReadWriteDatabase + err := json.Unmarshal(body, &rwd) + return rwd, err + case string(KindReadOnlyFollowing): + var rofd ReadOnlyFollowingDatabase + err := json.Unmarshal(body, &rofd) + return rofd, err + default: + var d Database + err := json.Unmarshal(body, &d) + return d, err + } +} +func unmarshalBasicDatabaseArray(body []byte) ([]BasicDatabase, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dArray := make([]BasicDatabase, len(rawMessages)) + + for index, rawMessage := range rawMessages { + d, err := unmarshalBasicDatabase(*rawMessage) + if err != nil { + return nil, err + } + dArray[index] = d + } + return dArray, nil +} + +// MarshalJSON is the custom marshaler for Database. +func (d Database) MarshalJSON() ([]byte, error) { + d.Kind = KindDatabase + objectMap := make(map[string]interface{}) + if d.Location != nil { + objectMap["location"] = d.Location + } + if d.Kind != "" { + objectMap["kind"] = d.Kind + } + return json.Marshal(objectMap) +} + +// AsReadWriteDatabase is the BasicDatabase implementation for Database. +func (d Database) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { + return nil, false +} + +// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for Database. +func (d Database) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { + return nil, false +} + +// AsDatabase is the BasicDatabase implementation for Database. +func (d Database) AsDatabase() (*Database, bool) { + return &d, true +} + +// AsBasicDatabase is the BasicDatabase implementation for Database. +func (d Database) AsBasicDatabase() (BasicDatabase, bool) { + return &d, true +} + +// DatabaseListResult the list Kusto databases operation response. +type DatabaseListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto databases. + Value *[]BasicDatabase `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseListResult struct. +func (dlr *DatabaseListResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "value": + if v != nil { + value, err := unmarshalBasicDatabaseArray(*v) + if err != nil { + return err + } + dlr.Value = &value + } + } + } + + return nil +} + +// DatabaseModel ... +type DatabaseModel struct { + autorest.Response `json:"-"` + Value BasicDatabase `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DatabaseModel struct. +func (dm *DatabaseModel) UnmarshalJSON(body []byte) error { + d, err := unmarshalBasicDatabase(body) + if err != nil { + return err + } + dm.Value = d + + return nil +} + +// DatabasePrincipal a class representing database principal entity. +type DatabasePrincipal struct { + // Role - Database principal role. Possible values include: 'DatabasePrincipalRoleAdmin', 'DatabasePrincipalRoleIngestor', 'DatabasePrincipalRoleMonitor', 'DatabasePrincipalRoleUser', 'DatabasePrincipalRoleUnrestrictedViewer', 'DatabasePrincipalRoleViewer' + Role DatabasePrincipalRole `json:"role,omitempty"` + // Name - Database principal name. + Name *string `json:"name,omitempty"` + // Type - Database principal type. Possible values include: 'DatabasePrincipalTypeApp', 'DatabasePrincipalTypeGroup', 'DatabasePrincipalTypeUser' + Type DatabasePrincipalType `json:"type,omitempty"` + // Fqn - Database principal fully qualified name. + Fqn *string `json:"fqn,omitempty"` + // Email - Database principal email if exists. + Email *string `json:"email,omitempty"` + // AppID - Application id - relevant only for application principal type. + AppID *string `json:"appId,omitempty"` + // TenantName - READ-ONLY; The tenant name of the principal + TenantName *string `json:"tenantName,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabasePrincipal. +func (dp DatabasePrincipal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.Role != "" { + objectMap["role"] = dp.Role + } + if dp.Name != nil { + objectMap["name"] = dp.Name + } + if dp.Type != "" { + objectMap["type"] = dp.Type + } + if dp.Fqn != nil { + objectMap["fqn"] = dp.Fqn + } + if dp.Email != nil { + objectMap["email"] = dp.Email + } + if dp.AppID != nil { + objectMap["appId"] = dp.AppID + } + return json.Marshal(objectMap) +} + +// DatabasePrincipalAssignment class representing a database principal assignment. +type DatabasePrincipalAssignment struct { + autorest.Response `json:"-"` + // DatabasePrincipalProperties - The database principal. + *DatabasePrincipalProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabasePrincipalAssignment. +func (dpa DatabasePrincipalAssignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpa.DatabasePrincipalProperties != nil { + objectMap["properties"] = dpa.DatabasePrincipalProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DatabasePrincipalAssignment struct. +func (dpa *DatabasePrincipalAssignment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var databasePrincipalProperties DatabasePrincipalProperties + err = json.Unmarshal(*v, &databasePrincipalProperties) + if err != nil { + return err + } + dpa.DatabasePrincipalProperties = &databasePrincipalProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dpa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dpa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dpa.Type = &typeVar + } + } + } + + return nil +} + +// DatabasePrincipalAssignmentCheckNameRequest a principal assignment check name availability request. +type DatabasePrincipalAssignmentCheckNameRequest struct { + // Name - Principal Assignment resource name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. + Type *string `json:"type,omitempty"` +} + +// DatabasePrincipalAssignmentListResult the list Kusto database principal assignments operation response. +type DatabasePrincipalAssignmentListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto database principal assignments. + Value *[]DatabasePrincipalAssignment `json:"value,omitempty"` +} + +// DatabasePrincipalAssignmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type DatabasePrincipalAssignmentsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabasePrincipalAssignmentsClient) (DatabasePrincipalAssignment, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabasePrincipalAssignmentsCreateOrUpdateFuture) 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 DatabasePrincipalAssignmentsCreateOrUpdateFuture.Result. +func (future *DatabasePrincipalAssignmentsCreateOrUpdateFuture) result(client DatabasePrincipalAssignmentsClient) (dpa DatabasePrincipalAssignment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dpa.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.DatabasePrincipalAssignmentsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dpa.Response.Response, err = future.GetResult(sender); err == nil && dpa.Response.Response.StatusCode != http.StatusNoContent { + dpa, err = client.CreateOrUpdateResponder(dpa.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsCreateOrUpdateFuture", "Result", dpa.Response.Response, "Failure responding to request") + } + } + return +} + +// DatabasePrincipalAssignmentsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DatabasePrincipalAssignmentsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabasePrincipalAssignmentsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabasePrincipalAssignmentsDeleteFuture) 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 DatabasePrincipalAssignmentsDeleteFuture.Result. +func (future *DatabasePrincipalAssignmentsDeleteFuture) result(client DatabasePrincipalAssignmentsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.DatabasePrincipalAssignmentsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabasePrincipalListRequest the list Kusto database principals operation request. +type DatabasePrincipalListRequest struct { + // Value - The list of Kusto database principals. + Value *[]DatabasePrincipal `json:"value,omitempty"` +} + +// DatabasePrincipalListResult the list Kusto database principals operation response. +type DatabasePrincipalListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto database principals. + Value *[]DatabasePrincipal `json:"value,omitempty"` +} + +// DatabasePrincipalProperties a class representing database principal property. +type DatabasePrincipalProperties struct { + // PrincipalID - The principal ID assigned to the database principal. It can be a user email, application ID, or security group name. + PrincipalID *string `json:"principalId,omitempty"` + // Role - Database principal role. Possible values include: 'DatabasePrincipalRoleAdmin', 'DatabasePrincipalRoleIngestor', 'DatabasePrincipalRoleMonitor', 'DatabasePrincipalRoleUser', 'DatabasePrincipalRoleUnrestrictedViewer', 'DatabasePrincipalRoleViewer' + Role DatabasePrincipalRole `json:"role,omitempty"` + // TenantID - The tenant id of the principal + TenantID *string `json:"tenantId,omitempty"` + // PrincipalType - Principal type. Possible values include: 'PrincipalTypeApp', 'PrincipalTypeGroup', 'PrincipalTypeUser' + PrincipalType PrincipalType `json:"principalType,omitempty"` + // TenantName - READ-ONLY; The tenant name of the principal + TenantName *string `json:"tenantName,omitempty"` + // PrincipalName - READ-ONLY; The principal name + PrincipalName *string `json:"principalName,omitempty"` + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabasePrincipalProperties. +func (dpp DatabasePrincipalProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpp.PrincipalID != nil { + objectMap["principalId"] = dpp.PrincipalID + } + if dpp.Role != "" { + objectMap["role"] = dpp.Role + } + if dpp.TenantID != nil { + objectMap["tenantId"] = dpp.TenantID + } + if dpp.PrincipalType != "" { + objectMap["principalType"] = dpp.PrincipalType + } + return json.Marshal(objectMap) +} + +// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabasesClient) (DatabaseModel, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabasesCreateOrUpdateFuture) 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 DatabasesCreateOrUpdateFuture.Result. +func (future *DatabasesCreateOrUpdateFuture) result(client DatabasesClient) (dm DatabaseModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.DatabasesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent { + dm, err = client.CreateOrUpdateResponder(dm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesCreateOrUpdateFuture", "Result", dm.Response.Response, "Failure responding to request") + } + } + return +} + +// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabasesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabasesDeleteFuture) 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 DatabasesDeleteFuture.Result. +func (future *DatabasesDeleteFuture) result(client DatabasesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.DatabasesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DatabaseStatistics a class that contains database statistics information. +type DatabaseStatistics struct { + // Size - The database size - the total size of compressed data and index in bytes. + Size *float64 `json:"size,omitempty"` +} + +// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DatabasesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DatabasesClient) (DatabaseModel, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DatabasesUpdateFuture) 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 DatabasesUpdateFuture.Result. +func (future *DatabasesUpdateFuture) result(client DatabasesClient) (dm DatabaseModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.DatabasesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent { + dm, err = client.UpdateResponder(dm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DatabasesUpdateFuture", "Result", dm.Response.Response, "Failure responding to request") + } + } + return +} + +// BasicDataConnection class representing an data connection. +type BasicDataConnection interface { + AsEventHubDataConnection() (*EventHubDataConnection, bool) + AsIotHubDataConnection() (*IotHubDataConnection, bool) + AsEventGridDataConnection() (*EventGridDataConnection, bool) + AsDataConnection() (*DataConnection, bool) +} + +// DataConnection class representing an data connection. +type DataConnection struct { + autorest.Response `json:"-"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' + Kind KindBasicDataConnection `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicDataConnection(body []byte) (BasicDataConnection, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindEventHub): + var ehdc EventHubDataConnection + err := json.Unmarshal(body, &ehdc) + return ehdc, err + case string(KindIotHub): + var ihdc IotHubDataConnection + err := json.Unmarshal(body, &ihdc) + return ihdc, err + case string(KindEventGrid): + var egdc EventGridDataConnection + err := json.Unmarshal(body, &egdc) + return egdc, err + default: + var dc DataConnection + err := json.Unmarshal(body, &dc) + return dc, err + } +} +func unmarshalBasicDataConnectionArray(body []byte) ([]BasicDataConnection, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dcArray := make([]BasicDataConnection, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dc, err := unmarshalBasicDataConnection(*rawMessage) + if err != nil { + return nil, err + } + dcArray[index] = dc + } + return dcArray, nil +} + +// MarshalJSON is the custom marshaler for DataConnection. +func (dc DataConnection) MarshalJSON() ([]byte, error) { + dc.Kind = KindDataConnection + objectMap := make(map[string]interface{}) + if dc.Location != nil { + objectMap["location"] = dc.Location + } + if dc.Kind != "" { + objectMap["kind"] = dc.Kind + } + return json.Marshal(objectMap) +} + +// AsEventHubDataConnection is the BasicDataConnection implementation for DataConnection. +func (dc DataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { + return nil, false +} + +// AsIotHubDataConnection is the BasicDataConnection implementation for DataConnection. +func (dc DataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { + return nil, false +} + +// AsEventGridDataConnection is the BasicDataConnection implementation for DataConnection. +func (dc DataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { + return nil, false +} + +// AsDataConnection is the BasicDataConnection implementation for DataConnection. +func (dc DataConnection) AsDataConnection() (*DataConnection, bool) { + return &dc, true +} + +// AsBasicDataConnection is the BasicDataConnection implementation for DataConnection. +func (dc DataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { + return &dc, true +} + +// DataConnectionCheckNameRequest a data connection check name availability request. +type DataConnectionCheckNameRequest struct { + // Name - Data Connection name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. + Type *string `json:"type,omitempty"` +} + +// DataConnectionListResult the list Kusto data connections operation response. +type DataConnectionListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto data connections. + Value *[]BasicDataConnection `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataConnectionListResult struct. +func (dclr *DataConnectionListResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "value": + if v != nil { + value, err := unmarshalBasicDataConnectionArray(*v) + if err != nil { + return err + } + dclr.Value = &value + } + } + } + + return nil +} + +// DataConnectionModel ... +type DataConnectionModel struct { + autorest.Response `json:"-"` + Value BasicDataConnection `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataConnectionModel struct. +func (dcm *DataConnectionModel) UnmarshalJSON(body []byte) error { + dc, err := unmarshalBasicDataConnection(body) + if err != nil { + return err + } + dcm.Value = dc + + return nil +} + +// DataConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DataConnectionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DataConnectionsClient) (DataConnectionModel, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DataConnectionsCreateOrUpdateFuture) 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 DataConnectionsCreateOrUpdateFuture.Result. +func (future *DataConnectionsCreateOrUpdateFuture) result(client DataConnectionsClient) (dcm DataConnectionModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dcm.Response.Response, err = future.GetResult(sender); err == nil && dcm.Response.Response.StatusCode != http.StatusNoContent { + dcm, err = client.CreateOrUpdateResponder(dcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsCreateOrUpdateFuture", "Result", dcm.Response.Response, "Failure responding to request") + } + } + return +} + +// DataConnectionsDataConnectionValidationMethodFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type DataConnectionsDataConnectionValidationMethodFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DataConnectionsClient) (DataConnectionValidationListResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DataConnectionsDataConnectionValidationMethodFuture) 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 DataConnectionsDataConnectionValidationMethodFuture.Result. +func (future *DataConnectionsDataConnectionValidationMethodFuture) result(client DataConnectionsClient) (dcvlr DataConnectionValidationListResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsDataConnectionValidationMethodFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dcvlr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsDataConnectionValidationMethodFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dcvlr.Response.Response, err = future.GetResult(sender); err == nil && dcvlr.Response.Response.StatusCode != http.StatusNoContent { + dcvlr, err = client.DataConnectionValidationMethodResponder(dcvlr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsDataConnectionValidationMethodFuture", "Result", dcvlr.Response.Response, "Failure responding to request") + } + } + return +} + +// DataConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DataConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DataConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DataConnectionsDeleteFuture) 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 DataConnectionsDeleteFuture.Result. +func (future *DataConnectionsDeleteFuture) result(client DataConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DataConnectionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DataConnectionsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DataConnectionsClient) (DataConnectionModel, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DataConnectionsUpdateFuture) 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 DataConnectionsUpdateFuture.Result. +func (future *DataConnectionsUpdateFuture) result(client DataConnectionsClient) (dcm DataConnectionModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dcm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dcm.Response.Response, err = future.GetResult(sender); err == nil && dcm.Response.Response.StatusCode != http.StatusNoContent { + dcm, err = client.UpdateResponder(dcm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.DataConnectionsUpdateFuture", "Result", dcm.Response.Response, "Failure responding to request") + } + } + return +} + +// DataConnectionValidation class representing an data connection validation. +type DataConnectionValidation struct { + // DataConnectionName - The name of the data connection. + DataConnectionName *string `json:"dataConnectionName,omitempty"` + // Properties - The data connection properties to validate. + Properties BasicDataConnection `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataConnectionValidation struct. +func (dcv *DataConnectionValidation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "dataConnectionName": + if v != nil { + var dataConnectionName string + err = json.Unmarshal(*v, &dataConnectionName) + if err != nil { + return err + } + dcv.DataConnectionName = &dataConnectionName + } + case "properties": + if v != nil { + properties, err := unmarshalBasicDataConnection(*v) + if err != nil { + return err + } + dcv.Properties = properties + } + } + } + + return nil +} + +// DataConnectionValidationListResult the list Kusto data connection validation result. +type DataConnectionValidationListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto data connection validation errors. + Value *[]DataConnectionValidationResult `json:"value,omitempty"` +} + +// DataConnectionValidationResult the result returned from a data connection validation request. +type DataConnectionValidationResult struct { + // ErrorMessage - A message which indicates a problem in data connection validation. + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// DiagnoseVirtualNetworkResult ... +type DiagnoseVirtualNetworkResult struct { + autorest.Response `json:"-"` + // Findings - The list of network connectivity diagnostic finding + Findings *[]string `json:"findings,omitempty"` +} + +// EndpointDependency a domain name that a service is reached at, including details of the current +// connection status. +type EndpointDependency struct { + // DomainName - The domain name of the dependency. + DomainName *string `json:"domainName,omitempty"` + // EndpointDetails - The ports used when connecting to DomainName. + EndpointDetails *[]EndpointDetail `json:"endpointDetails,omitempty"` +} + +// EndpointDetail current TCP connectivity information from the Kusto cluster to a single endpoint. +type EndpointDetail struct { + // Port - The port an endpoint is connected to. + Port *int32 `json:"port,omitempty"` +} + +// EventGridConnectionProperties class representing the Kusto event grid connection properties. +type EventGridConnectionProperties struct { + // StorageAccountResourceID - The resource ID of the storage account where the data resides. + StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` + // EventHubResourceID - The resource ID where the event grid is configured to send events. + EventHubResourceID *string `json:"eventHubResourceId,omitempty"` + // ConsumerGroup - The event hub consumer group. + ConsumerGroup *string `json:"consumerGroup,omitempty"` + // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. + TableName *string `json:"tableName,omitempty"` + // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + MappingRuleName *string `json:"mappingRuleName,omitempty"` + // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE' + DataFormat EventGridDataFormat `json:"dataFormat,omitempty"` + // IgnoreFirstRecord - A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file + IgnoreFirstRecord *bool `json:"ignoreFirstRecord,omitempty"` + // BlobStorageEventType - The name of blob storage event type to process. Possible values include: 'MicrosoftStorageBlobCreated', 'MicrosoftStorageBlobRenamed' + BlobStorageEventType BlobStorageEventType `json:"blobStorageEventType,omitempty"` + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventGridConnectionProperties. +func (egcp EventGridConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if egcp.StorageAccountResourceID != nil { + objectMap["storageAccountResourceId"] = egcp.StorageAccountResourceID + } + if egcp.EventHubResourceID != nil { + objectMap["eventHubResourceId"] = egcp.EventHubResourceID + } + if egcp.ConsumerGroup != nil { + objectMap["consumerGroup"] = egcp.ConsumerGroup + } + if egcp.TableName != nil { + objectMap["tableName"] = egcp.TableName + } + if egcp.MappingRuleName != nil { + objectMap["mappingRuleName"] = egcp.MappingRuleName + } + if egcp.DataFormat != "" { + objectMap["dataFormat"] = egcp.DataFormat + } + if egcp.IgnoreFirstRecord != nil { + objectMap["ignoreFirstRecord"] = egcp.IgnoreFirstRecord + } + if egcp.BlobStorageEventType != "" { + objectMap["blobStorageEventType"] = egcp.BlobStorageEventType + } + return json.Marshal(objectMap) +} + +// EventGridDataConnection class representing an Event Grid data connection. +type EventGridDataConnection struct { + // EventGridConnectionProperties - The properties of the Event Grid data connection. + *EventGridConnectionProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' + Kind KindBasicDataConnection `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventGridDataConnection. +func (egdc EventGridDataConnection) MarshalJSON() ([]byte, error) { + egdc.Kind = KindEventGrid + objectMap := make(map[string]interface{}) + if egdc.EventGridConnectionProperties != nil { + objectMap["properties"] = egdc.EventGridConnectionProperties + } + if egdc.Location != nil { + objectMap["location"] = egdc.Location + } + if egdc.Kind != "" { + objectMap["kind"] = egdc.Kind + } + return json.Marshal(objectMap) +} + +// AsEventHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection. +func (egdc EventGridDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { + return nil, false +} + +// AsIotHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection. +func (egdc EventGridDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { + return nil, false +} + +// AsEventGridDataConnection is the BasicDataConnection implementation for EventGridDataConnection. +func (egdc EventGridDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { + return &egdc, true +} + +// AsDataConnection is the BasicDataConnection implementation for EventGridDataConnection. +func (egdc EventGridDataConnection) AsDataConnection() (*DataConnection, bool) { + return nil, false +} + +// AsBasicDataConnection is the BasicDataConnection implementation for EventGridDataConnection. +func (egdc EventGridDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { + return &egdc, true +} + +// UnmarshalJSON is the custom unmarshaler for EventGridDataConnection struct. +func (egdc *EventGridDataConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var eventGridConnectionProperties EventGridConnectionProperties + err = json.Unmarshal(*v, &eventGridConnectionProperties) + if err != nil { + return err + } + egdc.EventGridConnectionProperties = &eventGridConnectionProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + egdc.Location = &location + } + case "kind": + if v != nil { + var kind KindBasicDataConnection + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + egdc.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + egdc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + egdc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + egdc.Type = &typeVar + } + } + } + + return nil +} + +// EventHubConnectionProperties class representing the Kusto event hub connection properties. +type EventHubConnectionProperties struct { + // EventHubResourceID - The resource ID of the event hub to be used to create a data connection. + EventHubResourceID *string `json:"eventHubResourceId,omitempty"` + // ConsumerGroup - The event hub consumer group. + ConsumerGroup *string `json:"consumerGroup,omitempty"` + // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. + TableName *string `json:"tableName,omitempty"` + // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + MappingRuleName *string `json:"mappingRuleName,omitempty"` + // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'EventHubDataFormatMULTIJSON', 'EventHubDataFormatJSON', 'EventHubDataFormatCSV', 'EventHubDataFormatTSV', 'EventHubDataFormatSCSV', 'EventHubDataFormatSOHSV', 'EventHubDataFormatPSV', 'EventHubDataFormatTXT', 'EventHubDataFormatRAW', 'EventHubDataFormatSINGLEJSON', 'EventHubDataFormatAVRO', 'EventHubDataFormatTSVE', 'EventHubDataFormatPARQUET', 'EventHubDataFormatORC', 'EventHubDataFormatAPACHEAVRO', 'EventHubDataFormatW3CLOGFILE' + DataFormat EventHubDataFormat `json:"dataFormat,omitempty"` + // EventSystemProperties - System properties of the event hub + EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` + // Compression - The event hub messages compression type. Possible values include: 'CompressionNone', 'CompressionGZip' + Compression Compression `json:"compression,omitempty"` + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ManagedIdentityResourceID - The resource ID of a managed identity (system or user assigned) to be used to authenticate with event hub. + ManagedIdentityResourceID *string `json:"managedIdentityResourceId,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventHubConnectionProperties. +func (ehcp EventHubConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ehcp.EventHubResourceID != nil { + objectMap["eventHubResourceId"] = ehcp.EventHubResourceID + } + if ehcp.ConsumerGroup != nil { + objectMap["consumerGroup"] = ehcp.ConsumerGroup + } + if ehcp.TableName != nil { + objectMap["tableName"] = ehcp.TableName + } + if ehcp.MappingRuleName != nil { + objectMap["mappingRuleName"] = ehcp.MappingRuleName + } + if ehcp.DataFormat != "" { + objectMap["dataFormat"] = ehcp.DataFormat + } + if ehcp.EventSystemProperties != nil { + objectMap["eventSystemProperties"] = ehcp.EventSystemProperties + } + if ehcp.Compression != "" { + objectMap["compression"] = ehcp.Compression + } + if ehcp.ManagedIdentityResourceID != nil { + objectMap["managedIdentityResourceId"] = ehcp.ManagedIdentityResourceID + } + return json.Marshal(objectMap) +} + +// EventHubDataConnection class representing an event hub data connection. +type EventHubDataConnection struct { + // EventHubConnectionProperties - The Event Hub data connection properties to validate. + *EventHubConnectionProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' + Kind KindBasicDataConnection `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventHubDataConnection. +func (ehdc EventHubDataConnection) MarshalJSON() ([]byte, error) { + ehdc.Kind = KindEventHub + objectMap := make(map[string]interface{}) + if ehdc.EventHubConnectionProperties != nil { + objectMap["properties"] = ehdc.EventHubConnectionProperties + } + if ehdc.Location != nil { + objectMap["location"] = ehdc.Location + } + if ehdc.Kind != "" { + objectMap["kind"] = ehdc.Kind + } + return json.Marshal(objectMap) +} + +// AsEventHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection. +func (ehdc EventHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { + return &ehdc, true +} + +// AsIotHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection. +func (ehdc EventHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { + return nil, false +} + +// AsEventGridDataConnection is the BasicDataConnection implementation for EventHubDataConnection. +func (ehdc EventHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { + return nil, false +} + +// AsDataConnection is the BasicDataConnection implementation for EventHubDataConnection. +func (ehdc EventHubDataConnection) AsDataConnection() (*DataConnection, bool) { + return nil, false +} + +// AsBasicDataConnection is the BasicDataConnection implementation for EventHubDataConnection. +func (ehdc EventHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { + return &ehdc, true +} + +// UnmarshalJSON is the custom unmarshaler for EventHubDataConnection struct. +func (ehdc *EventHubDataConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var eventHubConnectionProperties EventHubConnectionProperties + err = json.Unmarshal(*v, &eventHubConnectionProperties) + if err != nil { + return err + } + ehdc.EventHubConnectionProperties = &eventHubConnectionProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ehdc.Location = &location + } + case "kind": + if v != nil { + var kind KindBasicDataConnection + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ehdc.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ehdc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ehdc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ehdc.Type = &typeVar + } + } + } + + return nil +} + +// FollowerDatabaseDefinition a class representing follower database request. +type FollowerDatabaseDefinition struct { + // ClusterResourceID - Resource id of the cluster that follows a database owned by this cluster. + ClusterResourceID *string `json:"clusterResourceId,omitempty"` + // AttachedDatabaseConfigurationName - Resource name of the attached database configuration in the follower cluster. + AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"` + // DatabaseName - READ-ONLY; The database name owned by this cluster that was followed. * in case following all databases. + DatabaseName *string `json:"databaseName,omitempty"` +} + +// MarshalJSON is the custom marshaler for FollowerDatabaseDefinition. +func (fdd FollowerDatabaseDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fdd.ClusterResourceID != nil { + objectMap["clusterResourceId"] = fdd.ClusterResourceID + } + if fdd.AttachedDatabaseConfigurationName != nil { + objectMap["attachedDatabaseConfigurationName"] = fdd.AttachedDatabaseConfigurationName + } + return json.Marshal(objectMap) +} + +// FollowerDatabaseListResult the list Kusto database principals operation response. +type FollowerDatabaseListResult struct { + autorest.Response `json:"-"` + // Value - The list of follower database result. + Value *[]FollowerDatabaseDefinition `json:"value,omitempty"` +} + +// Identity identity for the resource. +type Identity struct { + // PrincipalID - READ-ONLY; The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove all identities. Possible values include: 'IdentityTypeNone', 'IdentityTypeSystemAssigned', 'IdentityTypeUserAssigned', 'IdentityTypeSystemAssignedUserAssigned' + Type IdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with the Kusto cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.Type != "" { + objectMap["type"] = i.Type + } + if i.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = i.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// IdentityUserAssignedIdentitiesValue ... +type IdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityUserAssignedIdentitiesValue. +func (iAiv IdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// IotHubConnectionProperties class representing the Kusto Iot hub connection properties. +type IotHubConnectionProperties struct { + // IotHubResourceID - The resource ID of the Iot hub to be used to create a data connection. + IotHubResourceID *string `json:"iotHubResourceId,omitempty"` + // ConsumerGroup - The iot hub consumer group. + ConsumerGroup *string `json:"consumerGroup,omitempty"` + // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. + TableName *string `json:"tableName,omitempty"` + // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + MappingRuleName *string `json:"mappingRuleName,omitempty"` + // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'IotHubDataFormatMULTIJSON', 'IotHubDataFormatJSON', 'IotHubDataFormatCSV', 'IotHubDataFormatTSV', 'IotHubDataFormatSCSV', 'IotHubDataFormatSOHSV', 'IotHubDataFormatPSV', 'IotHubDataFormatTXT', 'IotHubDataFormatRAW', 'IotHubDataFormatSINGLEJSON', 'IotHubDataFormatAVRO', 'IotHubDataFormatTSVE', 'IotHubDataFormatPARQUET', 'IotHubDataFormatORC', 'IotHubDataFormatAPACHEAVRO', 'IotHubDataFormatW3CLOGFILE' + DataFormat IotHubDataFormat `json:"dataFormat,omitempty"` + // EventSystemProperties - System properties of the iot hub + EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` + // SharedAccessPolicyName - The name of the share access policy + SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"` + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubConnectionProperties. +func (ihcp IotHubConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ihcp.IotHubResourceID != nil { + objectMap["iotHubResourceId"] = ihcp.IotHubResourceID + } + if ihcp.ConsumerGroup != nil { + objectMap["consumerGroup"] = ihcp.ConsumerGroup + } + if ihcp.TableName != nil { + objectMap["tableName"] = ihcp.TableName + } + if ihcp.MappingRuleName != nil { + objectMap["mappingRuleName"] = ihcp.MappingRuleName + } + if ihcp.DataFormat != "" { + objectMap["dataFormat"] = ihcp.DataFormat + } + if ihcp.EventSystemProperties != nil { + objectMap["eventSystemProperties"] = ihcp.EventSystemProperties + } + if ihcp.SharedAccessPolicyName != nil { + objectMap["sharedAccessPolicyName"] = ihcp.SharedAccessPolicyName + } + return json.Marshal(objectMap) +} + +// IotHubDataConnection class representing an iot hub data connection. +type IotHubDataConnection struct { + // IotHubConnectionProperties - The Iot Hub data connection properties. + *IotHubConnectionProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' + Kind KindBasicDataConnection `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubDataConnection. +func (ihdc IotHubDataConnection) MarshalJSON() ([]byte, error) { + ihdc.Kind = KindIotHub + objectMap := make(map[string]interface{}) + if ihdc.IotHubConnectionProperties != nil { + objectMap["properties"] = ihdc.IotHubConnectionProperties + } + if ihdc.Location != nil { + objectMap["location"] = ihdc.Location + } + if ihdc.Kind != "" { + objectMap["kind"] = ihdc.Kind + } + return json.Marshal(objectMap) +} + +// AsEventHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection. +func (ihdc IotHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { + return nil, false +} + +// AsIotHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection. +func (ihdc IotHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { + return &ihdc, true +} + +// AsEventGridDataConnection is the BasicDataConnection implementation for IotHubDataConnection. +func (ihdc IotHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { + return nil, false +} + +// AsDataConnection is the BasicDataConnection implementation for IotHubDataConnection. +func (ihdc IotHubDataConnection) AsDataConnection() (*DataConnection, bool) { + return nil, false +} + +// AsBasicDataConnection is the BasicDataConnection implementation for IotHubDataConnection. +func (ihdc IotHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { + return &ihdc, true +} + +// UnmarshalJSON is the custom unmarshaler for IotHubDataConnection struct. +func (ihdc *IotHubDataConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var iotHubConnectionProperties IotHubConnectionProperties + err = json.Unmarshal(*v, &iotHubConnectionProperties) + if err != nil { + return err + } + ihdc.IotHubConnectionProperties = &iotHubConnectionProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ihdc.Location = &location + } + case "kind": + if v != nil { + var kind KindBasicDataConnection + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ihdc.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ihdc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ihdc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ihdc.Type = &typeVar + } + } + } + + return nil +} + +// KeyVaultProperties properties of the key vault. +type KeyVaultProperties struct { + // KeyName - The name of the key vault key. + KeyName *string `json:"keyName,omitempty"` + // KeyVersion - The version of the key vault key. + KeyVersion *string `json:"keyVersion,omitempty"` + // KeyVaultURI - The Uri of the key vault. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // UserIdentity - The user assigned identity (ARM resource id) that has access to the key. + UserIdentity *string `json:"userIdentity,omitempty"` +} + +// LanguageExtension the language extension object. +type LanguageExtension struct { + // LanguageExtensionName - The language extension name. Possible values include: 'PYTHON', 'R' + LanguageExtensionName LanguageExtensionName `json:"languageExtensionName,omitempty"` +} + +// LanguageExtensionsList the list of language extension objects. +type LanguageExtensionsList struct { + autorest.Response `json:"-"` + // Value - The list of language extensions. + Value *[]LanguageExtension `json:"value,omitempty"` +} + +// ListResourceSkusResult list of available SKUs for a Kusto Cluster. +type ListResourceSkusResult struct { + autorest.Response `json:"-"` + // Value - The collection of available SKUs for an existing resource. + Value *[]AzureResourceSku `json:"value,omitempty"` +} + +// ManagedPrivateEndpoint class representing a managed private endpoint. +type ManagedPrivateEndpoint struct { + autorest.Response `json:"-"` + // ManagedPrivateEndpointProperties - A managed private endpoint. + *ManagedPrivateEndpointProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedPrivateEndpoint. +func (mpe ManagedPrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mpe.ManagedPrivateEndpointProperties != nil { + objectMap["properties"] = mpe.ManagedPrivateEndpointProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedPrivateEndpoint struct. +func (mpe *ManagedPrivateEndpoint) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var managedPrivateEndpointProperties ManagedPrivateEndpointProperties + err = json.Unmarshal(*v, &managedPrivateEndpointProperties) + if err != nil { + return err + } + mpe.ManagedPrivateEndpointProperties = &managedPrivateEndpointProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + mpe.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mpe.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mpe.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mpe.Type = &typeVar + } + } + } + + return nil +} + +// ManagedPrivateEndpointListResult the list managed private endpoints operation response. +type ManagedPrivateEndpointListResult struct { + autorest.Response `json:"-"` + // Value - The list of managed private endpoints. + Value *[]ManagedPrivateEndpoint `json:"value,omitempty"` +} + +// ManagedPrivateEndpointProperties a class representing the properties of a managed private endpoint +// object. +type ManagedPrivateEndpointProperties struct { + // PrivateLinkResourceID - The ARM resource ID of the resource for which the managed private endpoint is created. + PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` + // PrivateLinkResourceRegion - The region of the resource to which the managed private endpoint is created. + PrivateLinkResourceRegion *string `json:"privateLinkResourceRegion,omitempty"` + // GroupID - The groupId in which the managed private endpoint is created. + GroupID *string `json:"groupId,omitempty"` + // RequestMessage - The user request message. + RequestMessage *string `json:"requestMessage,omitempty"` + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedPrivateEndpointProperties. +func (mpep ManagedPrivateEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mpep.PrivateLinkResourceID != nil { + objectMap["privateLinkResourceId"] = mpep.PrivateLinkResourceID + } + if mpep.PrivateLinkResourceRegion != nil { + objectMap["privateLinkResourceRegion"] = mpep.PrivateLinkResourceRegion + } + if mpep.GroupID != nil { + objectMap["groupId"] = mpep.GroupID + } + if mpep.RequestMessage != nil { + objectMap["requestMessage"] = mpep.RequestMessage + } + return json.Marshal(objectMap) +} + +// ManagedPrivateEndpointsCheckNameRequest the result returned from a managedPrivateEndpoints check name +// availability request. +type ManagedPrivateEndpointsCheckNameRequest struct { + // Name - Managed private endpoint resource name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, for instance Microsoft.Kusto/clusters/managedPrivateEndpoints. + Type *string `json:"type,omitempty"` +} + +// ManagedPrivateEndpointsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type ManagedPrivateEndpointsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedPrivateEndpointsClient) (ManagedPrivateEndpoint, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedPrivateEndpointsCreateOrUpdateFuture) 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 ManagedPrivateEndpointsCreateOrUpdateFuture.Result. +func (future *ManagedPrivateEndpointsCreateOrUpdateFuture) result(client ManagedPrivateEndpointsClient) (mpe ManagedPrivateEndpoint, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mpe.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ManagedPrivateEndpointsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mpe.Response.Response, err = future.GetResult(sender); err == nil && mpe.Response.Response.StatusCode != http.StatusNoContent { + mpe, err = client.CreateOrUpdateResponder(mpe.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsCreateOrUpdateFuture", "Result", mpe.Response.Response, "Failure responding to request") + } + } + return +} + +// ManagedPrivateEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedPrivateEndpointsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedPrivateEndpointsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedPrivateEndpointsDeleteFuture) 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 ManagedPrivateEndpointsDeleteFuture.Result. +func (future *ManagedPrivateEndpointsDeleteFuture) result(client ManagedPrivateEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ManagedPrivateEndpointsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedPrivateEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedPrivateEndpointsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagedPrivateEndpointsClient) (ManagedPrivateEndpoint, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagedPrivateEndpointsUpdateFuture) 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 ManagedPrivateEndpointsUpdateFuture.Result. +func (future *ManagedPrivateEndpointsUpdateFuture) result(client ManagedPrivateEndpointsClient) (mpe ManagedPrivateEndpoint, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mpe.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ManagedPrivateEndpointsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mpe.Response.Response, err = future.GetResult(sender); err == nil && mpe.Response.Response.StatusCode != http.StatusNoContent { + mpe, err = client.UpdateResponder(mpe.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ManagedPrivateEndpointsUpdateFuture", "Result", mpe.Response.Response, "Failure responding to request") + } + } + return +} + +// Operation ... +type Operation struct { + // Name - This is of the format {provider}/{resource}/{operation}. + Name *string `json:"name,omitempty"` + Display *OperationDisplay `json:"display,omitempty"` + Origin *string `json:"origin,omitempty"` + Properties interface{} `json:"properties,omitempty"` +} + +// OperationDisplay ... +type OperationDisplay struct { + Provider *string `json:"provider,omitempty"` + // Operation - For example: read, write, delete. + Operation *string `json:"operation,omitempty"` + Resource *string `json:"resource,omitempty"` + Description *string `json:"description,omitempty"` +} + +// OperationListResult ... +type OperationListResult struct { + autorest.Response `json:"-"` + Value *[]Operation `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !olr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } +} + +// OperationResult operation Result Entity. +type OperationResult struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; ID of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the resource. + Name *string `json:"name,omitempty"` + // Status - status of the Operation result. Possible values include: 'StatusSucceeded', 'StatusCanceled', 'StatusFailed', 'StatusRunning' + Status Status `json:"status,omitempty"` + // StartTime - The operation start time + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The operation end time + EndTime *date.Time `json:"endTime,omitempty"` + // PercentComplete - Percentage completed. + PercentComplete *float64 `json:"percentComplete,omitempty"` + // OperationResultProperties - Properties of the operation results + *OperationResultProperties `json:"properties,omitempty"` + // OperationResultErrorProperties - Object that contains the error code and message if the operation failed. + *OperationResultErrorProperties `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationResult. +func (or OperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if or.Status != "" { + objectMap["status"] = or.Status + } + if or.StartTime != nil { + objectMap["startTime"] = or.StartTime + } + if or.EndTime != nil { + objectMap["endTime"] = or.EndTime + } + if or.PercentComplete != nil { + objectMap["percentComplete"] = or.PercentComplete + } + if or.OperationResultProperties != nil { + objectMap["properties"] = or.OperationResultProperties + } + if or.OperationResultErrorProperties != nil { + objectMap["error"] = or.OperationResultErrorProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationResult struct. +func (or *OperationResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + or.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + or.Name = &name + } + case "status": + if v != nil { + var status Status + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + or.Status = status + } + case "startTime": + if v != nil { + var startTime date.Time + err = json.Unmarshal(*v, &startTime) + if err != nil { + return err + } + or.StartTime = &startTime + } + case "endTime": + if v != nil { + var endTime date.Time + err = json.Unmarshal(*v, &endTime) + if err != nil { + return err + } + or.EndTime = &endTime + } + case "percentComplete": + if v != nil { + var percentComplete float64 + err = json.Unmarshal(*v, &percentComplete) + if err != nil { + return err + } + or.PercentComplete = &percentComplete + } + case "properties": + if v != nil { + var operationResultProperties OperationResultProperties + err = json.Unmarshal(*v, &operationResultProperties) + if err != nil { + return err + } + or.OperationResultProperties = &operationResultProperties + } + case "error": + if v != nil { + var operationResultErrorProperties OperationResultErrorProperties + err = json.Unmarshal(*v, &operationResultErrorProperties) + if err != nil { + return err + } + or.OperationResultErrorProperties = &operationResultErrorProperties + } + } + } + + return nil +} + +// OperationResultErrorProperties operation result error properties +type OperationResultErrorProperties struct { + // Code - The code of the error. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` +} + +// OperationResultProperties operation result properties +type OperationResultProperties struct { + // OperationKind - The kind of the operation. + OperationKind *string `json:"operationKind,omitempty"` + // OperationState - The state of the operation. + OperationState *string `json:"operationState,omitempty"` +} + +// OptimizedAutoscale a class that contains the optimized auto scale definition. +type OptimizedAutoscale struct { + // Version - The version of the template defined, for instance 1. + Version *int32 `json:"version,omitempty"` + // IsEnabled - A boolean value that indicate if the optimized autoscale feature is enabled or not. + IsEnabled *bool `json:"isEnabled,omitempty"` + // Minimum - Minimum allowed instances count. + Minimum *int32 `json:"minimum,omitempty"` + // Maximum - Maximum allowed instances count. + Maximum *int32 `json:"maximum,omitempty"` +} + +// OutboundNetworkDependenciesEndpoint endpoints accessed for a common purpose that the Kusto Service +// Environment requires outbound network access to. +type OutboundNetworkDependenciesEndpoint struct { + // OutboundNetworkDependenciesEndpointProperties - The outbound environment endpoint properties. + *OutboundNetworkDependenciesEndpointProperties `json:"properties,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OutboundNetworkDependenciesEndpoint. +func (onde OutboundNetworkDependenciesEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if onde.OutboundNetworkDependenciesEndpointProperties != nil { + objectMap["properties"] = onde.OutboundNetworkDependenciesEndpointProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OutboundNetworkDependenciesEndpoint struct. +func (onde *OutboundNetworkDependenciesEndpoint) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var outboundNetworkDependenciesEndpointProperties OutboundNetworkDependenciesEndpointProperties + err = json.Unmarshal(*v, &outboundNetworkDependenciesEndpointProperties) + if err != nil { + return err + } + onde.OutboundNetworkDependenciesEndpointProperties = &outboundNetworkDependenciesEndpointProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + onde.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + onde.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + onde.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + onde.Type = &typeVar + } + } + } + + return nil +} + +// OutboundNetworkDependenciesEndpointListResult collection of Outbound Environment Endpoints +type OutboundNetworkDependenciesEndpointListResult struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]OutboundNetworkDependenciesEndpoint `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OutboundNetworkDependenciesEndpointListResult. +func (ondelr OutboundNetworkDependenciesEndpointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ondelr.Value != nil { + objectMap["value"] = ondelr.Value + } + return json.Marshal(objectMap) +} + +// OutboundNetworkDependenciesEndpointListResultIterator provides access to a complete listing of +// OutboundNetworkDependenciesEndpoint values. +type OutboundNetworkDependenciesEndpointListResultIterator struct { + i int + page OutboundNetworkDependenciesEndpointListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OutboundNetworkDependenciesEndpointListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundNetworkDependenciesEndpointListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OutboundNetworkDependenciesEndpointListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OutboundNetworkDependenciesEndpointListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OutboundNetworkDependenciesEndpointListResultIterator) Response() OutboundNetworkDependenciesEndpointListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OutboundNetworkDependenciesEndpointListResultIterator) Value() OutboundNetworkDependenciesEndpoint { + if !iter.page.NotDone() { + return OutboundNetworkDependenciesEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OutboundNetworkDependenciesEndpointListResultIterator type. +func NewOutboundNetworkDependenciesEndpointListResultIterator(page OutboundNetworkDependenciesEndpointListResultPage) OutboundNetworkDependenciesEndpointListResultIterator { + return OutboundNetworkDependenciesEndpointListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ondelr OutboundNetworkDependenciesEndpointListResult) IsEmpty() bool { + return ondelr.Value == nil || len(*ondelr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ondelr OutboundNetworkDependenciesEndpointListResult) hasNextLink() bool { + return ondelr.NextLink != nil && len(*ondelr.NextLink) != 0 +} + +// outboundNetworkDependenciesEndpointListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ondelr OutboundNetworkDependenciesEndpointListResult) outboundNetworkDependenciesEndpointListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ondelr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ondelr.NextLink))) +} + +// OutboundNetworkDependenciesEndpointListResultPage contains a page of OutboundNetworkDependenciesEndpoint +// values. +type OutboundNetworkDependenciesEndpointListResultPage struct { + fn func(context.Context, OutboundNetworkDependenciesEndpointListResult) (OutboundNetworkDependenciesEndpointListResult, error) + ondelr OutboundNetworkDependenciesEndpointListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OutboundNetworkDependenciesEndpointListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundNetworkDependenciesEndpointListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ondelr) + if err != nil { + return err + } + page.ondelr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OutboundNetworkDependenciesEndpointListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OutboundNetworkDependenciesEndpointListResultPage) NotDone() bool { + return !page.ondelr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OutboundNetworkDependenciesEndpointListResultPage) Response() OutboundNetworkDependenciesEndpointListResult { + return page.ondelr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OutboundNetworkDependenciesEndpointListResultPage) Values() []OutboundNetworkDependenciesEndpoint { + if page.ondelr.IsEmpty() { + return nil + } + return *page.ondelr.Value +} + +// Creates a new instance of the OutboundNetworkDependenciesEndpointListResultPage type. +func NewOutboundNetworkDependenciesEndpointListResultPage(cur OutboundNetworkDependenciesEndpointListResult, getNextPage func(context.Context, OutboundNetworkDependenciesEndpointListResult) (OutboundNetworkDependenciesEndpointListResult, error)) OutboundNetworkDependenciesEndpointListResultPage { + return OutboundNetworkDependenciesEndpointListResultPage{ + fn: getNextPage, + ondelr: cur, + } +} + +// OutboundNetworkDependenciesEndpointProperties endpoints accessed for a common purpose that the Kusto +// Service Environment requires outbound network access to. +type OutboundNetworkDependenciesEndpointProperties struct { + // Category - The type of service accessed by the Kusto Service Environment, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory. + Category *string `json:"category,omitempty"` + // Endpoints - The endpoints that the Kusto Service Environment reaches the service at. + Endpoints *[]EndpointDependency `json:"endpoints,omitempty"` + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for OutboundNetworkDependenciesEndpointProperties. +func (ondep OutboundNetworkDependenciesEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ondep.Category != nil { + objectMap["category"] = ondep.Category + } + if ondep.Endpoints != nil { + objectMap["endpoints"] = ondep.Endpoints + } + return json.Marshal(objectMap) +} + +// PrivateEndpointConnection a private endpoint connection +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Resource properties. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + pec.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + } + } + + return nil +} + +// PrivateEndpointConnectionListResult a list of private endpoint connections +type PrivateEndpointConnectionListResult struct { + autorest.Response `json:"-"` + // Value - Array of private endpoint connections + Value *[]PrivateEndpointConnection `json:"value,omitempty"` +} + +// PrivateEndpointConnectionProperties properties of a private endpoint connection. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - READ-ONLY; Private endpoint which the connection belongs to. + PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Connection State of the Private Endpoint Connection. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` + // GroupID - READ-ONLY; Group id of the private endpoint. + GroupID *string `json:"groupId,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the private endpoint. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. +func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecp.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = pecp.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, "kusto.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pec.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.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, "kusto.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, "kusto.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateEndpointProperty private endpoint which the connection belongs to. +type PrivateEndpointProperty struct { + // ID - READ-ONLY; Resource id of the private endpoint. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointProperty. +func (pep PrivateEndpointProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + autorest.Response `json:"-"` + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + plr.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - READ-ONLY; The private link resource required zone names. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. +func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateLinkServiceConnectionStateProperty connection State of the Private Endpoint Connection. +type PrivateLinkServiceConnectionStateProperty struct { + // Status - The private link service connection status. + Status *string `json:"status,omitempty"` + // Description - The private link service connection description. + Description *string `json:"description,omitempty"` + // ActionsRequired - READ-ONLY; Any action that is required beyond basic workflow (approve/ reject/ disconnect) + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty. +func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plscsp.Status != nil { + objectMap["status"] = plscsp.Status + } + if plscsp.Description != nil { + objectMap["description"] = plscsp.Description + } + return json.Marshal(objectMap) +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReadOnlyFollowingDatabase class representing a read only following database. +type ReadOnlyFollowingDatabase struct { + // ReadOnlyFollowingDatabaseProperties - The database properties. + *ReadOnlyFollowingDatabaseProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) MarshalJSON() ([]byte, error) { + rofd.Kind = KindReadOnlyFollowing + objectMap := make(map[string]interface{}) + if rofd.ReadOnlyFollowingDatabaseProperties != nil { + objectMap["properties"] = rofd.ReadOnlyFollowingDatabaseProperties + } + if rofd.Location != nil { + objectMap["location"] = rofd.Location + } + if rofd.Kind != "" { + objectMap["kind"] = rofd.Kind + } + return json.Marshal(objectMap) +} + +// AsReadWriteDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { + return nil, false +} + +// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { + return &rofd, true +} + +// AsDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsDatabase() (*Database, bool) { + return nil, false +} + +// AsBasicDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsBasicDatabase() (BasicDatabase, bool) { + return &rofd, true +} + +// UnmarshalJSON is the custom unmarshaler for ReadOnlyFollowingDatabase struct. +func (rofd *ReadOnlyFollowingDatabase) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var readOnlyFollowingDatabaseProperties ReadOnlyFollowingDatabaseProperties + err = json.Unmarshal(*v, &readOnlyFollowingDatabaseProperties) + if err != nil { + return err + } + rofd.ReadOnlyFollowingDatabaseProperties = &readOnlyFollowingDatabaseProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rofd.Location = &location + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rofd.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rofd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rofd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rofd.Type = &typeVar + } + } + } + + return nil +} + +// ReadOnlyFollowingDatabaseProperties class representing the Kusto database properties. +type ReadOnlyFollowingDatabaseProperties struct { + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // SoftDeletePeriod - READ-ONLY; The time the data should be kept before it stops being accessible to queries in TimeSpan. + SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"` + // HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan. + HotCachePeriod *string `json:"hotCachePeriod,omitempty"` + // Statistics - The statistics of the database. + Statistics *DatabaseStatistics `json:"statistics,omitempty"` + // LeaderClusterResourceID - READ-ONLY; The name of the leader cluster + LeaderClusterResourceID *string `json:"leaderClusterResourceId,omitempty"` + // AttachedDatabaseConfigurationName - READ-ONLY; The name of the attached database configuration cluster + AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"` + // PrincipalsModificationKind - READ-ONLY; The principals modification kind of the database. Possible values include: 'PrincipalsModificationKindUnion', 'PrincipalsModificationKindReplace', 'PrincipalsModificationKindNone' + PrincipalsModificationKind PrincipalsModificationKind `json:"principalsModificationKind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabaseProperties. +func (rofdp ReadOnlyFollowingDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rofdp.HotCachePeriod != nil { + objectMap["hotCachePeriod"] = rofdp.HotCachePeriod + } + if rofdp.Statistics != nil { + objectMap["statistics"] = rofdp.Statistics + } + return json.Marshal(objectMap) +} + +// ReadWriteDatabase class representing a read write database. +type ReadWriteDatabase struct { + // ReadWriteDatabaseProperties - The database properties. + *ReadWriteDatabaseProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReadWriteDatabase. +func (rwd ReadWriteDatabase) MarshalJSON() ([]byte, error) { + rwd.Kind = KindReadWrite + objectMap := make(map[string]interface{}) + if rwd.ReadWriteDatabaseProperties != nil { + objectMap["properties"] = rwd.ReadWriteDatabaseProperties + } + if rwd.Location != nil { + objectMap["location"] = rwd.Location + } + if rwd.Kind != "" { + objectMap["kind"] = rwd.Kind + } + return json.Marshal(objectMap) +} + +// AsReadWriteDatabase is the BasicDatabase implementation for ReadWriteDatabase. +func (rwd ReadWriteDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { + return &rwd, true +} + +// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadWriteDatabase. +func (rwd ReadWriteDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { + return nil, false +} + +// AsDatabase is the BasicDatabase implementation for ReadWriteDatabase. +func (rwd ReadWriteDatabase) AsDatabase() (*Database, bool) { + return nil, false +} + +// AsBasicDatabase is the BasicDatabase implementation for ReadWriteDatabase. +func (rwd ReadWriteDatabase) AsBasicDatabase() (BasicDatabase, bool) { + return &rwd, true +} + +// UnmarshalJSON is the custom unmarshaler for ReadWriteDatabase struct. +func (rwd *ReadWriteDatabase) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var readWriteDatabaseProperties ReadWriteDatabaseProperties + err = json.Unmarshal(*v, &readWriteDatabaseProperties) + if err != nil { + return err + } + rwd.ReadWriteDatabaseProperties = &readWriteDatabaseProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rwd.Location = &location + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rwd.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rwd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rwd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rwd.Type = &typeVar + } + } + } + + return nil +} + +// ReadWriteDatabaseProperties class representing the Kusto database properties. +type ReadWriteDatabaseProperties struct { + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // SoftDeletePeriod - The time the data should be kept before it stops being accessible to queries in TimeSpan. + SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"` + // HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan. + HotCachePeriod *string `json:"hotCachePeriod,omitempty"` + // Statistics - The statistics of the database. + Statistics *DatabaseStatistics `json:"statistics,omitempty"` + // IsFollowed - READ-ONLY; Indicates whether the database is followed. + IsFollowed *bool `json:"isFollowed,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReadWriteDatabaseProperties. +func (rwdp ReadWriteDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rwdp.SoftDeletePeriod != nil { + objectMap["softDeletePeriod"] = rwdp.SoftDeletePeriod + } + if rwdp.HotCachePeriod != nil { + objectMap["hotCachePeriod"] = rwdp.HotCachePeriod + } + if rwdp.Statistics != nil { + objectMap["statistics"] = rwdp.Statistics + } + return json.Marshal(objectMap) +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Script class representing a database script. +type Script struct { + autorest.Response `json:"-"` + // ScriptProperties - The database script. + *ScriptProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Script. +func (s Script) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ScriptProperties != nil { + objectMap["properties"] = s.ScriptProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Script struct. +func (s *Script) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scriptProperties ScriptProperties + err = json.Unmarshal(*v, &scriptProperties) + if err != nil { + return err + } + s.ScriptProperties = &scriptProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + s.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// ScriptCheckNameRequest a script name availability request. +type ScriptCheckNameRequest struct { + // Name - Script name. + Name *string `json:"name,omitempty"` + // Type - The type of resource, Microsoft.Kusto/clusters/databases/scripts. + Type *string `json:"type,omitempty"` +} + +// ScriptListResult the list Kusto database script operation response. +type ScriptListResult struct { + autorest.Response `json:"-"` + // Value - The list of Kusto scripts. + Value *[]Script `json:"value,omitempty"` +} + +// ScriptProperties a class representing database script property. +type ScriptProperties struct { + // ScriptURL - The url to the KQL script blob file. + ScriptURL *string `json:"scriptUrl,omitempty"` + // ScriptURLSasToken - The SaS token. + ScriptURLSasToken *string `json:"scriptUrlSasToken,omitempty"` + // ForceUpdateTag - A unique string. If changed the script will be applied again. + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + // ContinueOnErrors - Flag that indicates whether to continue if one of the command fails. + ContinueOnErrors *bool `json:"continueOnErrors,omitempty"` + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScriptProperties. +func (sp ScriptProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.ScriptURL != nil { + objectMap["scriptUrl"] = sp.ScriptURL + } + if sp.ScriptURLSasToken != nil { + objectMap["scriptUrlSasToken"] = sp.ScriptURLSasToken + } + if sp.ForceUpdateTag != nil { + objectMap["forceUpdateTag"] = sp.ForceUpdateTag + } + if sp.ContinueOnErrors != nil { + objectMap["continueOnErrors"] = sp.ContinueOnErrors + } + return json.Marshal(objectMap) +} + +// ScriptsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ScriptsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ScriptsClient) (Script, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ScriptsCreateOrUpdateFuture) 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 ScriptsCreateOrUpdateFuture.Result. +func (future *ScriptsCreateOrUpdateFuture) result(client ScriptsClient) (s Script, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ScriptsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateOrUpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// ScriptsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ScriptsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ScriptsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ScriptsDeleteFuture) 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 ScriptsDeleteFuture.Result. +func (future *ScriptsDeleteFuture) result(client ScriptsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ScriptsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ScriptsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ScriptsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ScriptsClient) (Script, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ScriptsUpdateFuture) 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 ScriptsUpdateFuture.Result. +func (future *ScriptsUpdateFuture) result(client ScriptsClient) (s Script, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("kusto.ScriptsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.UpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// SkuDescription the Kusto SKU description of given resource type +type SkuDescription struct { + // ResourceType - READ-ONLY; The resource type + ResourceType *string `json:"resourceType,omitempty"` + // Name - READ-ONLY; The name of the SKU + Name *string `json:"name,omitempty"` + // Tier - READ-ONLY; The tier of the SKU + Tier *string `json:"tier,omitempty"` + // Locations - READ-ONLY; The set of locations that the SKU is available + Locations *[]string `json:"locations,omitempty"` + // LocationInfo - READ-ONLY; Locations and zones + LocationInfo *[]SkuLocationInfoItem `json:"locationInfo,omitempty"` + // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used + Restrictions *[]interface{} `json:"restrictions,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuDescription. +func (sd SkuDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SkuDescriptionList the list of the EngagementFabric SKU descriptions +type SkuDescriptionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; SKU descriptions + Value *[]SkuDescription `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuDescriptionList. +func (sdl SkuDescriptionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SkuLocationInfoItem the locations and zones info for SKU. +type SkuLocationInfoItem struct { + // Location - The available location of the SKU. + Location *string `json:"location,omitempty"` + // Zones - The available zone of the SKU. + Zones *[]string `json:"zones,omitempty"` +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TableLevelSharingProperties tables that will be included and excluded in the follower database +type TableLevelSharingProperties struct { + // TablesToInclude - List of tables to include in the follower database + TablesToInclude *[]string `json:"tablesToInclude,omitempty"` + // TablesToExclude - List of tables to exclude from the follower database + TablesToExclude *[]string `json:"tablesToExclude,omitempty"` + // ExternalTablesToInclude - List of external tables to include in the follower database + ExternalTablesToInclude *[]string `json:"externalTablesToInclude,omitempty"` + // ExternalTablesToExclude - List of external tables exclude from the follower database + ExternalTablesToExclude *[]string `json:"externalTablesToExclude,omitempty"` + // MaterializedViewsToInclude - List of materialized views to include in the follower database + MaterializedViewsToInclude *[]string `json:"materializedViewsToInclude,omitempty"` + // MaterializedViewsToExclude - List of materialized views exclude from the follower database + MaterializedViewsToExclude *[]string `json:"materializedViewsToExclude,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// TrustedExternalTenant represents a tenant ID that is trusted by the cluster. +type TrustedExternalTenant struct { + // Value - GUID representing an external tenant. + Value *string `json:"value,omitempty"` +} + +// VirtualNetworkConfiguration a class that contains virtual network definition. +type VirtualNetworkConfiguration struct { + // SubnetID - The subnet resource id. + SubnetID *string `json:"subnetId,omitempty"` + // EnginePublicIPID - Engine service's public IP address resource id. + EnginePublicIPID *string `json:"enginePublicIpId,omitempty"` + // DataManagementPublicIPID - Data management's service public IP address resource id. + DataManagementPublicIPID *string `json:"dataManagementPublicIpId,omitempty"` +} diff --git a/services/kusto/mgmt/2021-08-27/kusto/operations.go b/services/kusto/mgmt/2021-08-27/kusto/operations.go new file mode 100644 index 000000000000..e174a83bd3c3 --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/operations.go @@ -0,0 +1,142 @@ +package kusto + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the the Azure Kusto management API provides a RESTful set of web services that interact with +// Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete +// clusters and databases. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists available operations for the Microsoft.Kusto provider. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Kusto/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "kusto.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "kusto.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/kusto/mgmt/2021-08-27/kusto/operationsresults.go b/services/kusto/mgmt/2021-08-27/kusto/operationsresults.go new file mode 100644 index 000000000000..3e472a315aeb --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/operationsresults.go @@ -0,0 +1,110 @@ +package kusto + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsResultsClient is the the Azure Kusto management API provides a RESTful set of web services that interact +// with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete +// clusters and databases. +type OperationsResultsClient struct { + BaseClient +} + +// NewOperationsResultsClient creates an instance of the OperationsResultsClient client. +func NewOperationsResultsClient(subscriptionID string) OperationsResultsClient { + return NewOperationsResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsResultsClientWithBaseURI creates an instance of the OperationsResultsClient 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 NewOperationsResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationsResultsClient { + return OperationsResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get returns operation results. +// Parameters: +// location - azure location (region) name. +// operationID - the Guid of the operation ID +func (client OperationsResultsClient) Get(ctx context.Context, location string, operationID string) (result OperationResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.OperationsResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.OperationsResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.OperationsResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationsResultsClient) GetPreparer(ctx context.Context, location string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "operationId": autorest.Encode("path", operationID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/operationresults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsResultsClient) 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 OperationsResultsClient) GetResponder(resp *http.Response) (result OperationResult, 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/services/kusto/mgmt/2021-08-27/kusto/privateendpointconnections.go b/services/kusto/mgmt/2021-08-27/kusto/privateendpointconnections.go new file mode 100644 index 000000000000..ac2d90ac6271 --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/privateendpointconnections.go @@ -0,0 +1,360 @@ +package kusto + +// 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 the Azure Kusto management API provides a RESTful set of web services that +// interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and +// delete clusters and databases. +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 approve or reject a private endpoint connection with a given name. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, parameters 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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("kusto.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, privateEndpointConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.PrivateEndpointConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = 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.Kusto/clusters/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client 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.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a private endpoint connection with a given name. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, clusterName 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) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/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 gets a private endpoint connection. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, clusterName 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) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.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, "kusto.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/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 returns the list of private endpoint connections. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, clusterName string) (result PrivateEndpointConnectionListResult, 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) + }() + } + req, err := client.ListPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.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, "kusto.PrivateEndpointConnectionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.PrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateEndpointConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/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 PrivateEndpointConnectionListResult, 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/services/kusto/mgmt/2021-08-27/kusto/privatelinkresources.go b/services/kusto/mgmt/2021-08-27/kusto/privatelinkresources.go new file mode 100644 index 000000000000..887b2a4205ae --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/privatelinkresources.go @@ -0,0 +1,188 @@ +package kusto + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkResourcesClient is the the Azure Kusto management API provides a RESTful set of web services that +// interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and +// delete clusters and databases. +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 gets a private link resource. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// privateLinkResourceName - the name of the private link resource. +func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, privateLinkResourceName string) (result PrivateLinkResource, 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) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, privateLinkResourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.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, "kusto.PrivateLinkResourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, privateLinkResourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "privateLinkResourceName": autorest.Encode("path", privateLinkResourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/privateLinkResources/{privateLinkResourceName}", 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 PrivateLinkResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List returns the list of private link resources. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +func (client PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, clusterName string) (result PrivateLinkResourceListResult, 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) + }() + } + req, err := client.ListPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.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, "kusto.PrivateLinkResourcesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.PrivateLinkResourcesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateLinkResourcesClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/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 PrivateLinkResourceListResult, 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/services/kusto/mgmt/2021-08-27/kusto/scripts.go b/services/kusto/mgmt/2021-08-27/kusto/scripts.go new file mode 100644 index 000000000000..81d3ef9e314c --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/scripts.go @@ -0,0 +1,545 @@ +package kusto + +// 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" +) + +// ScriptsClient is the the Azure Kusto management API provides a RESTful set of web services that interact with Azure +// Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and +// databases. +type ScriptsClient struct { + BaseClient +} + +// NewScriptsClient creates an instance of the ScriptsClient client. +func NewScriptsClient(subscriptionID string) ScriptsClient { + return NewScriptsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewScriptsClientWithBaseURI creates an instance of the ScriptsClient 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 NewScriptsClientWithBaseURI(baseURI string, subscriptionID string) ScriptsClient { + return ScriptsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks that the script name is valid and is not already in use. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// scriptName - the name of the script. +func (client ScriptsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName ScriptCheckNameRequest) (result CheckNameResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScriptsClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: scriptName, + Constraints: []validation.Constraint{{Target: "scriptName.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "scriptName.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("kusto.ScriptsClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, resourceGroupName, clusterName, databaseName, scriptName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client ScriptsClient) CheckNameAvailabilityPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName ScriptCheckNameRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scriptsCheckNameAvailability", pathParameters), + autorest.WithJSON(scriptName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client ScriptsClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client ScriptsClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate creates a Kusto database script. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// scriptName - the name of the Kusto database script. +// parameters - the Kusto Script parameters contains the KQL to run. +func (client ScriptsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, parameters Script) (result ScriptsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScriptsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ScriptProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ScriptProperties.ScriptURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ScriptProperties.ScriptURLSasToken", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("kusto.ScriptsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, databaseName, scriptName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ScriptsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, parameters Script) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scriptName": autorest.Encode("path", scriptName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = 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.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ScriptsClient) CreateOrUpdateSender(req *http.Request) (future ScriptsCreateOrUpdateFuture, 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 ScriptsClient) CreateOrUpdateResponder(resp *http.Response) (result Script, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a Kusto principalAssignment. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// scriptName - the name of the Kusto database script. +func (client ScriptsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string) (result ScriptsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScriptsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName, databaseName, scriptName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ScriptsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scriptName": autorest.Encode("path", scriptName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}", 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 ScriptsClient) DeleteSender(req *http.Request) (future ScriptsDeleteFuture, 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 ScriptsClient) 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 gets a Kusto cluster database script. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// scriptName - the name of the Kusto database script. +func (client ScriptsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string) (result Script, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScriptsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName, databaseName, scriptName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ScriptsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scriptName": autorest.Encode("path", scriptName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}", 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 ScriptsClient) 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 ScriptsClient) GetResponder(resp *http.Response) (result Script, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByDatabase returns the list of database scripts for given database. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +func (client ScriptsClient) ListByDatabase(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (result ScriptListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScriptsClient.ListByDatabase") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, clusterName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "ListByDatabase", resp, "Failure responding to request") + return + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client ScriptsClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseSender sends the ListByDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client ScriptsClient) ListByDatabaseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByDatabaseResponder handles the response to the ListByDatabase request. The method always +// closes the http.Response Body. +func (client ScriptsClient) ListByDatabaseResponder(resp *http.Response) (result ScriptListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a database script. +// Parameters: +// resourceGroupName - the name of the resource group containing the Kusto cluster. +// clusterName - the name of the Kusto cluster. +// databaseName - the name of the database in the Kusto cluster. +// scriptName - the name of the Kusto database script. +// parameters - the Kusto Script parameters contains to the KQL to run. +func (client ScriptsClient) Update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, parameters Script) (result ScriptsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScriptsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, databaseName, scriptName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "kusto.ScriptsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ScriptsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, parameters Script) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scriptName": autorest.Encode("path", scriptName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-27" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/scripts/{scriptName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ScriptsClient) UpdateSender(req *http.Request) (future ScriptsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ScriptsClient) UpdateResponder(resp *http.Response) (result Script, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/kusto/mgmt/2021-08-27/kusto/version.go b/services/kusto/mgmt/2021-08-27/kusto/version.go new file mode 100644 index 000000000000..cd02dad786e9 --- /dev/null +++ b/services/kusto/mgmt/2021-08-27/kusto/version.go @@ -0,0 +1,19 @@ +package kusto + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " kusto/2021-08-27" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/kusto/mgmt/2018-09-07-preview/kusto/CHANGELOG.md b/services/preview/kusto/mgmt/2018-09-07-preview/kusto/CHANGELOG.md index 4a0e9bec8e2f..a1ecf841edb0 100644 --- a/services/preview/kusto/mgmt/2018-09-07-preview/kusto/CHANGELOG.md +++ b/services/preview/kusto/mgmt/2018-09-07-preview/kusto/CHANGELOG.md @@ -1,9 +1,2 @@ -# Change History +# Unreleased -## Additive Changes - -### New Funcs - -1. AzureEntityResource.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) diff --git a/services/preview/kusto/mgmt/2018-09-07-preview/kusto/_meta.json b/services/preview/kusto/mgmt/2018-09-07-preview/kusto/_meta.json index 5c3bfc2cc015..f59cb74b0d3a 100644 --- a/services/preview/kusto/mgmt/2018-09-07-preview/kusto/_meta.json +++ b/services/preview/kusto/mgmt/2018-09-07-preview/kusto/_meta.json @@ -1,10 +1,10 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "57e4490a06aad262ca9154dc15b40f5a11bf7af5", "readme": "/_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "tag": "package-2018-09-07-preview", - "use": "@microsoft.azure/autorest.go@2.1.183", + "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.183 --tag=package-2018-09-07-preview --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2018-09-07-preview --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/services/preview/kusto/mgmt/2018-09-07-preview/kusto/clusters.go b/services/preview/kusto/mgmt/2018-09-07-preview/kusto/clusters.go index 1ee911e71b35..2899eae451b6 100644 --- a/services/preview/kusto/mgmt/2018-09-07-preview/kusto/clusters.go +++ b/services/preview/kusto/mgmt/2018-09-07-preview/kusto/clusters.go @@ -148,7 +148,7 @@ func (client ClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupNa result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -183,6 +183,7 @@ func (client ClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourc // http.Response Body if it receives an error. func (client ClustersClient) CreateOrUpdateSender(req *http.Request) (future ClustersCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -229,7 +230,7 @@ func (client ClustersClient) Delete(ctx context.Context, resourceGroupName strin result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Delete", result.Response(), "Failure sending request") return } @@ -261,6 +262,7 @@ func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -674,7 +676,7 @@ func (client ClustersClient) Start(ctx context.Context, resourceGroupName string result, err = client.StartSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Start", result.Response(), "Failure sending request") return } @@ -706,6 +708,7 @@ func (client ClustersClient) StartPreparer(ctx context.Context, resourceGroupNam // http.Response Body if it receives an error. func (client ClustersClient) StartSender(req *http.Request) (future ClustersStartFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -751,7 +754,7 @@ func (client ClustersClient) Stop(ctx context.Context, resourceGroupName string, result, err = client.StopSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Stop", result.Response(), "Failure sending request") return } @@ -783,6 +786,7 @@ func (client ClustersClient) StopPreparer(ctx context.Context, resourceGroupName // http.Response Body if it receives an error. func (client ClustersClient) StopSender(req *http.Request) (future ClustersStopFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -829,7 +833,7 @@ func (client ClustersClient) Update(ctx context.Context, resourceGroupName strin result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.ClustersClient", "Update", result.Response(), "Failure sending request") return } @@ -864,6 +868,7 @@ func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupNa // http.Response Body if it receives an error. func (client ClustersClient) UpdateSender(req *http.Request) (future ClustersUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/preview/kusto/mgmt/2018-09-07-preview/kusto/databases.go b/services/preview/kusto/mgmt/2018-09-07-preview/kusto/databases.go index 758ebd5d9991..662d76915476 100644 --- a/services/preview/kusto/mgmt/2018-09-07-preview/kusto/databases.go +++ b/services/preview/kusto/mgmt/2018-09-07-preview/kusto/databases.go @@ -232,7 +232,7 @@ func (client DatabasesClient) CreateOrUpdate(ctx context.Context, resourceGroupN result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -268,6 +268,7 @@ func (client DatabasesClient) CreateOrUpdatePreparer(ctx context.Context, resour // http.Response Body if it receives an error. func (client DatabasesClient) CreateOrUpdateSender(req *http.Request) (future DatabasesCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -315,7 +316,7 @@ func (client DatabasesClient) Delete(ctx context.Context, resourceGroupName stri result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Delete", result.Response(), "Failure sending request") return } @@ -348,6 +349,7 @@ func (client DatabasesClient) DeletePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) DeleteSender(req *http.Request) (future DatabasesDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -708,7 +710,7 @@ func (client DatabasesClient) Update(ctx context.Context, resourceGroupName stri result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.DatabasesClient", "Update", result.Response(), "Failure sending request") return } @@ -744,6 +746,7 @@ func (client DatabasesClient) UpdatePreparer(ctx context.Context, resourceGroupN // http.Response Body if it receives an error. func (client DatabasesClient) UpdateSender(req *http.Request) (future DatabasesUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return diff --git a/services/preview/kusto/mgmt/2018-09-07-preview/kusto/eventhubconnections.go b/services/preview/kusto/mgmt/2018-09-07-preview/kusto/eventhubconnections.go index ad96d7fdab5b..5dbfbe787f6c 100644 --- a/services/preview/kusto/mgmt/2018-09-07-preview/kusto/eventhubconnections.go +++ b/services/preview/kusto/mgmt/2018-09-07-preview/kusto/eventhubconnections.go @@ -69,7 +69,7 @@ func (client EventHubConnectionsClient) CreateOrUpdate(ctx context.Context, reso result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.EventHubConnectionsClient", "CreateOrUpdate", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.EventHubConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } @@ -105,6 +105,7 @@ func (client EventHubConnectionsClient) CreateOrUpdatePreparer(ctx context.Conte // http.Response Body if it receives an error. func (client EventHubConnectionsClient) CreateOrUpdateSender(req *http.Request) (future EventHubConnectionsCreateOrUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -153,7 +154,7 @@ func (client EventHubConnectionsClient) Delete(ctx context.Context, resourceGrou result, err = client.DeleteSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.EventHubConnectionsClient", "Delete", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.EventHubConnectionsClient", "Delete", result.Response(), "Failure sending request") return } @@ -187,6 +188,7 @@ func (client EventHubConnectionsClient) DeletePreparer(ctx context.Context, reso // http.Response Body if it receives an error. func (client EventHubConnectionsClient) DeleteSender(req *http.Request) (future EventHubConnectionsDeleteFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return @@ -483,7 +485,7 @@ func (client EventHubConnectionsClient) Update(ctx context.Context, resourceGrou result, err = client.UpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "kusto.EventHubConnectionsClient", "Update", nil, "Failure sending request") + err = autorest.NewErrorWithError(err, "kusto.EventHubConnectionsClient", "Update", result.Response(), "Failure sending request") return } @@ -519,6 +521,7 @@ func (client EventHubConnectionsClient) UpdatePreparer(ctx context.Context, reso // http.Response Body if it receives an error. func (client EventHubConnectionsClient) UpdateSender(req *http.Request) (future EventHubConnectionsUpdateFuture, err error) { var resp *http.Response + future.FutureAPI = &azure.Future{} resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) if err != nil { return