diff --git a/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md b/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md index 0d6586f5ac9d..30b3578a1d74 100644 --- a/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md +++ b/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md @@ -1,5 +1,32 @@ # Release History +## 2.0.0 (2023-01-26) +### Breaking Changes + +- Type of `Operation.Properties` has been changed from `interface{}` to `any` +- Type of `SKUDescription.Restrictions` has been changed from `[]interface{}` to `[]any` + +### Features Added + +- New value `AzureSKUNameStandardL32AsV3`, `AzureSKUNameStandardL32SV3` added to type alias `AzureSKUName` +- New value `DataConnectionKindCosmosDb` added to type alias `DataConnectionKind` +- New value `ProvisioningStateCanceled` added to type alias `ProvisioningState` +- New type alias `LanguageExtensionImageName` with values `LanguageExtensionImageNamePython3108`, `LanguageExtensionImageNamePython365`, `LanguageExtensionImageNamePython3912`, `LanguageExtensionImageNamePython3912IncludeDeepLearning`, `LanguageExtensionImageNameR` +- New function `*CosmosDbDataConnection.GetDataConnection() *DataConnection` +- New function `NewSKUsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SKUsClient, error)` +- New function `*SKUsClient.NewListPager(string, *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse]` +- New struct `CosmosDbDataConnection` +- New struct `CosmosDbDataConnectionProperties` +- New struct `ResourceSKUCapabilities` +- New struct `ResourceSKUZoneDetails` +- New struct `SKUsClient` +- New struct `SKUsClientListResponse` +- New field `LanguageExtensionImageName` in struct `LanguageExtension` +- New field `ZoneDetails` in struct `SKULocationInfoItem` +- New field `FunctionsToExclude` in struct `TableLevelSharingProperties` +- New field `FunctionsToInclude` in struct `TableLevelSharingProperties` + + ## 1.1.0 (2022-09-15) ### Features Added diff --git a/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client.go b/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client.go index cd1507803254..c462bf6dfeba 100644 --- a/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client.go +++ b/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client.go @@ -32,10 +32,10 @@ type AttachedDatabaseConfigurationsClient struct { } // NewAttachedDatabaseConfigurationsClient creates a new instance of AttachedDatabaseConfigurationsClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAttachedDatabaseConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AttachedDatabaseConfigurationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewAttachedDatabaseConfigurationsClient(subscriptionID string, credential a // CheckNameAvailability - Checks that the attached database configuration resource name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// resourceName - The name of the resource. -// options - AttachedDatabaseConfigurationsClientCheckNameAvailabilityOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - resourceName - The name of the resource. +// - options - AttachedDatabaseConfigurationsClientCheckNameAvailabilityOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.CheckNameAvailability +// method. func (client *AttachedDatabaseConfigurationsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, resourceName AttachedDatabaseConfigurationsCheckNameRequest, options *AttachedDatabaseConfigurationsClientCheckNameAvailabilityOptions) (AttachedDatabaseConfigurationsClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, clusterName, resourceName, options) if err != nil { @@ -99,7 +100,7 @@ func (client *AttachedDatabaseConfigurationsClient) checkNameAvailabilityCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resourceName) @@ -116,13 +117,14 @@ func (client *AttachedDatabaseConfigurationsClient) checkNameAvailabilityHandleR // BeginCreateOrUpdate - Creates or updates an attached database configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - AttachedDatabaseConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - AttachedDatabaseConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.BeginCreateOrUpdate +// method. func (client *AttachedDatabaseConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string, parameters AttachedDatabaseConfiguration, options *AttachedDatabaseConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AttachedDatabaseConfigurationsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters, options) @@ -137,7 +139,8 @@ func (client *AttachedDatabaseConfigurationsClient) BeginCreateOrUpdate(ctx cont // CreateOrUpdate - Creates or updates an attached database configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *AttachedDatabaseConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string, parameters AttachedDatabaseConfiguration, options *AttachedDatabaseConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters, options) if err != nil { @@ -177,7 +180,7 @@ func (client *AttachedDatabaseConfigurationsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -185,12 +188,13 @@ func (client *AttachedDatabaseConfigurationsClient) createOrUpdateCreateRequest( // BeginDelete - Deletes the attached database configuration with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - AttachedDatabaseConfigurationsClientBeginDeleteOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.BeginDelete -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - AttachedDatabaseConfigurationsClientBeginDeleteOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.BeginDelete +// method. func (client *AttachedDatabaseConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string, options *AttachedDatabaseConfigurationsClientBeginDeleteOptions) (*runtime.Poller[AttachedDatabaseConfigurationsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, attachedDatabaseConfigurationName, options) @@ -205,7 +209,8 @@ func (client *AttachedDatabaseConfigurationsClient) BeginDelete(ctx context.Cont // Delete - Deletes the attached database configuration with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *AttachedDatabaseConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string, options *AttachedDatabaseConfigurationsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, attachedDatabaseConfigurationName, options) if err != nil { @@ -245,7 +250,7 @@ func (client *AttachedDatabaseConfigurationsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,12 +258,13 @@ func (client *AttachedDatabaseConfigurationsClient) deleteCreateRequest(ctx cont // Get - Returns an attached database configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - AttachedDatabaseConfigurationsClientGetOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.Get -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - AttachedDatabaseConfigurationsClientGetOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.Get +// method. func (client *AttachedDatabaseConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, attachedDatabaseConfigurationName string, options *AttachedDatabaseConfigurationsClientGetOptions) (AttachedDatabaseConfigurationsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, attachedDatabaseConfigurationName, options) if err != nil { @@ -298,7 +304,7 @@ func (client *AttachedDatabaseConfigurationsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -314,11 +320,12 @@ func (client *AttachedDatabaseConfigurationsClient) getHandleResponse(resp *http } // NewListByClusterPager - Returns the list of attached database configurations of the given Kusto cluster. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - AttachedDatabaseConfigurationsClientListByClusterOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.ListByCluster -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - AttachedDatabaseConfigurationsClientListByClusterOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.NewListByClusterPager +// method. func (client *AttachedDatabaseConfigurationsClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *AttachedDatabaseConfigurationsClientListByClusterOptions) *runtime.Pager[AttachedDatabaseConfigurationsClientListByClusterResponse] { return runtime.NewPager(runtime.PagingHandler[AttachedDatabaseConfigurationsClientListByClusterResponse]{ More: func(page AttachedDatabaseConfigurationsClientListByClusterResponse) bool { @@ -361,7 +368,7 @@ func (client *AttachedDatabaseConfigurationsClient) listByClusterCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client_example_test.go deleted file mode 100644 index 669f9f7bff79..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client_example_test.go +++ /dev/null @@ -1,149 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoAttachedDatabaseConfigurationCheckNameAvailability.json -func ExampleAttachedDatabaseConfigurationsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewAttachedDatabaseConfigurationsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, "kustorptest", "kustoCluster", armkusto.AttachedDatabaseConfigurationsCheckNameRequest{ - Name: to.Ptr("adc1"), - Type: to.Ptr("Microsoft.Kusto/clusters/attachedDatabaseConfigurations"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoAttachedDatabaseConfigurationsListByCluster.json -func ExampleAttachedDatabaseConfigurationsClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewAttachedDatabaseConfigurationsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByClusterPager("kustorptest", "kustoCluster2", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoAttachedDatabaseConfigurationsGet.json -func ExampleAttachedDatabaseConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewAttachedDatabaseConfigurationsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "kustorptest", "kustoCluster2", "attachedDatabaseConfigurationsTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoAttachedDatabaseConfigurationsCreateOrUpdate.json -func ExampleAttachedDatabaseConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewAttachedDatabaseConfigurationsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster2", "attachedDatabaseConfigurationsTest", armkusto.AttachedDatabaseConfiguration{ - Location: to.Ptr("westus"), - Properties: &armkusto.AttachedDatabaseConfigurationProperties{ - ClusterResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/kustoCluster2"), - DatabaseName: to.Ptr("kustodatabase"), - DatabaseNameOverride: to.Ptr("overridekustodatabase"), - DefaultPrincipalsModificationKind: to.Ptr(armkusto.DefaultPrincipalsModificationKindUnion), - TableLevelSharingProperties: &armkusto.TableLevelSharingProperties{ - ExternalTablesToExclude: []*string{ - to.Ptr("ExternalTable2")}, - ExternalTablesToInclude: []*string{ - to.Ptr("ExternalTable1")}, - MaterializedViewsToExclude: []*string{ - to.Ptr("MaterializedViewTable2")}, - MaterializedViewsToInclude: []*string{ - to.Ptr("MaterializedViewTable1")}, - TablesToExclude: []*string{ - to.Ptr("Table2")}, - TablesToInclude: []*string{ - to.Ptr("Table1")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoAttachedDatabaseConfigurationsDelete.json -func ExampleAttachedDatabaseConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewAttachedDatabaseConfigurationsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "attachedDatabaseConfigurationsTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/autorest.md b/sdk/resourcemanager/kusto/armkusto/autorest.md index 58e093ec42f1..7bcacf0890d0 100644 --- a/sdk/resourcemanager/kusto/armkusto/autorest.md +++ b/sdk/resourcemanager/kusto/armkusto/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f70b7953f5d54889cc1825b37ad938342ca93a2e/specification/azure-kusto/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f70b7953f5d54889cc1825b37ad938342ca93a2e/specification/azure-kusto/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/azure-kusto/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.0 +module-version: 2.0.0 ``` diff --git a/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client.go b/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client.go index 00ad4729bf3f..b10644b53819 100644 --- a/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client.go +++ b/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client.go @@ -32,10 +32,10 @@ type ClusterPrincipalAssignmentsClient struct { } // NewClusterPrincipalAssignmentsClient creates a new instance of ClusterPrincipalAssignmentsClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewClusterPrincipalAssignmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClusterPrincipalAssignmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewClusterPrincipalAssignmentsClient(subscriptionID string, credential azco // CheckNameAvailability - Checks that the principal assignment name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ClusterPrincipalAssignmentsClientCheckNameAvailabilityOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ClusterPrincipalAssignmentsClientCheckNameAvailabilityOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.CheckNameAvailability +// method. func (client *ClusterPrincipalAssignmentsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName ClusterPrincipalAssignmentCheckNameRequest, options *ClusterPrincipalAssignmentsClientCheckNameAvailabilityOptions) (ClusterPrincipalAssignmentsClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, clusterName, principalAssignmentName, options) if err != nil { @@ -99,7 +100,7 @@ func (client *ClusterPrincipalAssignmentsClient) checkNameAvailabilityCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, principalAssignmentName) @@ -116,13 +117,14 @@ func (client *ClusterPrincipalAssignmentsClient) checkNameAvailabilityHandleResp // BeginCreateOrUpdate - Create a Kusto cluster principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ClusterPrincipalAssignmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ClusterPrincipalAssignmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.BeginCreateOrUpdate +// method. func (client *ClusterPrincipalAssignmentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string, parameters ClusterPrincipalAssignment, options *ClusterPrincipalAssignmentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClusterPrincipalAssignmentsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, principalAssignmentName, parameters, options) @@ -137,7 +139,8 @@ func (client *ClusterPrincipalAssignmentsClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Create a Kusto cluster principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ClusterPrincipalAssignmentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string, parameters ClusterPrincipalAssignment, options *ClusterPrincipalAssignmentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, principalAssignmentName, parameters, options) if err != nil { @@ -177,7 +180,7 @@ func (client *ClusterPrincipalAssignmentsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -185,12 +188,13 @@ func (client *ClusterPrincipalAssignmentsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a Kusto cluster principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ClusterPrincipalAssignmentsClientBeginDeleteOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.BeginDelete -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ClusterPrincipalAssignmentsClientBeginDeleteOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.BeginDelete +// method. func (client *ClusterPrincipalAssignmentsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string, options *ClusterPrincipalAssignmentsClientBeginDeleteOptions) (*runtime.Poller[ClusterPrincipalAssignmentsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, principalAssignmentName, options) @@ -205,7 +209,8 @@ func (client *ClusterPrincipalAssignmentsClient) BeginDelete(ctx context.Context // Delete - Deletes a Kusto cluster principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ClusterPrincipalAssignmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string, options *ClusterPrincipalAssignmentsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, principalAssignmentName, options) if err != nil { @@ -245,7 +250,7 @@ func (client *ClusterPrincipalAssignmentsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,12 +258,13 @@ func (client *ClusterPrincipalAssignmentsClient) deleteCreateRequest(ctx context // Get - Gets a Kusto cluster principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ClusterPrincipalAssignmentsClientGetOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.Get -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ClusterPrincipalAssignmentsClientGetOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.Get +// method. func (client *ClusterPrincipalAssignmentsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, principalAssignmentName string, options *ClusterPrincipalAssignmentsClientGetOptions) (ClusterPrincipalAssignmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, principalAssignmentName, options) if err != nil { @@ -298,7 +304,7 @@ func (client *ClusterPrincipalAssignmentsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -314,11 +320,12 @@ func (client *ClusterPrincipalAssignmentsClient) getHandleResponse(resp *http.Re } // NewListPager - Lists all Kusto cluster principalAssignments. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - ClusterPrincipalAssignmentsClientListOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.List -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - ClusterPrincipalAssignmentsClientListOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.NewListPager +// method. func (client *ClusterPrincipalAssignmentsClient) NewListPager(resourceGroupName string, clusterName string, options *ClusterPrincipalAssignmentsClientListOptions) *runtime.Pager[ClusterPrincipalAssignmentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ClusterPrincipalAssignmentsClientListResponse]{ More: func(page ClusterPrincipalAssignmentsClientListResponse) bool { @@ -361,7 +368,7 @@ func (client *ClusterPrincipalAssignmentsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client_example_test.go deleted file mode 100644 index ab792e3e0cce..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client_example_test.go +++ /dev/null @@ -1,134 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClusterPrincipalAssignmentsCheckNameAvailability.json -func ExampleClusterPrincipalAssignmentsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClusterPrincipalAssignmentsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, "kustorptest", "kustoCluster", armkusto.ClusterPrincipalAssignmentCheckNameRequest{ - Name: to.Ptr("kustoprincipal1"), - Type: to.Ptr("Microsoft.Kusto/clusters/principalAssignments"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClusterPrincipalAssignmentsGet.json -func ExampleClusterPrincipalAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClusterPrincipalAssignmentsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "kustorptest", "kustoCluster", "kustoprincipal1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClusterPrincipalAssignmentsCreateOrUpdate.json -func ExampleClusterPrincipalAssignmentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClusterPrincipalAssignmentsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "kustoprincipal1", armkusto.ClusterPrincipalAssignment{ - Properties: &armkusto.ClusterPrincipalProperties{ - PrincipalID: to.Ptr("87654321-1234-1234-1234-123456789123"), - PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - Role: to.Ptr(armkusto.ClusterPrincipalRoleAllDatabasesAdmin), - TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClusterPrincipalAssignmentsDelete.json -func ExampleClusterPrincipalAssignmentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClusterPrincipalAssignmentsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "kustoprincipal1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClusterPrincipalAssignmentsList.json -func ExampleClusterPrincipalAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClusterPrincipalAssignmentsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("kustorptest", "kustoCluster", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/clusters_client.go b/sdk/resourcemanager/kusto/armkusto/clusters_client.go index e3ee7c907aad..7c6a2c98a435 100644 --- a/sdk/resourcemanager/kusto/armkusto/clusters_client.go +++ b/sdk/resourcemanager/kusto/armkusto/clusters_client.go @@ -32,10 +32,10 @@ type ClustersClient struct { } // NewClustersClient creates a new instance of ClustersClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClustersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, // BeginAddLanguageExtensions - Add a list of language extensions that can run within KQL queries. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// languageExtensionsToAdd - The language extensions to add. -// options - ClustersClientBeginAddLanguageExtensionsOptions contains the optional parameters for the ClustersClient.BeginAddLanguageExtensions -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - languageExtensionsToAdd - The language extensions to add. +// - options - ClustersClientBeginAddLanguageExtensionsOptions contains the optional parameters for the ClustersClient.BeginAddLanguageExtensions +// method. func (client *ClustersClient) BeginAddLanguageExtensions(ctx context.Context, resourceGroupName string, clusterName string, languageExtensionsToAdd LanguageExtensionsList, options *ClustersClientBeginAddLanguageExtensionsOptions) (*runtime.Poller[ClustersClientAddLanguageExtensionsResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.addLanguageExtensions(ctx, resourceGroupName, clusterName, languageExtensionsToAdd, options) @@ -78,7 +79,8 @@ func (client *ClustersClient) BeginAddLanguageExtensions(ctx context.Context, re // AddLanguageExtensions - Add a list of language extensions that can run within KQL queries. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ClustersClient) addLanguageExtensions(ctx context.Context, resourceGroupName string, clusterName string, languageExtensionsToAdd LanguageExtensionsList, options *ClustersClientBeginAddLanguageExtensionsOptions) (*http.Response, error) { req, err := client.addLanguageExtensionsCreateRequest(ctx, resourceGroupName, clusterName, languageExtensionsToAdd, options) if err != nil { @@ -114,7 +116,7 @@ func (client *ClustersClient) addLanguageExtensionsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, languageExtensionsToAdd) @@ -122,11 +124,12 @@ func (client *ClustersClient) addLanguageExtensionsCreateRequest(ctx context.Con // CheckNameAvailability - Checks that the cluster name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// location - Azure location (region) name. -// clusterName - The name of the cluster. -// options - ClustersClientCheckNameAvailabilityOptions contains the optional parameters for the ClustersClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-12-29 +// - location - Azure location (region) name. +// - clusterName - The name of the cluster. +// - options - ClustersClientCheckNameAvailabilityOptions contains the optional parameters for the ClustersClient.CheckNameAvailability +// method. func (client *ClustersClient) CheckNameAvailability(ctx context.Context, location string, clusterName ClusterCheckNameRequest, options *ClustersClientCheckNameAvailabilityOptions) (ClustersClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, location, clusterName, options) if err != nil { @@ -158,7 +161,7 @@ func (client *ClustersClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, clusterName) @@ -175,12 +178,13 @@ func (client *ClustersClient) checkNameAvailabilityHandleResponse(resp *http.Res // BeginCreateOrUpdate - Create or update a Kusto cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ClustersClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ClustersClient.BeginCreateOrUpdate +// method. func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ClustersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, parameters, options) @@ -195,7 +199,8 @@ func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update a Kusto cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -231,7 +236,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -245,10 +250,11 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes a Kusto cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*runtime.Poller[ClustersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, options) @@ -263,7 +269,8 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a Kusto cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -299,7 +306,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,12 +314,13 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG // BeginDetachFollowerDatabases - Detaches all followers of a database owned by this cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ClustersClientBeginDetachFollowerDatabasesOptions contains the optional parameters for the ClustersClient.BeginDetachFollowerDatabases -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ClustersClientBeginDetachFollowerDatabasesOptions contains the optional parameters for the ClustersClient.BeginDetachFollowerDatabases +// method. func (client *ClustersClient) BeginDetachFollowerDatabases(ctx context.Context, resourceGroupName string, clusterName string, followerDatabaseToRemove FollowerDatabaseDefinition, options *ClustersClientBeginDetachFollowerDatabasesOptions) (*runtime.Poller[ClustersClientDetachFollowerDatabasesResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.detachFollowerDatabases(ctx, resourceGroupName, clusterName, followerDatabaseToRemove, options) @@ -327,7 +335,8 @@ func (client *ClustersClient) BeginDetachFollowerDatabases(ctx context.Context, // DetachFollowerDatabases - Detaches all followers of a database owned by this cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ClustersClient) detachFollowerDatabases(ctx context.Context, resourceGroupName string, clusterName string, followerDatabaseToRemove FollowerDatabaseDefinition, options *ClustersClientBeginDetachFollowerDatabasesOptions) (*http.Response, error) { req, err := client.detachFollowerDatabasesCreateRequest(ctx, resourceGroupName, clusterName, followerDatabaseToRemove, options) if err != nil { @@ -363,7 +372,7 @@ func (client *ClustersClient) detachFollowerDatabasesCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, followerDatabaseToRemove) @@ -372,11 +381,12 @@ func (client *ClustersClient) detachFollowerDatabasesCreateRequest(ctx context.C // BeginDiagnoseVirtualNetwork - Diagnoses network connectivity status for external resources on which the service is dependent // on. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - ClustersClientBeginDiagnoseVirtualNetworkOptions contains the optional parameters for the ClustersClient.BeginDiagnoseVirtualNetwork -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - ClustersClientBeginDiagnoseVirtualNetworkOptions contains the optional parameters for the ClustersClient.BeginDiagnoseVirtualNetwork +// method. func (client *ClustersClient) BeginDiagnoseVirtualNetwork(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDiagnoseVirtualNetworkOptions) (*runtime.Poller[ClustersClientDiagnoseVirtualNetworkResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.diagnoseVirtualNetwork(ctx, resourceGroupName, clusterName, options) @@ -394,7 +404,8 @@ func (client *ClustersClient) BeginDiagnoseVirtualNetwork(ctx context.Context, r // DiagnoseVirtualNetwork - Diagnoses network connectivity status for external resources on which the service is dependent // on. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ClustersClient) diagnoseVirtualNetwork(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDiagnoseVirtualNetworkOptions) (*http.Response, error) { req, err := client.diagnoseVirtualNetworkCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -430,7 +441,7 @@ func (client *ClustersClient) diagnoseVirtualNetworkCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -438,10 +449,11 @@ func (client *ClustersClient) diagnoseVirtualNetworkCreateRequest(ctx context.Co // Get - Gets a Kusto cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientGetOptions) (ClustersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -477,7 +489,7 @@ func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -493,8 +505,9 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl } // NewListPager - Lists all Kusto clusters within a subscription. -// Generated from API version 2022-07-07 -// options - ClustersClientListOptions contains the optional parameters for the ClustersClient.List method. +// +// Generated from API version 2022-12-29 +// - options - ClustersClientListOptions contains the optional parameters for the ClustersClient.NewListPager method. func (client *ClustersClient) NewListPager(options *ClustersClientListOptions) *runtime.Pager[ClustersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ClustersClientListResponse]{ More: func(page ClustersClientListResponse) bool { @@ -529,7 +542,7 @@ func (client *ClustersClient) listCreateRequest(ctx context.Context, options *Cl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -545,10 +558,11 @@ func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersC } // NewListByResourceGroupPager - Lists all Kusto clusters within a resource group. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager +// method. func (client *ClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *ClustersClientListByResourceGroupOptions) *runtime.Pager[ClustersClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ClustersClientListByResourceGroupResponse]{ More: func(page ClustersClientListByResourceGroupResponse) bool { @@ -587,7 +601,7 @@ func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -604,11 +618,12 @@ func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListFollowerDatabasesPager - Returns a list of databases that are owned by this cluster and were followed by another // cluster. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - ClustersClientListFollowerDatabasesOptions contains the optional parameters for the ClustersClient.ListFollowerDatabases -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - ClustersClientListFollowerDatabasesOptions contains the optional parameters for the ClustersClient.NewListFollowerDatabasesPager +// method. func (client *ClustersClient) NewListFollowerDatabasesPager(resourceGroupName string, clusterName string, options *ClustersClientListFollowerDatabasesOptions) *runtime.Pager[ClustersClientListFollowerDatabasesResponse] { return runtime.NewPager(runtime.PagingHandler[ClustersClientListFollowerDatabasesResponse]{ More: func(page ClustersClientListFollowerDatabasesResponse) bool { @@ -651,7 +666,7 @@ func (client *ClustersClient) listFollowerDatabasesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -667,11 +682,12 @@ func (client *ClustersClient) listFollowerDatabasesHandleResponse(resp *http.Res } // NewListLanguageExtensionsPager - Returns a list of language extensions that can run within KQL queries. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - ClustersClientListLanguageExtensionsOptions contains the optional parameters for the ClustersClient.ListLanguageExtensions -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - ClustersClientListLanguageExtensionsOptions contains the optional parameters for the ClustersClient.NewListLanguageExtensionsPager +// method. func (client *ClustersClient) NewListLanguageExtensionsPager(resourceGroupName string, clusterName string, options *ClustersClientListLanguageExtensionsOptions) *runtime.Pager[ClustersClientListLanguageExtensionsResponse] { return runtime.NewPager(runtime.PagingHandler[ClustersClientListLanguageExtensionsResponse]{ More: func(page ClustersClientListLanguageExtensionsResponse) bool { @@ -714,7 +730,7 @@ func (client *ClustersClient) listLanguageExtensionsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -730,11 +746,12 @@ func (client *ClustersClient) listLanguageExtensionsHandleResponse(resp *http.Re } // NewListOutboundNetworkDependenciesEndpointsPager - Gets the network endpoints of all outbound dependencies of a Kusto cluster -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - ClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the ClustersClient.ListOutboundNetworkDependenciesEndpoints -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - ClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the ClustersClient.NewListOutboundNetworkDependenciesEndpointsPager +// method. func (client *ClustersClient) NewListOutboundNetworkDependenciesEndpointsPager(resourceGroupName string, clusterName string, options *ClustersClientListOutboundNetworkDependenciesEndpointsOptions) *runtime.Pager[ClustersClientListOutboundNetworkDependenciesEndpointsResponse] { return runtime.NewPager(runtime.PagingHandler[ClustersClientListOutboundNetworkDependenciesEndpointsResponse]{ More: func(page ClustersClientListOutboundNetworkDependenciesEndpointsResponse) bool { @@ -783,7 +800,7 @@ func (client *ClustersClient) listOutboundNetworkDependenciesEndpointsCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -799,8 +816,9 @@ func (client *ClustersClient) listOutboundNetworkDependenciesEndpointsHandleResp } // NewListSKUsPager - Lists eligible SKUs for Kusto resource provider. -// Generated from API version 2022-07-07 -// options - ClustersClientListSKUsOptions contains the optional parameters for the ClustersClient.ListSKUs method. +// +// Generated from API version 2022-12-29 +// - options - ClustersClientListSKUsOptions contains the optional parameters for the ClustersClient.NewListSKUsPager method. func (client *ClustersClient) NewListSKUsPager(options *ClustersClientListSKUsOptions) *runtime.Pager[ClustersClientListSKUsResponse] { return runtime.NewPager(runtime.PagingHandler[ClustersClientListSKUsResponse]{ More: func(page ClustersClientListSKUsResponse) bool { @@ -835,7 +853,7 @@ func (client *ClustersClient) listSKUsCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -851,11 +869,12 @@ func (client *ClustersClient) listSKUsHandleResponse(resp *http.Response) (Clust } // NewListSKUsByResourcePager - Returns the SKUs available for the provided resource. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - ClustersClientListSKUsByResourceOptions contains the optional parameters for the ClustersClient.ListSKUsByResource -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - ClustersClientListSKUsByResourceOptions contains the optional parameters for the ClustersClient.NewListSKUsByResourcePager +// method. func (client *ClustersClient) NewListSKUsByResourcePager(resourceGroupName string, clusterName string, options *ClustersClientListSKUsByResourceOptions) *runtime.Pager[ClustersClientListSKUsByResourceResponse] { return runtime.NewPager(runtime.PagingHandler[ClustersClientListSKUsByResourceResponse]{ More: func(page ClustersClientListSKUsByResourceResponse) bool { @@ -898,7 +917,7 @@ func (client *ClustersClient) listSKUsByResourceCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -915,12 +934,13 @@ func (client *ClustersClient) listSKUsByResourceHandleResponse(resp *http.Respon // BeginRemoveLanguageExtensions - Remove a list of language extensions that can run within KQL queries. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// languageExtensionsToRemove - The language extensions to remove. -// options - ClustersClientBeginRemoveLanguageExtensionsOptions contains the optional parameters for the ClustersClient.BeginRemoveLanguageExtensions -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - languageExtensionsToRemove - The language extensions to remove. +// - options - ClustersClientBeginRemoveLanguageExtensionsOptions contains the optional parameters for the ClustersClient.BeginRemoveLanguageExtensions +// method. func (client *ClustersClient) BeginRemoveLanguageExtensions(ctx context.Context, resourceGroupName string, clusterName string, languageExtensionsToRemove LanguageExtensionsList, options *ClustersClientBeginRemoveLanguageExtensionsOptions) (*runtime.Poller[ClustersClientRemoveLanguageExtensionsResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.removeLanguageExtensions(ctx, resourceGroupName, clusterName, languageExtensionsToRemove, options) @@ -935,7 +955,8 @@ func (client *ClustersClient) BeginRemoveLanguageExtensions(ctx context.Context, // RemoveLanguageExtensions - Remove a list of language extensions that can run within KQL queries. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ClustersClient) removeLanguageExtensions(ctx context.Context, resourceGroupName string, clusterName string, languageExtensionsToRemove LanguageExtensionsList, options *ClustersClientBeginRemoveLanguageExtensionsOptions) (*http.Response, error) { req, err := client.removeLanguageExtensionsCreateRequest(ctx, resourceGroupName, clusterName, languageExtensionsToRemove, options) if err != nil { @@ -971,7 +992,7 @@ func (client *ClustersClient) removeLanguageExtensionsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, languageExtensionsToRemove) @@ -979,10 +1000,11 @@ func (client *ClustersClient) removeLanguageExtensionsCreateRequest(ctx context. // BeginStart - Starts a Kusto cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - ClustersClientBeginStartOptions contains the optional parameters for the ClustersClient.BeginStart method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - ClustersClientBeginStartOptions contains the optional parameters for the ClustersClient.BeginStart method. func (client *ClustersClient) BeginStart(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginStartOptions) (*runtime.Poller[ClustersClientStartResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.start(ctx, resourceGroupName, clusterName, options) @@ -997,7 +1019,8 @@ func (client *ClustersClient) BeginStart(ctx context.Context, resourceGroupName // Start - Starts a Kusto cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ClustersClient) start(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -1033,7 +1056,7 @@ func (client *ClustersClient) startCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1041,10 +1064,11 @@ func (client *ClustersClient) startCreateRequest(ctx context.Context, resourceGr // BeginStop - Stops a Kusto cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - ClustersClientBeginStopOptions contains the optional parameters for the ClustersClient.BeginStop method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - ClustersClientBeginStopOptions contains the optional parameters for the ClustersClient.BeginStop method. func (client *ClustersClient) BeginStop(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginStopOptions) (*runtime.Poller[ClustersClientStopResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.stop(ctx, resourceGroupName, clusterName, options) @@ -1059,7 +1083,8 @@ func (client *ClustersClient) BeginStop(ctx context.Context, resourceGroupName s // Stop - Stops a Kusto cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ClustersClient) stop(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -1095,7 +1120,7 @@ func (client *ClustersClient) stopCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1103,11 +1128,12 @@ func (client *ClustersClient) stopCreateRequest(ctx context.Context, resourceGro // BeginUpdate - Update a Kusto cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method. func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdate, options *ClustersClientBeginUpdateOptions) (*runtime.Poller[ClustersClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, clusterName, parameters, options) @@ -1122,7 +1148,8 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Update a Kusto cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ClustersClient) update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdate, options *ClustersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -1158,7 +1185,7 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/kusto/armkusto/clusters_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/clusters_client_example_test.go deleted file mode 100644 index b93747636454..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/clusters_client_example_test.go +++ /dev/null @@ -1,465 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersGet.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "kustorptest", "kustoCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersCreateOrUpdate.json -func ExampleClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", armkusto.Cluster{ - Location: to.Ptr("westus"), - Identity: &armkusto.Identity{ - Type: to.Ptr(armkusto.IdentityTypeSystemAssigned), - }, - Properties: &armkusto.ClusterProperties{ - AllowedIPRangeList: []*string{ - to.Ptr("0.0.0.0/0")}, - EnableAutoStop: to.Ptr(true), - EnableDoubleEncryption: to.Ptr(false), - EnablePurge: to.Ptr(true), - EnableStreamingIngest: to.Ptr(true), - PublicIPType: to.Ptr(armkusto.PublicIPTypeDualStack), - PublicNetworkAccess: to.Ptr(armkusto.PublicNetworkAccessEnabled), - }, - SKU: &armkusto.AzureSKU{ - Name: to.Ptr(armkusto.AzureSKUNameStandardL8S), - Capacity: to.Ptr[int32](2), - Tier: to.Ptr(armkusto.AzureSKUTierStandard), - }, - }, &armkusto.ClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersUpdate.json -func ExampleClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "kustorptest", "kustoCluster2", armkusto.ClusterUpdate{ - Location: to.Ptr("westus"), - }, &armkusto.ClustersClientBeginUpdateOptions{IfMatch: to.Ptr("*")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersDelete.json -func ExampleClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersStop.json -func ExampleClustersClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, "kustorptest", "kustoCluster2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersStart.json -func ExampleClustersClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, "kustorptest", "kustoCluster2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClusterListFollowerDatabases.json -func ExampleClustersClient_NewListFollowerDatabasesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListFollowerDatabasesPager("kustorptest", "kustoCluster", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClusterDetachFollowerDatabases.json -func ExampleClustersClient_BeginDetachFollowerDatabases() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDetachFollowerDatabases(ctx, "kustorptest", "kustoCluster", armkusto.FollowerDatabaseDefinition{ - AttachedDatabaseConfigurationName: to.Ptr("attachedDatabaseConfigurationsTest"), - ClusterResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/clusters/kustoCluster2"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersDiagnoseVirtualNetwork.json -func ExampleClustersClient_BeginDiagnoseVirtualNetwork() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDiagnoseVirtualNetwork(ctx, "kustorptest", "kustoCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersListByResourceGroup.json -func ExampleClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("kustorptest", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersList.json -func ExampleClustersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersListSkus.json -func ExampleClustersClient_NewListSKUsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListSKUsPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersCheckNameAvailability.json -func ExampleClustersClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, "westus", armkusto.ClusterCheckNameRequest{ - Name: to.Ptr("kustoCluster"), - Type: to.Ptr("Microsoft.Kusto/clusters"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClustersListResourceSkus.json -func ExampleClustersClient_NewListSKUsByResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListSKUsByResourcePager("kustorptest", "kustoCluster", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoOutboundNetworkDependenciesList.json -func ExampleClustersClient_NewListOutboundNetworkDependenciesEndpointsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListOutboundNetworkDependenciesEndpointsPager("kustorptest", "kustoCluster", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClusterListLanguageExtensions.json -func ExampleClustersClient_NewListLanguageExtensionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListLanguageExtensionsPager("kustorptest", "kustoCluster", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClusterAddLanguageExtensions.json -func ExampleClustersClient_BeginAddLanguageExtensions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAddLanguageExtensions(ctx, "kustorptest", "kustoCluster", armkusto.LanguageExtensionsList{ - Value: []*armkusto.LanguageExtension{ - { - LanguageExtensionName: to.Ptr(armkusto.LanguageExtensionNamePYTHON), - }, - { - LanguageExtensionName: to.Ptr(armkusto.LanguageExtensionNameR), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoClusterRemoveLanguageExtensions.json -func ExampleClustersClient_BeginRemoveLanguageExtensions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewClustersClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRemoveLanguageExtensions(ctx, "kustorptest", "kustoCluster", armkusto.LanguageExtensionsList{ - Value: []*armkusto.LanguageExtension{ - { - LanguageExtensionName: to.Ptr(armkusto.LanguageExtensionNamePYTHON), - }, - { - LanguageExtensionName: to.Ptr(armkusto.LanguageExtensionNameR), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/constants.go b/sdk/resourcemanager/kusto/armkusto/constants.go index 7cce5ba10834..c7e05dbdab1c 100644 --- a/sdk/resourcemanager/kusto/armkusto/constants.go +++ b/sdk/resourcemanager/kusto/armkusto/constants.go @@ -11,7 +11,7 @@ package armkusto const ( moduleName = "armkusto" - moduleVersion = "v1.1.0" + moduleVersion = "v2.0.0" ) // AzureSKUName - SKU name. @@ -75,6 +75,8 @@ const ( AzureSKUNameStandardL16S AzureSKUName = "Standard_L16s" AzureSKUNameStandardL16SV2 AzureSKUName = "Standard_L16s_v2" AzureSKUNameStandardL16SV3 AzureSKUName = "Standard_L16s_v3" + AzureSKUNameStandardL32AsV3 AzureSKUName = "Standard_L32as_v3" + AzureSKUNameStandardL32SV3 AzureSKUName = "Standard_L32s_v3" AzureSKUNameStandardL4S AzureSKUName = "Standard_L4s" AzureSKUNameStandardL8AsV3 AzureSKUName = "Standard_L8as_v3" AzureSKUNameStandardL8S AzureSKUName = "Standard_L8s" @@ -142,6 +144,8 @@ func PossibleAzureSKUNameValues() []AzureSKUName { AzureSKUNameStandardL16S, AzureSKUNameStandardL16SV2, AzureSKUNameStandardL16SV3, + AzureSKUNameStandardL32AsV3, + AzureSKUNameStandardL32SV3, AzureSKUNameStandardL4S, AzureSKUNameStandardL8AsV3, AzureSKUNameStandardL8S, @@ -288,6 +292,7 @@ func PossibleCreatedByTypeValues() []CreatedByType { type DataConnectionKind string const ( + DataConnectionKindCosmosDb DataConnectionKind = "CosmosDb" DataConnectionKindEventGrid DataConnectionKind = "EventGrid" DataConnectionKindEventHub DataConnectionKind = "EventHub" DataConnectionKindIotHub DataConnectionKind = "IotHub" @@ -296,6 +301,7 @@ const ( // PossibleDataConnectionKindValues returns the possible values for the DataConnectionKind const type. func PossibleDataConnectionKindValues() []DataConnectionKind { return []DataConnectionKind{ + DataConnectionKindCosmosDb, DataConnectionKindEventGrid, DataConnectionKindEventHub, DataConnectionKindIotHub, @@ -583,6 +589,28 @@ func PossibleKindValues() []Kind { } } +// LanguageExtensionImageName - Language extension image name. +type LanguageExtensionImageName string + +const ( + LanguageExtensionImageNamePython3108 LanguageExtensionImageName = "Python3_10_8" + LanguageExtensionImageNamePython365 LanguageExtensionImageName = "Python3_6_5" + LanguageExtensionImageNamePython3912 LanguageExtensionImageName = "Python3_9_12" + LanguageExtensionImageNamePython3912IncludeDeepLearning LanguageExtensionImageName = "Python3_9_12IncludeDeepLearning" + LanguageExtensionImageNameR LanguageExtensionImageName = "R" +) + +// PossibleLanguageExtensionImageNameValues returns the possible values for the LanguageExtensionImageName const type. +func PossibleLanguageExtensionImageNameValues() []LanguageExtensionImageName { + return []LanguageExtensionImageName{ + LanguageExtensionImageNamePython3108, + LanguageExtensionImageNamePython365, + LanguageExtensionImageNamePython3912, + LanguageExtensionImageNamePython3912IncludeDeepLearning, + LanguageExtensionImageNameR, + } +} + // LanguageExtensionName - Language extension that can run within KQL query. type LanguageExtensionName string @@ -639,6 +667,7 @@ func PossiblePrincipalsModificationKindValues() []PrincipalsModificationKind { type ProvisioningState string const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" @@ -650,6 +679,7 @@ const ( // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ + ProvisioningStateCanceled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, diff --git a/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client.go b/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client.go index 5fec23d4d448..e61890ee4689 100644 --- a/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client.go +++ b/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client.go @@ -32,10 +32,10 @@ type DatabasePrincipalAssignmentsClient struct { } // NewDatabasePrincipalAssignmentsClient creates a new instance of DatabasePrincipalAssignmentsClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabasePrincipalAssignmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabasePrincipalAssignmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewDatabasePrincipalAssignmentsClient(subscriptionID string, credential azc // CheckNameAvailability - Checks that the database principal assignment is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasePrincipalAssignmentsClientCheckNameAvailabilityOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasePrincipalAssignmentsClientCheckNameAvailabilityOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.CheckNameAvailability +// method. func (client *DatabasePrincipalAssignmentsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName DatabasePrincipalAssignmentCheckNameRequest, options *DatabasePrincipalAssignmentsClientCheckNameAvailabilityOptions) (DatabasePrincipalAssignmentsClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, clusterName, databaseName, principalAssignmentName, options) if err != nil { @@ -104,7 +105,7 @@ func (client *DatabasePrincipalAssignmentsClient) checkNameAvailabilityCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, principalAssignmentName) @@ -121,14 +122,15 @@ func (client *DatabasePrincipalAssignmentsClient) checkNameAvailabilityHandleRes // BeginCreateOrUpdate - Creates a Kusto cluster database principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasePrincipalAssignmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasePrincipalAssignmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.BeginCreateOrUpdate +// method. func (client *DatabasePrincipalAssignmentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string, parameters DatabasePrincipalAssignment, options *DatabasePrincipalAssignmentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabasePrincipalAssignmentsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters, options) @@ -143,7 +145,8 @@ func (client *DatabasePrincipalAssignmentsClient) BeginCreateOrUpdate(ctx contex // CreateOrUpdate - Creates a Kusto cluster database principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *DatabasePrincipalAssignmentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string, parameters DatabasePrincipalAssignment, options *DatabasePrincipalAssignmentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters, options) if err != nil { @@ -187,7 +190,7 @@ func (client *DatabasePrincipalAssignmentsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -195,13 +198,14 @@ func (client *DatabasePrincipalAssignmentsClient) createOrUpdateCreateRequest(ct // BeginDelete - Deletes a Kusto principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasePrincipalAssignmentsClientBeginDeleteOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.BeginDelete -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasePrincipalAssignmentsClientBeginDeleteOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.BeginDelete +// method. func (client *DatabasePrincipalAssignmentsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string, options *DatabasePrincipalAssignmentsClientBeginDeleteOptions) (*runtime.Poller[DatabasePrincipalAssignmentsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, databaseName, principalAssignmentName, options) @@ -216,7 +220,8 @@ func (client *DatabasePrincipalAssignmentsClient) BeginDelete(ctx context.Contex // Delete - Deletes a Kusto principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *DatabasePrincipalAssignmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string, options *DatabasePrincipalAssignmentsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, databaseName, principalAssignmentName, options) if err != nil { @@ -260,7 +265,7 @@ func (client *DatabasePrincipalAssignmentsClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,13 +273,14 @@ func (client *DatabasePrincipalAssignmentsClient) deleteCreateRequest(ctx contex // Get - Gets a Kusto cluster database principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasePrincipalAssignmentsClientGetOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.Get -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasePrincipalAssignmentsClientGetOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.Get +// method. func (client *DatabasePrincipalAssignmentsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, principalAssignmentName string, options *DatabasePrincipalAssignmentsClientGetOptions) (DatabasePrincipalAssignmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, databaseName, principalAssignmentName, options) if err != nil { @@ -318,7 +324,7 @@ func (client *DatabasePrincipalAssignmentsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,12 +340,13 @@ func (client *DatabasePrincipalAssignmentsClient) getHandleResponse(resp *http.R } // NewListPager - Lists all Kusto cluster database principalAssignments. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasePrincipalAssignmentsClientListOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.List -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasePrincipalAssignmentsClientListOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.NewListPager +// method. func (client *DatabasePrincipalAssignmentsClient) NewListPager(resourceGroupName string, clusterName string, databaseName string, options *DatabasePrincipalAssignmentsClientListOptions) *runtime.Pager[DatabasePrincipalAssignmentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DatabasePrincipalAssignmentsClientListResponse]{ More: func(page DatabasePrincipalAssignmentsClientListResponse) bool { @@ -386,7 +393,7 @@ func (client *DatabasePrincipalAssignmentsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client_example_test.go deleted file mode 100644 index 0d2e926ec06e..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client_example_test.go +++ /dev/null @@ -1,134 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabasePrincipalAssignmentsCheckNameAvailability.json -func ExampleDatabasePrincipalAssignmentsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasePrincipalAssignmentsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", armkusto.DatabasePrincipalAssignmentCheckNameRequest{ - Name: to.Ptr("kustoprincipal1"), - Type: to.Ptr("Microsoft.Kusto/clusters/databases/principalAssignments"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabasePrincipalAssignmentsGet.json -func ExampleDatabasePrincipalAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasePrincipalAssignmentsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", "kustoprincipal1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabasePrincipalAssignmentsCreateOrUpdate.json -func ExampleDatabasePrincipalAssignmentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasePrincipalAssignmentsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", "kustoprincipal1", armkusto.DatabasePrincipalAssignment{ - Properties: &armkusto.DatabasePrincipalProperties{ - PrincipalID: to.Ptr("87654321-1234-1234-1234-123456789123"), - PrincipalType: to.Ptr(armkusto.PrincipalTypeApp), - Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - TenantID: to.Ptr("12345678-1234-1234-1234-123456789123"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabasePrincipalAssignmentsDelete.json -func ExampleDatabasePrincipalAssignmentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasePrincipalAssignmentsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", "kustoprincipal1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabasePrincipalAssignmentsList.json -func ExampleDatabasePrincipalAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasePrincipalAssignmentsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("kustorptest", "kustoCluster", "Kustodatabase8", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/databases_client.go b/sdk/resourcemanager/kusto/armkusto/databases_client.go index d2e04eff9fbd..3f7143884894 100644 --- a/sdk/resourcemanager/kusto/armkusto/databases_client.go +++ b/sdk/resourcemanager/kusto/armkusto/databases_client.go @@ -32,10 +32,10 @@ type DatabasesClient struct { } // NewDatabasesClient creates a new instance of DatabasesClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabasesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential // AddPrincipals - Add Database principals permissions. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasesClientAddPrincipalsOptions contains the optional parameters for the DatabasesClient.AddPrincipals method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasesClientAddPrincipalsOptions contains the optional parameters for the DatabasesClient.AddPrincipals method. func (client *DatabasesClient) AddPrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToAdd DatabasePrincipalListRequest, options *DatabasesClientAddPrincipalsOptions) (DatabasesClientAddPrincipalsResponse, error) { req, err := client.addPrincipalsCreateRequest(ctx, resourceGroupName, clusterName, databaseName, databasePrincipalsToAdd, options) if err != nil { @@ -103,7 +104,7 @@ func (client *DatabasesClient) addPrincipalsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, databasePrincipalsToAdd) @@ -120,12 +121,13 @@ func (client *DatabasesClient) addPrincipalsHandleResponse(resp *http.Response) // CheckNameAvailability - Checks that the databases resource name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// resourceName - The name of the resource. -// options - DatabasesClientCheckNameAvailabilityOptions contains the optional parameters for the DatabasesClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - resourceName - The name of the resource. +// - options - DatabasesClientCheckNameAvailabilityOptions contains the optional parameters for the DatabasesClient.CheckNameAvailability +// method. func (client *DatabasesClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, resourceName CheckNameRequest, options *DatabasesClientCheckNameAvailabilityOptions) (DatabasesClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, clusterName, resourceName, options) if err != nil { @@ -161,7 +163,7 @@ func (client *DatabasesClient) checkNameAvailabilityCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resourceName) @@ -178,13 +180,14 @@ func (client *DatabasesClient) checkNameAvailabilityHandleResponse(resp *http.Re // BeginCreateOrUpdate - Creates or updates a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate +// method. func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DatabaseClassification, options *DatabasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabasesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, databaseName, parameters, options) @@ -199,7 +202,8 @@ func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates or updates a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *DatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DatabaseClassification, options *DatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, databaseName, parameters, options) if err != nil { @@ -239,7 +243,7 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") if options != nil && options.CallerRole != nil { reqQP.Set("callerRole", string(*options.CallerRole)) } @@ -250,11 +254,12 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes the database with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method. func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*runtime.Poller[DatabasesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, databaseName, options) @@ -269,7 +274,8 @@ func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes the database with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, databaseName, options) if err != nil { @@ -309,7 +315,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -317,11 +323,12 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource // Get - Returns a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method. func (client *DatabasesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, options *DatabasesClientGetOptions) (DatabasesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, databaseName, options) if err != nil { @@ -361,7 +368,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -377,10 +384,12 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases } // NewListByClusterPager - Returns the list of databases of the given Kusto cluster. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - DatabasesClientListByClusterOptions contains the optional parameters for the DatabasesClient.ListByCluster method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - DatabasesClientListByClusterOptions contains the optional parameters for the DatabasesClient.NewListByClusterPager +// method. func (client *DatabasesClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *DatabasesClientListByClusterOptions) *runtime.Pager[DatabasesClientListByClusterResponse] { return runtime.NewPager(runtime.PagingHandler[DatabasesClientListByClusterResponse]{ More: func(page DatabasesClientListByClusterResponse) bool { @@ -423,7 +432,7 @@ func (client *DatabasesClient) listByClusterCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -439,12 +448,13 @@ func (client *DatabasesClient) listByClusterHandleResponse(resp *http.Response) } // NewListPrincipalsPager - Returns a list of database principals of the given Kusto cluster and database. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasesClientListPrincipalsOptions contains the optional parameters for the DatabasesClient.ListPrincipals -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasesClientListPrincipalsOptions contains the optional parameters for the DatabasesClient.NewListPrincipalsPager +// method. func (client *DatabasesClient) NewListPrincipalsPager(resourceGroupName string, clusterName string, databaseName string, options *DatabasesClientListPrincipalsOptions) *runtime.Pager[DatabasesClientListPrincipalsResponse] { return runtime.NewPager(runtime.PagingHandler[DatabasesClientListPrincipalsResponse]{ More: func(page DatabasesClientListPrincipalsResponse) bool { @@ -491,7 +501,7 @@ func (client *DatabasesClient) listPrincipalsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -508,13 +518,14 @@ func (client *DatabasesClient) listPrincipalsHandleResponse(resp *http.Response) // RemovePrincipals - Remove Database principals permissions. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasesClientRemovePrincipalsOptions contains the optional parameters for the DatabasesClient.RemovePrincipals -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasesClientRemovePrincipalsOptions contains the optional parameters for the DatabasesClient.RemovePrincipals +// method. func (client *DatabasesClient) RemovePrincipals(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, databasePrincipalsToRemove DatabasePrincipalListRequest, options *DatabasesClientRemovePrincipalsOptions) (DatabasesClientRemovePrincipalsResponse, error) { req, err := client.removePrincipalsCreateRequest(ctx, resourceGroupName, clusterName, databaseName, databasePrincipalsToRemove, options) if err != nil { @@ -554,7 +565,7 @@ func (client *DatabasesClient) removePrincipalsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, databasePrincipalsToRemove) @@ -571,12 +582,13 @@ func (client *DatabasesClient) removePrincipalsHandleResponse(resp *http.Respons // BeginUpdate - Updates a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DatabasesClientBeginUpdateOptions contains the optional parameters for the DatabasesClient.BeginUpdate method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DatabasesClientBeginUpdateOptions contains the optional parameters for the DatabasesClient.BeginUpdate method. func (client *DatabasesClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DatabaseClassification, options *DatabasesClientBeginUpdateOptions) (*runtime.Poller[DatabasesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, clusterName, databaseName, parameters, options) @@ -591,7 +603,8 @@ func (client *DatabasesClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Updates a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *DatabasesClient) update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DatabaseClassification, options *DatabasesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, databaseName, parameters, options) if err != nil { @@ -631,7 +644,7 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") if options != nil && options.CallerRole != nil { reqQP.Set("callerRole", string(*options.CallerRole)) } diff --git a/sdk/resourcemanager/kusto/armkusto/databases_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/databases_client_example_test.go deleted file mode 100644 index 41d31e201f33..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/databases_client_example_test.go +++ /dev/null @@ -1,304 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabasesCheckNameAvailability.json -func ExampleDatabasesClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, "kustorptest", "kustoCluster", armkusto.CheckNameRequest{ - Name: to.Ptr("database1"), - Type: to.Ptr(armkusto.TypeMicrosoftKustoClustersDatabases), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabasesListByCluster.json -func ExampleDatabasesClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByClusterPager("kustorptest", "kustoCluster", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabasesGet.json -func ExampleDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabaseReadonlyUpdate.json -func ExampleDatabasesClient_BeginCreateOrUpdate_kustoReadOnlyDatabaseUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "kustoReadOnlyDatabase", &armkusto.ReadOnlyFollowingDatabase{ - Kind: to.Ptr(armkusto.KindReadOnlyFollowing), - Location: to.Ptr("westus"), - Properties: &armkusto.ReadOnlyFollowingDatabaseProperties{ - HotCachePeriod: to.Ptr("P1D"), - }, - }, &armkusto.DatabasesClientBeginCreateOrUpdateOptions{CallerRole: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabasesCreateOrUpdate.json -func ExampleDatabasesClient_BeginCreateOrUpdate_kustoReadWriteDatabaseCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", &armkusto.ReadWriteDatabase{ - Kind: to.Ptr(armkusto.KindReadWrite), - Location: to.Ptr("westus"), - Properties: &armkusto.ReadWriteDatabaseProperties{ - SoftDeletePeriod: to.Ptr("P1D"), - }, - }, &armkusto.DatabasesClientBeginCreateOrUpdateOptions{CallerRole: to.Ptr(armkusto.CallerRoleAdmin)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabasesUpdate.json -func ExampleDatabasesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", &armkusto.ReadWriteDatabase{ - Kind: to.Ptr(armkusto.KindReadWrite), - Properties: &armkusto.ReadWriteDatabaseProperties{ - HotCachePeriod: to.Ptr("P1D"), - }, - }, &armkusto.DatabasesClientBeginUpdateOptions{CallerRole: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabasesDelete.json -func ExampleDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabaseListPrincipals.json -func ExampleDatabasesClient_NewListPrincipalsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPrincipalsPager("kustorptest", "kustoCluster", "KustoDatabase8", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabaseAddPrincipals.json -func ExampleDatabasesClient_AddPrincipals() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.AddPrincipals(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", armkusto.DatabasePrincipalListRequest{ - Value: []*armkusto.DatabasePrincipal{ - { - Name: to.Ptr("Some User"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeUser), - AppID: to.Ptr(""), - Email: to.Ptr("user@microsoft.com"), - Fqn: to.Ptr("aaduser=some_guid"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - }, - { - Name: to.Ptr("Kusto"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeGroup), - AppID: to.Ptr(""), - Email: to.Ptr("kusto@microsoft.com"), - Fqn: to.Ptr("aadgroup=some_guid"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleViewer), - }, - { - Name: to.Ptr("SomeApp"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeApp), - AppID: to.Ptr("some_guid_app_id"), - Email: to.Ptr(""), - Fqn: to.Ptr("aadapp=some_guid_app_id"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDatabaseRemovePrincipals.json -func ExampleDatabasesClient_RemovePrincipals() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDatabasesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RemovePrincipals(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", armkusto.DatabasePrincipalListRequest{ - Value: []*armkusto.DatabasePrincipal{ - { - Name: to.Ptr("Some User"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeUser), - AppID: to.Ptr(""), - Email: to.Ptr("user@microsoft.com"), - Fqn: to.Ptr("aaduser=some_guid"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - }, - { - Name: to.Ptr("Kusto"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeGroup), - AppID: to.Ptr(""), - Email: to.Ptr("kusto@microsoft.com"), - Fqn: to.Ptr("aadgroup=some_guid"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleViewer), - }, - { - Name: to.Ptr("SomeApp"), - Type: to.Ptr(armkusto.DatabasePrincipalTypeApp), - AppID: to.Ptr("some_guid_app_id"), - Email: to.Ptr(""), - Fqn: to.Ptr("aadapp=some_guid_app_id"), - Role: to.Ptr(armkusto.DatabasePrincipalRoleAdmin), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/kusto/armkusto/dataconnections_client.go b/sdk/resourcemanager/kusto/armkusto/dataconnections_client.go index c8184118fdf9..15f326c3a9f7 100644 --- a/sdk/resourcemanager/kusto/armkusto/dataconnections_client.go +++ b/sdk/resourcemanager/kusto/armkusto/dataconnections_client.go @@ -32,10 +32,10 @@ type DataConnectionsClient struct { } // NewDataConnectionsClient creates a new instance of DataConnectionsClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDataConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataConnectionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewDataConnectionsClient(subscriptionID string, credential azcore.TokenCred // CheckNameAvailability - Checks that the data connection name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DataConnectionsClientCheckNameAvailabilityOptions contains the optional parameters for the DataConnectionsClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DataConnectionsClientCheckNameAvailabilityOptions contains the optional parameters for the DataConnectionsClient.CheckNameAvailability +// method. func (client *DataConnectionsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName DataConnectionCheckNameRequest, options *DataConnectionsClientCheckNameAvailabilityOptions) (DataConnectionsClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, options) if err != nil { @@ -104,7 +105,7 @@ func (client *DataConnectionsClient) checkNameAvailabilityCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, dataConnectionName) @@ -121,14 +122,15 @@ func (client *DataConnectionsClient) checkNameAvailabilityHandleResponse(resp *h // BeginCreateOrUpdate - Creates or updates a data connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DataConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DataConnectionsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DataConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DataConnectionsClient.BeginCreateOrUpdate +// method. func (client *DataConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters DataConnectionClassification, options *DataConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DataConnectionsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options) @@ -143,7 +145,8 @@ func (client *DataConnectionsClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Creates or updates a data connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *DataConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters DataConnectionClassification, options *DataConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options) if err != nil { @@ -187,7 +190,7 @@ func (client *DataConnectionsClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -195,13 +198,14 @@ func (client *DataConnectionsClient) createOrUpdateCreateRequest(ctx context.Con // BeginDataConnectionValidation - Checks that the data connection parameters are valid. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DataConnectionsClientBeginDataConnectionValidationOptions contains the optional parameters for the DataConnectionsClient.BeginDataConnectionValidation -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DataConnectionsClientBeginDataConnectionValidationOptions contains the optional parameters for the DataConnectionsClient.BeginDataConnectionValidation +// method. func (client *DataConnectionsClient) BeginDataConnectionValidation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DataConnectionValidation, options *DataConnectionsClientBeginDataConnectionValidationOptions) (*runtime.Poller[DataConnectionsClientDataConnectionValidationResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.dataConnectionValidation(ctx, resourceGroupName, clusterName, databaseName, parameters, options) @@ -218,7 +222,8 @@ func (client *DataConnectionsClient) BeginDataConnectionValidation(ctx context.C // DataConnectionValidation - Checks that the data connection parameters are valid. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *DataConnectionsClient) dataConnectionValidation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DataConnectionValidation, options *DataConnectionsClientBeginDataConnectionValidationOptions) (*http.Response, error) { req, err := client.dataConnectionValidationCreateRequest(ctx, resourceGroupName, clusterName, databaseName, parameters, options) if err != nil { @@ -258,7 +263,7 @@ func (client *DataConnectionsClient) dataConnectionValidationCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -266,13 +271,14 @@ func (client *DataConnectionsClient) dataConnectionValidationCreateRequest(ctx c // BeginDelete - Deletes the data connection with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DataConnectionsClientBeginDeleteOptions contains the optional parameters for the DataConnectionsClient.BeginDelete -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DataConnectionsClientBeginDeleteOptions contains the optional parameters for the DataConnectionsClient.BeginDelete +// method. func (client *DataConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, options *DataConnectionsClientBeginDeleteOptions) (*runtime.Poller[DataConnectionsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, options) @@ -287,7 +293,8 @@ func (client *DataConnectionsClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes the data connection with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *DataConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, options *DataConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, options) if err != nil { @@ -331,7 +338,7 @@ func (client *DataConnectionsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,12 +346,13 @@ func (client *DataConnectionsClient) deleteCreateRequest(ctx context.Context, re // Get - Returns a data connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DataConnectionsClientGetOptions contains the optional parameters for the DataConnectionsClient.Get method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DataConnectionsClientGetOptions contains the optional parameters for the DataConnectionsClient.Get method. func (client *DataConnectionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, options *DataConnectionsClientGetOptions) (DataConnectionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, options) if err != nil { @@ -388,7 +396,7 @@ func (client *DataConnectionsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -404,12 +412,13 @@ func (client *DataConnectionsClient) getHandleResponse(resp *http.Response) (Dat } // NewListByDatabasePager - Returns the list of data connections of the given Kusto database. -// Generated from API version 2022-07-07 -// 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. -// options - DataConnectionsClientListByDatabaseOptions contains the optional parameters for the DataConnectionsClient.ListByDatabase -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DataConnectionsClientListByDatabaseOptions contains the optional parameters for the DataConnectionsClient.NewListByDatabasePager +// method. func (client *DataConnectionsClient) NewListByDatabasePager(resourceGroupName string, clusterName string, databaseName string, options *DataConnectionsClientListByDatabaseOptions) *runtime.Pager[DataConnectionsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DataConnectionsClientListByDatabaseResponse]{ More: func(page DataConnectionsClientListByDatabaseResponse) bool { @@ -456,7 +465,7 @@ func (client *DataConnectionsClient) listByDatabaseCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -473,14 +482,15 @@ func (client *DataConnectionsClient) listByDatabaseHandleResponse(resp *http.Res // BeginUpdate - Updates a data connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - DataConnectionsClientBeginUpdateOptions contains the optional parameters for the DataConnectionsClient.BeginUpdate -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - DataConnectionsClientBeginUpdateOptions contains the optional parameters for the DataConnectionsClient.BeginUpdate +// method. func (client *DataConnectionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters DataConnectionClassification, options *DataConnectionsClientBeginUpdateOptions) (*runtime.Poller[DataConnectionsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options) @@ -495,7 +505,8 @@ func (client *DataConnectionsClient) BeginUpdate(ctx context.Context, resourceGr // Update - Updates a data connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *DataConnectionsClient) update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, dataConnectionName string, parameters DataConnectionClassification, options *DataConnectionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, databaseName, dataConnectionName, parameters, options) if err != nil { @@ -539,7 +550,7 @@ func (client *DataConnectionsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/kusto/armkusto/dataconnections_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/dataconnections_client_example_test.go deleted file mode 100644 index bbb9fd34d938..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/dataconnections_client_example_test.go +++ /dev/null @@ -1,341 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDataConnectionsListByDatabase.json -func ExampleDataConnectionsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDataConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("kustorptest", "kustoCluster", "KustoDatabase8", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDataConnectionEventGridValidationAsync.json -func ExampleDataConnectionsClient_BeginDataConnectionValidation_kustoDataConnectionEventGridValidation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDataConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDataConnectionValidation(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", armkusto.DataConnectionValidation{ - DataConnectionName: to.Ptr("dataConnectionTest"), - Properties: &armkusto.EventGridDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventGrid), - Properties: &armkusto.EventGridConnectionProperties{ - BlobStorageEventType: to.Ptr(armkusto.BlobStorageEventTypeMicrosoftStorageBlobCreated), - ConsumerGroup: to.Ptr("$Default"), - DataFormat: to.Ptr(armkusto.EventGridDataFormatJSON), - DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - EventGridResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest"), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - IgnoreFirstRecord: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - MappingRuleName: to.Ptr("TestMapping"), - StorageAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - TableName: to.Ptr("TestTable"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDataConnectionValidationAsync.json -func ExampleDataConnectionsClient_BeginDataConnectionValidation_kustoDataConnectionValidation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDataConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDataConnectionValidation(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", armkusto.DataConnectionValidation{ - DataConnectionName: to.Ptr("dataConnectionTest"), - Properties: &armkusto.EventHubDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventHub), - Properties: &armkusto.EventHubConnectionProperties{ - Compression: to.Ptr(armkusto.CompressionNone), - ConsumerGroup: to.Ptr("testConsumerGroup1"), - DataFormat: to.Ptr(armkusto.EventHubDataFormatJSON), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - MappingRuleName: to.Ptr("TestMapping"), - TableName: to.Ptr("TestTable"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDataConnectionsCheckNameAvailability.json -func ExampleDataConnectionsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDataConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", armkusto.DataConnectionCheckNameRequest{ - Name: to.Ptr("DataConnections8"), - Type: to.Ptr("Microsoft.Kusto/clusters/databases/dataConnections"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDataConnectionsEventGridGet.json -func ExampleDataConnectionsClient_Get_kustoDataConnectionsEventGridGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDataConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDataConnectionsGet.json -func ExampleDataConnectionsClient_Get_kustoDataConnectionsGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDataConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDataConnectionsCreateOrUpdate.json -func ExampleDataConnectionsClient_BeginCreateOrUpdate_kustoDataConnectionsCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDataConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", &armkusto.EventHubDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventHub), - Location: to.Ptr("westus"), - Properties: &armkusto.EventHubConnectionProperties{ - ConsumerGroup: to.Ptr("testConsumerGroup1"), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDataConnectionsEventGridCreateOrUpdate.json -func ExampleDataConnectionsClient_BeginCreateOrUpdate_kustoDataConnectionsEventGridCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDataConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", &armkusto.EventGridDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventGrid), - Location: to.Ptr("westus"), - Properties: &armkusto.EventGridConnectionProperties{ - BlobStorageEventType: to.Ptr(armkusto.BlobStorageEventTypeMicrosoftStorageBlobCreated), - ConsumerGroup: to.Ptr("$Default"), - DataFormat: to.Ptr(armkusto.EventGridDataFormatJSON), - DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - EventGridResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest"), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest2"), - IgnoreFirstRecord: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - MappingRuleName: to.Ptr("TestMapping"), - StorageAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - TableName: to.Ptr("TestTable"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDataConnectionsEventGridUpdate.json -func ExampleDataConnectionsClient_BeginUpdate_kustoDataConnectionsEventGridUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDataConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", &armkusto.EventGridDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventGrid), - Location: to.Ptr("westus"), - Properties: &armkusto.EventGridConnectionProperties{ - BlobStorageEventType: to.Ptr(armkusto.BlobStorageEventTypeMicrosoftStorageBlobCreated), - ConsumerGroup: to.Ptr("$Default"), - DataFormat: to.Ptr(armkusto.EventGridDataFormatJSON), - DatabaseRouting: to.Ptr(armkusto.DatabaseRoutingSingle), - EventGridResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount/providers/Microsoft.EventGrid/eventSubscriptions/eventSubscriptionTest"), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest2"), - IgnoreFirstRecord: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - MappingRuleName: to.Ptr("TestMapping"), - StorageAccountResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - TableName: to.Ptr("TestTable"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDataConnectionsUpdate.json -func ExampleDataConnectionsClient_BeginUpdate_kustoDataConnectionsUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDataConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", &armkusto.EventHubDataConnection{ - Kind: to.Ptr(armkusto.DataConnectionKindEventHub), - Location: to.Ptr("westus"), - Properties: &armkusto.EventHubConnectionProperties{ - ConsumerGroup: to.Ptr("testConsumerGroup1"), - EventHubResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1"), - ManagedIdentityResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/managedidentityTest1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoDataConnectionsDelete.json -func ExampleDataConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewDataConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "dataConnectionTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/go.mod b/sdk/resourcemanager/kusto/armkusto/go.mod index e0ab412ef86b..726f17de31c9 100644 --- a/sdk/resourcemanager/kusto/armkusto/go.mod +++ b/sdk/resourcemanager/kusto/armkusto/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/kusto/armkusto/go.sum b/sdk/resourcemanager/kusto/armkusto/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/kusto/armkusto/go.sum +++ b/sdk/resourcemanager/kusto/armkusto/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client.go b/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client.go index cf168cd9b051..1d44e51cb479 100644 --- a/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client.go +++ b/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client.go @@ -32,10 +32,10 @@ type ManagedPrivateEndpointsClient struct { } // NewManagedPrivateEndpointsClient creates a new instance of ManagedPrivateEndpointsClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedPrivateEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedPrivateEndpointsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewManagedPrivateEndpointsClient(subscriptionID string, credential azcore.T // CheckNameAvailability - Checks that the managed private endpoints resource name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// resourceName - The name of the resource. -// options - ManagedPrivateEndpointsClientCheckNameAvailabilityOptions contains the optional parameters for the ManagedPrivateEndpointsClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - resourceName - The name of the resource. +// - options - ManagedPrivateEndpointsClientCheckNameAvailabilityOptions contains the optional parameters for the ManagedPrivateEndpointsClient.CheckNameAvailability +// method. func (client *ManagedPrivateEndpointsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, resourceName ManagedPrivateEndpointsCheckNameRequest, options *ManagedPrivateEndpointsClientCheckNameAvailabilityOptions) (ManagedPrivateEndpointsClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, clusterName, resourceName, options) if err != nil { @@ -99,7 +100,7 @@ func (client *ManagedPrivateEndpointsClient) checkNameAvailabilityCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resourceName) @@ -116,13 +117,14 @@ func (client *ManagedPrivateEndpointsClient) checkNameAvailabilityHandleResponse // BeginCreateOrUpdate - Creates a managed private endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ManagedPrivateEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedPrivateEndpointsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ManagedPrivateEndpointsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedPrivateEndpointsClient.BeginCreateOrUpdate +// method. func (client *ManagedPrivateEndpointsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, parameters ManagedPrivateEndpoint, options *ManagedPrivateEndpointsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedPrivateEndpointsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, managedPrivateEndpointName, parameters, options) @@ -137,7 +139,8 @@ func (client *ManagedPrivateEndpointsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Creates a managed private endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ManagedPrivateEndpointsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, parameters ManagedPrivateEndpoint, options *ManagedPrivateEndpointsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, managedPrivateEndpointName, parameters, options) if err != nil { @@ -177,7 +180,7 @@ func (client *ManagedPrivateEndpointsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -185,12 +188,13 @@ func (client *ManagedPrivateEndpointsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a managed private endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ManagedPrivateEndpointsClientBeginDeleteOptions contains the optional parameters for the ManagedPrivateEndpointsClient.BeginDelete -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ManagedPrivateEndpointsClientBeginDeleteOptions contains the optional parameters for the ManagedPrivateEndpointsClient.BeginDelete +// method. func (client *ManagedPrivateEndpointsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, options *ManagedPrivateEndpointsClientBeginDeleteOptions) (*runtime.Poller[ManagedPrivateEndpointsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, managedPrivateEndpointName, options) @@ -205,7 +209,8 @@ func (client *ManagedPrivateEndpointsClient) BeginDelete(ctx context.Context, re // Delete - Deletes a managed private endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ManagedPrivateEndpointsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, options *ManagedPrivateEndpointsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, managedPrivateEndpointName, options) if err != nil { @@ -245,7 +250,7 @@ func (client *ManagedPrivateEndpointsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,12 +258,13 @@ func (client *ManagedPrivateEndpointsClient) deleteCreateRequest(ctx context.Con // Get - Gets a managed private endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ManagedPrivateEndpointsClientGetOptions contains the optional parameters for the ManagedPrivateEndpointsClient.Get -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ManagedPrivateEndpointsClientGetOptions contains the optional parameters for the ManagedPrivateEndpointsClient.Get +// method. func (client *ManagedPrivateEndpointsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, options *ManagedPrivateEndpointsClientGetOptions) (ManagedPrivateEndpointsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, managedPrivateEndpointName, options) if err != nil { @@ -298,7 +304,7 @@ func (client *ManagedPrivateEndpointsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -314,11 +320,12 @@ func (client *ManagedPrivateEndpointsClient) getHandleResponse(resp *http.Respon } // NewListPager - Returns the list of managed private endpoints. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - ManagedPrivateEndpointsClientListOptions contains the optional parameters for the ManagedPrivateEndpointsClient.List -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - ManagedPrivateEndpointsClientListOptions contains the optional parameters for the ManagedPrivateEndpointsClient.NewListPager +// method. func (client *ManagedPrivateEndpointsClient) NewListPager(resourceGroupName string, clusterName string, options *ManagedPrivateEndpointsClientListOptions) *runtime.Pager[ManagedPrivateEndpointsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedPrivateEndpointsClientListResponse]{ More: func(page ManagedPrivateEndpointsClientListResponse) bool { @@ -361,7 +368,7 @@ func (client *ManagedPrivateEndpointsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -378,13 +385,14 @@ func (client *ManagedPrivateEndpointsClient) listHandleResponse(resp *http.Respo // BeginUpdate - Updates a managed private endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ManagedPrivateEndpointsClientBeginUpdateOptions contains the optional parameters for the ManagedPrivateEndpointsClient.BeginUpdate -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ManagedPrivateEndpointsClientBeginUpdateOptions contains the optional parameters for the ManagedPrivateEndpointsClient.BeginUpdate +// method. func (client *ManagedPrivateEndpointsClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, parameters ManagedPrivateEndpoint, options *ManagedPrivateEndpointsClientBeginUpdateOptions) (*runtime.Poller[ManagedPrivateEndpointsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, clusterName, managedPrivateEndpointName, parameters, options) @@ -399,7 +407,8 @@ func (client *ManagedPrivateEndpointsClient) BeginUpdate(ctx context.Context, re // Update - Updates a managed private endpoint. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ManagedPrivateEndpointsClient) update(ctx context.Context, resourceGroupName string, clusterName string, managedPrivateEndpointName string, parameters ManagedPrivateEndpoint, options *ManagedPrivateEndpointsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, managedPrivateEndpointName, parameters, options) if err != nil { @@ -439,7 +448,7 @@ func (client *ManagedPrivateEndpointsClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client_example_test.go deleted file mode 100644 index 3953fd8a87db..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client_example_test.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoManagedPrivateEndpointsCheckNameAvailability.json -func ExampleManagedPrivateEndpointsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewManagedPrivateEndpointsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, "kustorptest", "kustoCluster", armkusto.ManagedPrivateEndpointsCheckNameRequest{ - Name: to.Ptr("pme1"), - Type: to.Ptr("Microsoft.Kusto/clusters/managedPrivateEndpoints"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoManagedPrivateEndpointsList.json -func ExampleManagedPrivateEndpointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewManagedPrivateEndpointsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("kustorptest", "kustoCluster", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoManagedPrivateEndpointsGet.json -func ExampleManagedPrivateEndpointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewManagedPrivateEndpointsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "kustorptest", "kustoCluster", "managedPrivateEndpointTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoManagedPrivateEndpointsCreateOrUpdate.json -func ExampleManagedPrivateEndpointsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewManagedPrivateEndpointsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "managedPrivateEndpointTest", armkusto.ManagedPrivateEndpoint{ - Properties: &armkusto.ManagedPrivateEndpointProperties{ - GroupID: to.Ptr("blob"), - PrivateLinkResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/storageAccountTest"), - RequestMessage: to.Ptr("Please Approve."), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoManagedPrivateEndpointsUpdate.json -func ExampleManagedPrivateEndpointsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewManagedPrivateEndpointsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "kustorptest", "kustoCluster", "managedPrivateEndpointTest", armkusto.ManagedPrivateEndpoint{ - Properties: &armkusto.ManagedPrivateEndpointProperties{ - GroupID: to.Ptr("blob"), - PrivateLinkResourceID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Storage/storageAccounts/storageAccountTest"), - RequestMessage: to.Ptr("Please Approve Managed Private Endpoint Request."), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoManagedPrivateEndpointsDelete.json -func ExampleManagedPrivateEndpointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewManagedPrivateEndpointsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "managedPrivateEndpointTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/models.go b/sdk/resourcemanager/kusto/armkusto/models.go index 7e74ffe8c0ef..5dc583add181 100644 --- a/sdk/resourcemanager/kusto/armkusto/models.go +++ b/sdk/resourcemanager/kusto/armkusto/models.go @@ -107,7 +107,7 @@ type AttachedDatabaseConfigurationsClientGetOptions struct { // placeholder for future optional parameters } -// AttachedDatabaseConfigurationsClientListByClusterOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.ListByCluster +// AttachedDatabaseConfigurationsClientListByClusterOptions contains the optional parameters for the AttachedDatabaseConfigurationsClient.NewListByClusterPager // method. type AttachedDatabaseConfigurationsClientListByClusterOptions struct { // placeholder for future optional parameters @@ -285,7 +285,7 @@ type ClusterPrincipalAssignmentsClientGetOptions struct { // placeholder for future optional parameters } -// ClusterPrincipalAssignmentsClientListOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.List +// ClusterPrincipalAssignmentsClientListOptions contains the optional parameters for the ClusterPrincipalAssignmentsClient.NewListPager // method. type ClusterPrincipalAssignmentsClientListOptions struct { // placeholder for future optional parameters @@ -352,6 +352,9 @@ type ClusterProperties struct { // KeyVault properties for the cluster encryption. KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + // List of the cluster's language extensions. + LanguageExtensions *LanguageExtensionsList `json:"languageExtensions,omitempty"` + // Optimized auto scale definition. OptimizedAutoscale *OptimizedAutoscale `json:"optimizedAutoscale,omitempty"` @@ -377,9 +380,6 @@ type ClusterProperties struct { // READ-ONLY; The cluster data ingestion URI. DataIngestionURI *string `json:"dataIngestionUri,omitempty" azure:"ro"` - // READ-ONLY; List of the cluster's language extensions. - LanguageExtensions *LanguageExtensionsList `json:"languageExtensions,omitempty" azure:"ro"` - // READ-ONLY; A list of private endpoint connections. PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` @@ -501,40 +501,42 @@ type ClustersClientGetOptions struct { // placeholder for future optional parameters } -// ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.ListByResourceGroup method. +// ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager +// method. type ClustersClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ClustersClientListFollowerDatabasesOptions contains the optional parameters for the ClustersClient.ListFollowerDatabases +// ClustersClientListFollowerDatabasesOptions contains the optional parameters for the ClustersClient.NewListFollowerDatabasesPager // method. type ClustersClientListFollowerDatabasesOptions struct { // placeholder for future optional parameters } -// ClustersClientListLanguageExtensionsOptions contains the optional parameters for the ClustersClient.ListLanguageExtensions +// ClustersClientListLanguageExtensionsOptions contains the optional parameters for the ClustersClient.NewListLanguageExtensionsPager // method. type ClustersClientListLanguageExtensionsOptions struct { // placeholder for future optional parameters } -// ClustersClientListOptions contains the optional parameters for the ClustersClient.List method. +// ClustersClientListOptions contains the optional parameters for the ClustersClient.NewListPager method. type ClustersClientListOptions struct { // placeholder for future optional parameters } -// ClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the ClustersClient.ListOutboundNetworkDependenciesEndpoints +// ClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the ClustersClient.NewListOutboundNetworkDependenciesEndpointsPager // method. type ClustersClientListOutboundNetworkDependenciesEndpointsOptions struct { // placeholder for future optional parameters } -// ClustersClientListSKUsByResourceOptions contains the optional parameters for the ClustersClient.ListSKUsByResource method. +// ClustersClientListSKUsByResourceOptions contains the optional parameters for the ClustersClient.NewListSKUsByResourcePager +// method. type ClustersClientListSKUsByResourceOptions struct { // placeholder for future optional parameters } -// ClustersClientListSKUsOptions contains the optional parameters for the ClustersClient.ListSKUs method. +// ClustersClientListSKUsOptions contains the optional parameters for the ClustersClient.NewListSKUsPager method. type ClustersClientListSKUsOptions struct { // placeholder for future optional parameters } @@ -547,10 +549,74 @@ type ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalpr PrincipalID *string `json:"principalId,omitempty" azure:"ro"` } +// CosmosDbDataConnection - Class representing a CosmosDb data connection. +type CosmosDbDataConnection struct { + // REQUIRED; Kind of the endpoint for the data connection + Kind *DataConnectionKind `json:"kind,omitempty"` + + // Resource location. + Location *string `json:"location,omitempty"` + + // The properties of the CosmosDb data connection. + Properties *CosmosDbDataConnectionProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// GetDataConnection implements the DataConnectionClassification interface for type CosmosDbDataConnection. +func (c *CosmosDbDataConnection) GetDataConnection() *DataConnection { + return &DataConnection{ + Location: c.Location, + Kind: c.Kind, + ID: c.ID, + Name: c.Name, + Type: c.Type, + } +} + +// CosmosDbDataConnectionProperties - Class representing the Kusto CosmosDb data connection properties. +type CosmosDbDataConnectionProperties struct { + // REQUIRED; The resource ID of the Cosmos DB account used to create the data connection. + CosmosDbAccountResourceID *string `json:"cosmosDbAccountResourceId,omitempty"` + + // REQUIRED; The name of an existing container in the Cosmos DB database. + CosmosDbContainer *string `json:"cosmosDbContainer,omitempty"` + + // REQUIRED; The name of an existing database in the Cosmos DB account. + CosmosDbDatabase *string `json:"cosmosDbDatabase,omitempty"` + + // REQUIRED; The resource ID of a managed system or user-assigned identity. The identity is used to authenticate with Cosmos + // DB. + ManagedIdentityResourceID *string `json:"managedIdentityResourceId,omitempty"` + + // REQUIRED; The case-sensitive name of the existing target table in your cluster. Retrieved data is ingested into this table. + TableName *string `json:"tableName,omitempty"` + + // The name of an existing mapping rule to use when ingesting the retrieved data. + MappingRuleName *string `json:"mappingRuleName,omitempty"` + + // Optional. If defined, the data connection retrieves Cosmos DB documents created or updated after the specified retrieval + // start date. + RetrievalStartDate *time.Time `json:"retrievalStartDate,omitempty"` + + // READ-ONLY; The object ID of the managed identity resource. + ManagedIdentityObjectID *string `json:"managedIdentityObjectId,omitempty" azure:"ro"` + + // READ-ONLY; The provisioned state of the resource. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + // DataConnectionClassification provides polymorphic access to related types. // Call the interface's GetDataConnection() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *DataConnection, *EventGridDataConnection, *EventHubDataConnection, *IotHubDataConnection +// - *CosmosDbDataConnection, *DataConnection, *EventGridDataConnection, *EventHubDataConnection, *IotHubDataConnection type DataConnectionClassification interface { // GetDataConnection returns the DataConnection content of the underlying type. GetDataConnection() *DataConnection @@ -651,7 +717,7 @@ type DataConnectionsClientGetOptions struct { // placeholder for future optional parameters } -// DataConnectionsClientListByDatabaseOptions contains the optional parameters for the DataConnectionsClient.ListByDatabase +// DataConnectionsClientListByDatabaseOptions contains the optional parameters for the DataConnectionsClient.NewListByDatabasePager // method. type DataConnectionsClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -774,7 +840,7 @@ type DatabasePrincipalAssignmentsClientGetOptions struct { // placeholder for future optional parameters } -// DatabasePrincipalAssignmentsClientListOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.List +// DatabasePrincipalAssignmentsClientListOptions contains the optional parameters for the DatabasePrincipalAssignmentsClient.NewListPager // method. type DatabasePrincipalAssignmentsClientListOptions struct { // placeholder for future optional parameters @@ -867,12 +933,12 @@ type DatabasesClientGetOptions struct { // placeholder for future optional parameters } -// DatabasesClientListByClusterOptions contains the optional parameters for the DatabasesClient.ListByCluster method. +// DatabasesClientListByClusterOptions contains the optional parameters for the DatabasesClient.NewListByClusterPager method. type DatabasesClientListByClusterOptions struct { // placeholder for future optional parameters } -// DatabasesClientListPrincipalsOptions contains the optional parameters for the DatabasesClient.ListPrincipals method. +// DatabasesClientListPrincipalsOptions contains the optional parameters for the DatabasesClient.NewListPrincipalsPager method. type DatabasesClientListPrincipalsOptions struct { // placeholder for future optional parameters } @@ -1174,6 +1240,9 @@ type KeyVaultProperties struct { // LanguageExtension - The language extension object. type LanguageExtension struct { + // The language extension image name. + LanguageExtensionImageName *LanguageExtensionImageName `json:"languageExtensionImageName,omitempty"` + // The language extension name. LanguageExtensionName *LanguageExtensionName `json:"languageExtensionName,omitempty"` } @@ -1274,7 +1343,8 @@ type ManagedPrivateEndpointsClientGetOptions struct { // placeholder for future optional parameters } -// ManagedPrivateEndpointsClientListOptions contains the optional parameters for the ManagedPrivateEndpointsClient.List method. +// ManagedPrivateEndpointsClientListOptions contains the optional parameters for the ManagedPrivateEndpointsClient.NewListPager +// method. type ManagedPrivateEndpointsClientListOptions struct { // placeholder for future optional parameters } @@ -1291,7 +1361,7 @@ type Operation struct { Origin *string `json:"origin,omitempty"` // Properties of the operation. - Properties interface{} `json:"properties,omitempty"` + Properties any `json:"properties,omitempty"` } // OperationDisplay - The object that describes the operation. @@ -1367,7 +1437,7 @@ type OperationResultProperties struct { ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -1499,7 +1569,7 @@ type PrivateEndpointConnectionsClientGetOptions struct { // placeholder for future optional parameters } -// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List +// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager // method. type PrivateEndpointConnectionsClientListOptions struct { // placeholder for future optional parameters @@ -1552,7 +1622,8 @@ type PrivateLinkResourcesClientGetOptions struct { // placeholder for future optional parameters } -// PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List method. +// PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListPager +// method. type PrivateLinkResourcesClientListOptions struct { // placeholder for future optional parameters } @@ -1684,6 +1755,24 @@ type ReadWriteDatabaseProperties struct { Statistics *DatabaseStatistics `json:"statistics,omitempty" azure:"ro"` } +// ResourceSKUCapabilities - Describes The SKU capabilities object. +type ResourceSKUCapabilities struct { + // READ-ONLY; An invariant to describe the feature. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; An invariant if the feature is measured by quantity. + Value *string `json:"value,omitempty" azure:"ro"` +} + +// ResourceSKUZoneDetails - Describes The zonal capabilities of a SKU. +type ResourceSKUZoneDetails struct { + // READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. + Capabilities []*ResourceSKUCapabilities `json:"capabilities,omitempty" azure:"ro"` + + // READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. + Name []*string `json:"name,omitempty" azure:"ro"` +} + // SKUDescription - The Kusto SKU description of given resource type type SKUDescription struct { // READ-ONLY; Locations and zones @@ -1699,7 +1788,7 @@ type SKUDescription struct { ResourceType *string `json:"resourceType,omitempty" azure:"ro"` // READ-ONLY; The restrictions because of which SKU cannot be used - Restrictions []interface{} `json:"restrictions,omitempty" azure:"ro"` + Restrictions []any `json:"restrictions,omitempty" azure:"ro"` // READ-ONLY; The tier of the SKU Tier *string `json:"tier,omitempty" azure:"ro"` @@ -1716,10 +1805,18 @@ type SKULocationInfoItem struct { // REQUIRED; The available location of the SKU. Location *string `json:"location,omitempty"` + // Gets details of capabilities available to a SKU in specific zones. + ZoneDetails []*ResourceSKUZoneDetails `json:"zoneDetails,omitempty"` + // The available zone of the SKU. Zones []*string `json:"zones,omitempty"` } +// SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. +type SKUsClientListOptions struct { + // placeholder for future optional parameters +} + // Script - Class representing a database script. type Script struct { // The database script. @@ -1805,7 +1902,7 @@ type ScriptsClientGetOptions struct { // placeholder for future optional parameters } -// ScriptsClientListByDatabaseOptions contains the optional parameters for the ScriptsClient.ListByDatabase method. +// ScriptsClientListByDatabaseOptions contains the optional parameters for the ScriptsClient.NewListByDatabasePager method. type ScriptsClientListByDatabaseOptions struct { // placeholder for future optional parameters } @@ -1833,13 +1930,19 @@ type SystemData struct { // TableLevelSharingProperties - Tables that will be included and excluded in the follower database type TableLevelSharingProperties struct { - // List of external tables exclude from the follower database + // List of external tables to exclude from the follower database ExternalTablesToExclude []*string `json:"externalTablesToExclude,omitempty"` // List of external tables to include in the follower database ExternalTablesToInclude []*string `json:"externalTablesToInclude,omitempty"` - // List of materialized views exclude from the follower database + // List of functions to exclude from the follower database + FunctionsToExclude []*string `json:"functionsToExclude,omitempty"` + + // List of functions to include in the follower database + FunctionsToInclude []*string `json:"functionsToInclude,omitempty"` + + // List of materialized views to exclude from the follower database MaterializedViewsToExclude []*string `json:"materializedViewsToExclude,omitempty"` // List of materialized views to include in the follower database diff --git a/sdk/resourcemanager/kusto/armkusto/models_serde.go b/sdk/resourcemanager/kusto/armkusto/models_serde.go index cf67173e736a..f8554d1462ad 100644 --- a/sdk/resourcemanager/kusto/armkusto/models_serde.go +++ b/sdk/resourcemanager/kusto/armkusto/models_serde.go @@ -18,7 +18,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type AcceptedAudiences. func (a AcceptedAudiences) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } @@ -45,7 +45,7 @@ func (a *AcceptedAudiences) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AttachedDatabaseConfiguration. func (a AttachedDatabaseConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "location", a.Location) populate(objectMap, "name", a.Name) @@ -88,7 +88,7 @@ func (a *AttachedDatabaseConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AttachedDatabaseConfigurationListResult. func (a AttachedDatabaseConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } @@ -115,7 +115,7 @@ func (a *AttachedDatabaseConfigurationListResult) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type AttachedDatabaseConfigurationProperties. func (a AttachedDatabaseConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "attachedDatabaseNames", a.AttachedDatabaseNames) populate(objectMap, "clusterResourceId", a.ClusterResourceID) populate(objectMap, "databaseName", a.DatabaseName) @@ -170,7 +170,7 @@ func (a *AttachedDatabaseConfigurationProperties) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type AttachedDatabaseConfigurationsCheckNameRequest. func (a AttachedDatabaseConfigurationsCheckNameRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", a.Name) objectMap["type"] = "Microsoft.Kusto/clusters/attachedDatabaseConfigurations" return json.Marshal(objectMap) @@ -201,7 +201,7 @@ func (a *AttachedDatabaseConfigurationsCheckNameRequest) UnmarshalJSON(data []by // MarshalJSON implements the json.Marshaller interface for type AzureCapacity. func (a AzureCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "default", a.Default) populate(objectMap, "maximum", a.Maximum) populate(objectMap, "minimum", a.Minimum) @@ -240,7 +240,7 @@ func (a *AzureCapacity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureResourceSKU. func (a AzureResourceSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "capacity", a.Capacity) populate(objectMap, "resourceType", a.ResourceType) populate(objectMap, "sku", a.SKU) @@ -275,7 +275,7 @@ func (a *AzureResourceSKU) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureSKU. func (a AzureSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "capacity", a.Capacity) populate(objectMap, "name", a.Name) populate(objectMap, "tier", a.Tier) @@ -310,7 +310,7 @@ func (a *AzureSKU) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CheckNameRequest. func (c CheckNameRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", c.Name) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) @@ -341,7 +341,7 @@ func (c *CheckNameRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CheckNameResult. func (c CheckNameResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "message", c.Message) populate(objectMap, "name", c.Name) populate(objectMap, "nameAvailable", c.NameAvailable) @@ -380,7 +380,7 @@ func (c *CheckNameResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Cluster. func (c Cluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", c.Etag) populate(objectMap, "id", c.ID) populate(objectMap, "identity", c.Identity) @@ -447,7 +447,7 @@ func (c *Cluster) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClusterCheckNameRequest. func (c ClusterCheckNameRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", c.Name) objectMap["type"] = "Microsoft.Kusto/clusters" return json.Marshal(objectMap) @@ -478,7 +478,7 @@ func (c *ClusterCheckNameRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClusterListResult. func (c ClusterListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } @@ -505,7 +505,7 @@ func (c *ClusterListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClusterPrincipalAssignment. func (c ClusterPrincipalAssignment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -544,7 +544,7 @@ func (c *ClusterPrincipalAssignment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClusterPrincipalAssignmentCheckNameRequest. func (c ClusterPrincipalAssignmentCheckNameRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", c.Name) objectMap["type"] = "Microsoft.Kusto/clusters/principalAssignments" return json.Marshal(objectMap) @@ -575,7 +575,7 @@ func (c *ClusterPrincipalAssignmentCheckNameRequest) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type ClusterPrincipalAssignmentListResult. func (c ClusterPrincipalAssignmentListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } @@ -602,7 +602,7 @@ func (c *ClusterPrincipalAssignmentListResult) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ClusterPrincipalProperties. func (c ClusterPrincipalProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "aadObjectId", c.AADObjectID) populate(objectMap, "principalId", c.PrincipalID) populate(objectMap, "principalName", c.PrincipalName) @@ -657,7 +657,7 @@ func (c *ClusterPrincipalProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClusterProperties. func (c ClusterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "acceptedAudiences", c.AcceptedAudiences) populate(objectMap, "allowedFqdnList", c.AllowedFqdnList) populate(objectMap, "allowedIpRangeList", c.AllowedIPRangeList) @@ -776,7 +776,7 @@ func (c *ClusterProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClusterUpdate. func (c ClusterUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) @@ -831,7 +831,7 @@ func (c *ClusterUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties. func (c ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", c.ClientID) populate(objectMap, "principalId", c.PrincipalID) return json.Marshal(objectMap) @@ -860,9 +860,115 @@ func (c *ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAddition return nil } +// MarshalJSON implements the json.Marshaller interface for type CosmosDbDataConnection. +func (c CosmosDbDataConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + objectMap["kind"] = DataConnectionKindCosmosDb + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbDataConnection. +func (c *CosmosDbDataConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CosmosDbDataConnectionProperties. +func (c CosmosDbDataConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cosmosDbAccountResourceId", c.CosmosDbAccountResourceID) + populate(objectMap, "cosmosDbContainer", c.CosmosDbContainer) + populate(objectMap, "cosmosDbDatabase", c.CosmosDbDatabase) + populate(objectMap, "managedIdentityObjectId", c.ManagedIdentityObjectID) + populate(objectMap, "managedIdentityResourceId", c.ManagedIdentityResourceID) + populate(objectMap, "mappingRuleName", c.MappingRuleName) + populate(objectMap, "provisioningState", c.ProvisioningState) + populateTimeRFC3339(objectMap, "retrievalStartDate", c.RetrievalStartDate) + populate(objectMap, "tableName", c.TableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbDataConnectionProperties. +func (c *CosmosDbDataConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cosmosDbAccountResourceId": + err = unpopulate(val, "CosmosDbAccountResourceID", &c.CosmosDbAccountResourceID) + delete(rawMsg, key) + case "cosmosDbContainer": + err = unpopulate(val, "CosmosDbContainer", &c.CosmosDbContainer) + delete(rawMsg, key) + case "cosmosDbDatabase": + err = unpopulate(val, "CosmosDbDatabase", &c.CosmosDbDatabase) + delete(rawMsg, key) + case "managedIdentityObjectId": + err = unpopulate(val, "ManagedIdentityObjectID", &c.ManagedIdentityObjectID) + delete(rawMsg, key) + case "managedIdentityResourceId": + err = unpopulate(val, "ManagedIdentityResourceID", &c.ManagedIdentityResourceID) + delete(rawMsg, key) + case "mappingRuleName": + err = unpopulate(val, "MappingRuleName", &c.MappingRuleName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "retrievalStartDate": + err = unpopulateTimeRFC3339(val, "RetrievalStartDate", &c.RetrievalStartDate) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &c.TableName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DataConnection. func (d DataConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) objectMap["kind"] = d.Kind populate(objectMap, "location", d.Location) @@ -905,7 +1011,7 @@ func (d *DataConnection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DataConnectionCheckNameRequest. func (d DataConnectionCheckNameRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", d.Name) objectMap["type"] = "Microsoft.Kusto/clusters/databases/dataConnections" return json.Marshal(objectMap) @@ -936,7 +1042,7 @@ func (d *DataConnectionCheckNameRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DataConnectionListResult. func (d DataConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } @@ -963,7 +1069,7 @@ func (d *DataConnectionListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DataConnectionValidation. func (d DataConnectionValidation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dataConnectionName", d.DataConnectionName) populate(objectMap, "properties", d.Properties) return json.Marshal(objectMap) @@ -994,7 +1100,7 @@ func (d *DataConnectionValidation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DataConnectionValidationListResult. func (d DataConnectionValidationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } @@ -1021,7 +1127,7 @@ func (d *DataConnectionValidationListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DataConnectionValidationResult. func (d DataConnectionValidationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "errorMessage", d.ErrorMessage) return json.Marshal(objectMap) } @@ -1048,7 +1154,7 @@ func (d *DataConnectionValidationResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Database. func (d Database) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) objectMap["kind"] = d.Kind populate(objectMap, "location", d.Location) @@ -1091,7 +1197,7 @@ func (d *Database) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DatabaseListResult. func (d DatabaseListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } @@ -1118,7 +1224,7 @@ func (d *DatabaseListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DatabasePrincipal. func (d DatabasePrincipal) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appId", d.AppID) populate(objectMap, "email", d.Email) populate(objectMap, "fqn", d.Fqn) @@ -1169,7 +1275,7 @@ func (d *DatabasePrincipal) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalAssignment. func (d DatabasePrincipalAssignment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) @@ -1208,7 +1314,7 @@ func (d *DatabasePrincipalAssignment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalAssignmentCheckNameRequest. func (d DatabasePrincipalAssignmentCheckNameRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", d.Name) objectMap["type"] = "Microsoft.Kusto/clusters/databases/principalAssignments" return json.Marshal(objectMap) @@ -1239,7 +1345,7 @@ func (d *DatabasePrincipalAssignmentCheckNameRequest) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalAssignmentListResult. func (d DatabasePrincipalAssignmentListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } @@ -1266,7 +1372,7 @@ func (d *DatabasePrincipalAssignmentListResult) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalListRequest. func (d DatabasePrincipalListRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } @@ -1293,7 +1399,7 @@ func (d *DatabasePrincipalListRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalListResult. func (d DatabasePrincipalListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } @@ -1320,7 +1426,7 @@ func (d *DatabasePrincipalListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalProperties. func (d DatabasePrincipalProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "aadObjectId", d.AADObjectID) populate(objectMap, "principalId", d.PrincipalID) populate(objectMap, "principalName", d.PrincipalName) @@ -1375,7 +1481,7 @@ func (d *DatabasePrincipalProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DatabaseStatistics. func (d DatabaseStatistics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "size", d.Size) return json.Marshal(objectMap) } @@ -1402,7 +1508,7 @@ func (d *DatabaseStatistics) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiagnoseVirtualNetworkResult. func (d DiagnoseVirtualNetworkResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "findings", d.Findings) return json.Marshal(objectMap) } @@ -1429,7 +1535,7 @@ func (d *DiagnoseVirtualNetworkResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EndpointDependency. func (e EndpointDependency) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "domainName", e.DomainName) populate(objectMap, "endpointDetails", e.EndpointDetails) return json.Marshal(objectMap) @@ -1460,7 +1566,7 @@ func (e *EndpointDependency) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EndpointDetail. func (e EndpointDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "port", e.Port) return json.Marshal(objectMap) } @@ -1487,7 +1593,7 @@ func (e *EndpointDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EventGridConnectionProperties. func (e EventGridConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "blobStorageEventType", e.BlobStorageEventType) populate(objectMap, "consumerGroup", e.ConsumerGroup) populate(objectMap, "dataFormat", e.DataFormat) @@ -1562,7 +1668,7 @@ func (e *EventGridConnectionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EventGridDataConnection. func (e EventGridDataConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", e.ID) objectMap["kind"] = DataConnectionKindEventGrid populate(objectMap, "location", e.Location) @@ -1609,7 +1715,7 @@ func (e *EventGridDataConnection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EventHubConnectionProperties. func (e EventHubConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "compression", e.Compression) populate(objectMap, "consumerGroup", e.ConsumerGroup) populate(objectMap, "dataFormat", e.DataFormat) @@ -1680,7 +1786,7 @@ func (e *EventHubConnectionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EventHubDataConnection. func (e EventHubDataConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", e.ID) objectMap["kind"] = DataConnectionKindEventHub populate(objectMap, "location", e.Location) @@ -1727,7 +1833,7 @@ func (e *EventHubDataConnection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FollowerDatabaseDefinition. func (f FollowerDatabaseDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "attachedDatabaseConfigurationName", f.AttachedDatabaseConfigurationName) populate(objectMap, "clusterResourceId", f.ClusterResourceID) populate(objectMap, "databaseName", f.DatabaseName) @@ -1770,7 +1876,7 @@ func (f *FollowerDatabaseDefinition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FollowerDatabaseListResult. func (f FollowerDatabaseListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", f.Value) return json.Marshal(objectMap) } @@ -1797,7 +1903,7 @@ func (f *FollowerDatabaseListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Identity. func (i Identity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "principalId", i.PrincipalID) populate(objectMap, "tenantId", i.TenantID) populate(objectMap, "type", i.Type) @@ -1836,7 +1942,7 @@ func (i *Identity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IotHubConnectionProperties. func (i IotHubConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "consumerGroup", i.ConsumerGroup) populate(objectMap, "dataFormat", i.DataFormat) populate(objectMap, "databaseRouting", i.DatabaseRouting) @@ -1899,7 +2005,7 @@ func (i *IotHubConnectionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IotHubDataConnection. func (i IotHubDataConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", i.ID) objectMap["kind"] = DataConnectionKindIotHub populate(objectMap, "location", i.Location) @@ -1946,7 +2052,7 @@ func (i *IotHubDataConnection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "keyName", k.KeyName) populate(objectMap, "keyVaultUri", k.KeyVaultURI) populate(objectMap, "keyVersion", k.KeyVersion) @@ -1985,7 +2091,8 @@ func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LanguageExtension. func (l LanguageExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) + populate(objectMap, "languageExtensionImageName", l.LanguageExtensionImageName) populate(objectMap, "languageExtensionName", l.LanguageExtensionName) return json.Marshal(objectMap) } @@ -1999,6 +2106,9 @@ func (l *LanguageExtension) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "languageExtensionImageName": + err = unpopulate(val, "LanguageExtensionImageName", &l.LanguageExtensionImageName) + delete(rawMsg, key) case "languageExtensionName": err = unpopulate(val, "LanguageExtensionName", &l.LanguageExtensionName) delete(rawMsg, key) @@ -2012,7 +2122,7 @@ func (l *LanguageExtension) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LanguageExtensionsList. func (l LanguageExtensionsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } @@ -2039,7 +2149,7 @@ func (l *LanguageExtensionsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListResourceSKUsResult. func (l ListResourceSKUsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } @@ -2066,7 +2176,7 @@ func (l *ListResourceSKUsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedPrivateEndpoint. func (m ManagedPrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) @@ -2109,7 +2219,7 @@ func (m *ManagedPrivateEndpoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedPrivateEndpointListResult. func (m ManagedPrivateEndpointListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } @@ -2136,7 +2246,7 @@ func (m *ManagedPrivateEndpointListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedPrivateEndpointProperties. func (m ManagedPrivateEndpointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "groupId", m.GroupID) populate(objectMap, "privateLinkResourceId", m.PrivateLinkResourceID) populate(objectMap, "privateLinkResourceRegion", m.PrivateLinkResourceRegion) @@ -2179,7 +2289,7 @@ func (m *ManagedPrivateEndpointProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedPrivateEndpointsCheckNameRequest. func (m ManagedPrivateEndpointsCheckNameRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", m.Name) objectMap["type"] = "Microsoft.Kusto/clusters/managedPrivateEndpoints" return json.Marshal(objectMap) @@ -2210,7 +2320,7 @@ func (m *ManagedPrivateEndpointsCheckNameRequest) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "display", o.Display) populate(objectMap, "name", o.Name) populate(objectMap, "origin", o.Origin) @@ -2249,7 +2359,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -2288,7 +2398,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) @@ -2319,7 +2429,7 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationResult. func (o OperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "endTime", o.EndTime) populate(objectMap, "error", o.Error) populate(objectMap, "id", o.ID) @@ -2374,7 +2484,7 @@ func (o *OperationResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationResultErrorProperties. func (o OperationResultErrorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", o.Code) populate(objectMap, "message", o.Message) return json.Marshal(objectMap) @@ -2405,7 +2515,7 @@ func (o *OperationResultErrorProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationResultProperties. func (o OperationResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "operationKind", o.OperationKind) populate(objectMap, "operationState", o.OperationState) populate(objectMap, "provisioningState", o.ProvisioningState) @@ -2440,7 +2550,7 @@ func (o *OperationResultProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OptimizedAutoscale. func (o OptimizedAutoscale) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "isEnabled", o.IsEnabled) populate(objectMap, "maximum", o.Maximum) populate(objectMap, "minimum", o.Minimum) @@ -2479,7 +2589,7 @@ func (o *OptimizedAutoscale) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OutboundNetworkDependenciesEndpoint. func (o OutboundNetworkDependenciesEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", o.Etag) populate(objectMap, "id", o.ID) populate(objectMap, "name", o.Name) @@ -2522,7 +2632,7 @@ func (o *OutboundNetworkDependenciesEndpoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OutboundNetworkDependenciesEndpointListResult. func (o OutboundNetworkDependenciesEndpointListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) @@ -2553,7 +2663,7 @@ func (o *OutboundNetworkDependenciesEndpointListResult) UnmarshalJSON(data []byt // MarshalJSON implements the json.Marshaller interface for type OutboundNetworkDependenciesEndpointProperties. func (o OutboundNetworkDependenciesEndpointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "category", o.Category) populate(objectMap, "endpoints", o.Endpoints) populate(objectMap, "provisioningState", o.ProvisioningState) @@ -2588,7 +2698,7 @@ func (o *OutboundNetworkDependenciesEndpointProperties) UnmarshalJSON(data []byt // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) @@ -2631,7 +2741,7 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } @@ -2658,7 +2768,7 @@ func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "groupId", p.GroupID) populate(objectMap, "privateEndpoint", p.PrivateEndpoint) populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) @@ -2697,7 +2807,7 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperty. func (p PrivateEndpointProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) return json.Marshal(objectMap) } @@ -2724,7 +2834,7 @@ func (p *PrivateEndpointProperty) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) @@ -2767,7 +2877,7 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } @@ -2794,7 +2904,7 @@ func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "groupId", p.GroupID) populate(objectMap, "requiredMembers", p.RequiredMembers) populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) @@ -2829,7 +2939,7 @@ func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionStateProperty. func (p PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionsRequired", p.ActionsRequired) populate(objectMap, "description", p.Description) populate(objectMap, "status", p.Status) @@ -2864,7 +2974,7 @@ func (p *PrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []byte) e // MarshalJSON implements the json.Marshaller interface for type ReadOnlyFollowingDatabase. func (r ReadOnlyFollowingDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) objectMap["kind"] = KindReadOnlyFollowing populate(objectMap, "location", r.Location) @@ -2911,7 +3021,7 @@ func (r *ReadOnlyFollowingDatabase) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ReadOnlyFollowingDatabaseProperties. func (r ReadOnlyFollowingDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "attachedDatabaseConfigurationName", r.AttachedDatabaseConfigurationName) populate(objectMap, "databaseShareOrigin", r.DatabaseShareOrigin) populate(objectMap, "hotCachePeriod", r.HotCachePeriod) @@ -2974,7 +3084,7 @@ func (r *ReadOnlyFollowingDatabaseProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ReadWriteDatabase. func (r ReadWriteDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) objectMap["kind"] = KindReadWrite populate(objectMap, "location", r.Location) @@ -3021,7 +3131,7 @@ func (r *ReadWriteDatabase) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ReadWriteDatabaseProperties. func (r ReadWriteDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "hotCachePeriod", r.HotCachePeriod) populate(objectMap, "isFollowed", r.IsFollowed) populate(objectMap, "provisioningState", r.ProvisioningState) @@ -3062,9 +3172,71 @@ func (r *ReadWriteDatabaseProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ResourceSKUCapabilities. +func (r ResourceSKUCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", r.Name) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapabilities. +func (r *ResourceSKUCapabilities) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceSKUZoneDetails. +func (r ResourceSKUZoneDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capabilities", r.Capabilities) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUZoneDetails. +func (r *ResourceSKUZoneDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capabilities": + err = unpopulate(val, "Capabilities", &r.Capabilities) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SKUDescription. func (s SKUDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "locationInfo", s.LocationInfo) populate(objectMap, "locations", s.Locations) populate(objectMap, "name", s.Name) @@ -3111,7 +3283,7 @@ func (s *SKUDescription) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SKUDescriptionList. func (s SKUDescriptionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -3138,8 +3310,9 @@ func (s *SKUDescriptionList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SKULocationInfoItem. func (s SKULocationInfoItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "location", s.Location) + populate(objectMap, "zoneDetails", s.ZoneDetails) populate(objectMap, "zones", s.Zones) return json.Marshal(objectMap) } @@ -3156,6 +3329,9 @@ func (s *SKULocationInfoItem) UnmarshalJSON(data []byte) error { case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) + case "zoneDetails": + err = unpopulate(val, "ZoneDetails", &s.ZoneDetails) + delete(rawMsg, key) case "zones": err = unpopulate(val, "Zones", &s.Zones) delete(rawMsg, key) @@ -3169,7 +3345,7 @@ func (s *SKULocationInfoItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Script. func (s Script) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -3212,7 +3388,7 @@ func (s *Script) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScriptCheckNameRequest. func (s ScriptCheckNameRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", s.Name) objectMap["type"] = "Microsoft.Kusto/clusters/databases/scripts" return json.Marshal(objectMap) @@ -3243,7 +3419,7 @@ func (s *ScriptCheckNameRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScriptListResult. func (s ScriptListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -3270,7 +3446,7 @@ func (s *ScriptListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScriptProperties. func (s ScriptProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "continueOnErrors", s.ContinueOnErrors) populate(objectMap, "forceUpdateTag", s.ForceUpdateTag) populate(objectMap, "provisioningState", s.ProvisioningState) @@ -3317,7 +3493,7 @@ func (s *ScriptProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -3364,9 +3540,11 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TableLevelSharingProperties. func (t TableLevelSharingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "externalTablesToExclude", t.ExternalTablesToExclude) populate(objectMap, "externalTablesToInclude", t.ExternalTablesToInclude) + populate(objectMap, "functionsToExclude", t.FunctionsToExclude) + populate(objectMap, "functionsToInclude", t.FunctionsToInclude) populate(objectMap, "materializedViewsToExclude", t.MaterializedViewsToExclude) populate(objectMap, "materializedViewsToInclude", t.MaterializedViewsToInclude) populate(objectMap, "tablesToExclude", t.TablesToExclude) @@ -3389,6 +3567,12 @@ func (t *TableLevelSharingProperties) UnmarshalJSON(data []byte) error { case "externalTablesToInclude": err = unpopulate(val, "ExternalTablesToInclude", &t.ExternalTablesToInclude) delete(rawMsg, key) + case "functionsToExclude": + err = unpopulate(val, "FunctionsToExclude", &t.FunctionsToExclude) + delete(rawMsg, key) + case "functionsToInclude": + err = unpopulate(val, "FunctionsToInclude", &t.FunctionsToInclude) + delete(rawMsg, key) case "materializedViewsToExclude": err = unpopulate(val, "MaterializedViewsToExclude", &t.MaterializedViewsToExclude) delete(rawMsg, key) @@ -3411,7 +3595,7 @@ func (t *TableLevelSharingProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrustedExternalTenant. func (t TrustedExternalTenant) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", t.Value) return json.Marshal(objectMap) } @@ -3438,7 +3622,7 @@ func (t *TrustedExternalTenant) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VirtualNetworkConfiguration. func (v VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dataManagementPublicIpId", v.DataManagementPublicIPID) populate(objectMap, "enginePublicIpId", v.EnginePublicIPID) populate(objectMap, "subnetId", v.SubnetID) @@ -3471,7 +3655,7 @@ func (v *VirtualNetworkConfiguration) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -3481,7 +3665,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/kusto/armkusto/operations_client.go b/sdk/resourcemanager/kusto/armkusto/operations_client.go index 222dae3dfed2..0f7c1707e3d7 100644 --- a/sdk/resourcemanager/kusto/armkusto/operations_client.go +++ b/sdk/resourcemanager/kusto/armkusto/operations_client.go @@ -28,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -50,8 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists available operations for the Microsoft.Kusto provider. -// Generated from API version 2022-07-07 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-12-29 +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -88,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/operations_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/operations_client_example_test.go deleted file mode 100644 index 3802aa9a81be..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/operations_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoOperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/operationsresults_client.go b/sdk/resourcemanager/kusto/armkusto/operationsresults_client.go index 492bf6f19a0f..15ea15ce49f8 100644 --- a/sdk/resourcemanager/kusto/armkusto/operationsresults_client.go +++ b/sdk/resourcemanager/kusto/armkusto/operationsresults_client.go @@ -32,10 +32,10 @@ type OperationsResultsClient struct { } // NewOperationsResultsClient creates a new instance of OperationsResultsClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,10 +58,11 @@ func NewOperationsResultsClient(subscriptionID string, credential azcore.TokenCr // Get - Returns operation results. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// location - Azure location (region) name. -// operationID - The Guid of the operation ID -// options - OperationsResultsClientGetOptions contains the optional parameters for the OperationsResultsClient.Get method. +// +// Generated from API version 2022-12-29 +// - location - Azure location (region) name. +// - operationID - The Guid of the operation ID +// - options - OperationsResultsClientGetOptions contains the optional parameters for the OperationsResultsClient.Get method. func (client *OperationsResultsClient) Get(ctx context.Context, location string, operationID string, options *OperationsResultsClientGetOptions) (OperationsResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, location, operationID, options) if err != nil { @@ -97,7 +98,7 @@ func (client *OperationsResultsClient) getCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/operationsresults_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/operationsresults_client_example_test.go deleted file mode 100644 index a31dee940278..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/operationsresults_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoOperationResultsGet.json -func ExampleOperationsResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewOperationsResultsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "westus", "30972f1b-b61d-4fd8-bd34-3dcfa24670f3", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client.go b/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client.go index cd609d632f1d..c39526217f62 100644 --- a/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client.go +++ b/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client.go @@ -32,10 +32,10 @@ type OperationsResultsLocationClient struct { } // NewOperationsResultsLocationClient creates a new instance of OperationsResultsLocationClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsResultsLocationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsResultsLocationClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,11 +58,12 @@ func NewOperationsResultsLocationClient(subscriptionID string, credential azcore // Get - Returns operation results. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// location - Azure location (region) name. -// operationID - The Guid of the operation ID -// options - OperationsResultsLocationClientGetOptions contains the optional parameters for the OperationsResultsLocationClient.Get -// method. +// +// Generated from API version 2022-12-29 +// - location - Azure location (region) name. +// - operationID - The Guid of the operation ID +// - options - OperationsResultsLocationClientGetOptions contains the optional parameters for the OperationsResultsLocationClient.Get +// method. func (client *OperationsResultsLocationClient) Get(ctx context.Context, location string, operationID string, options *OperationsResultsLocationClientGetOptions) (OperationsResultsLocationClientGetResponse, error) { req, err := client.getCreateRequest(ctx, location, operationID, options) if err != nil { @@ -98,7 +99,7 @@ func (client *OperationsResultsLocationClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client_example_test.go deleted file mode 100644 index 64d4ddad84cd..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client_example_test.go +++ /dev/null @@ -1,34 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoOperationResultsOperationResultResponseTypeGet.json -func ExampleOperationsResultsLocationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewOperationsResultsLocationClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Get(ctx, "westus", "30972f1b-b61d-4fd8-bd34-3dcfa24670f3", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/polymorphic_helpers.go b/sdk/resourcemanager/kusto/armkusto/polymorphic_helpers.go index 5a3fcf0c6a37..feafa2f7f502 100644 --- a/sdk/resourcemanager/kusto/armkusto/polymorphic_helpers.go +++ b/sdk/resourcemanager/kusto/armkusto/polymorphic_helpers.go @@ -15,12 +15,14 @@ func unmarshalDataConnectionClassification(rawMsg json.RawMessage) (DataConnecti if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } var b DataConnectionClassification switch m["kind"] { + case string(DataConnectionKindCosmosDb): + b = &CosmosDbDataConnection{} case string(DataConnectionKindEventGrid): b = &EventGridDataConnection{} case string(DataConnectionKindEventHub): @@ -56,7 +58,7 @@ func unmarshalDatabaseClassification(rawMsg json.RawMessage) (DatabaseClassifica if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } diff --git a/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client.go b/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client.go index 10109982cf53..e676ac8e4ffc 100644 --- a/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client.go +++ b/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client.go @@ -32,10 +32,10 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, privateEndpointConnectionName, parameters, options) @@ -78,7 +79,8 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -118,7 +120,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,12 +128,13 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, privateEndpointConnectionName, options) @@ -146,7 +149,8 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, privateEndpointConnectionName, options) if err != nil { @@ -186,7 +190,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,12 +198,13 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, privateEndpointConnectionName, options) if err != nil { @@ -239,7 +244,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,11 +260,12 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res } // NewListPager - Returns the list of private endpoint connections. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager +// method. func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, clusterName string, options *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListResponse]{ More: func(page PrivateEndpointConnectionsClientListResponse) bool { @@ -302,7 +308,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client_example_test.go deleted file mode 100644 index 97bcb8757876..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoPrivateEndpointConnectionsList.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewPrivateEndpointConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("kustorptest", "kustoCluster", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoPrivateEndpointConnectionsGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewPrivateEndpointConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "kustorptest", "kustoCluster", "privateEndpointTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoPrivateEndpointConnectionsCreateOrUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewPrivateEndpointConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "kustorptest", "kustoclusterrptest4", "privateEndpointTest", armkusto.PrivateEndpointConnection{ - Properties: &armkusto.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armkusto.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoPrivateEndpointConnectionsDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewPrivateEndpointConnectionsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "privateEndpointTest", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client.go b/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client.go index ba57c8b90a98..b6cadd7c2656 100644 --- a/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client.go +++ b/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client.go @@ -32,10 +32,10 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets a private link resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get +// method. func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, privateLinkResourceName string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, privateLinkResourceName, options) if err != nil { @@ -103,7 +104,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,11 +120,12 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) } // NewListPager - Returns the list of private link resources. -// Generated from API version 2022-07-07 -// resourceGroupName - The name of the resource group containing the Kusto cluster. -// clusterName - The name of the Kusto cluster. -// options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List -// method. +// +// Generated from API version 2022-12-29 +// - resourceGroupName - The name of the resource group containing the Kusto cluster. +// - clusterName - The name of the Kusto cluster. +// - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListPager +// method. func (client *PrivateLinkResourcesClient) NewListPager(resourceGroupName string, clusterName string, options *PrivateLinkResourcesClientListOptions) *runtime.Pager[PrivateLinkResourcesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateLinkResourcesClientListResponse]{ More: func(page PrivateLinkResourcesClientListResponse) bool { @@ -166,7 +168,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client_example_test.go deleted file mode 100644 index 06de1ee9c92e..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoPrivateLinkResourcesList.json -func ExamplePrivateLinkResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewPrivateLinkResourcesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("kustorptest", "kustoCluster", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoPrivateLinkResourcesGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewPrivateLinkResourcesClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "kustorptest", "kustoCluster", "cluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/kusto/armkusto/response_types.go b/sdk/resourcemanager/kusto/armkusto/response_types.go index 94941215874a..58c8fbd8bd4e 100644 --- a/sdk/resourcemanager/kusto/armkusto/response_types.go +++ b/sdk/resourcemanager/kusto/armkusto/response_types.go @@ -14,12 +14,12 @@ type AttachedDatabaseConfigurationsClientCheckNameAvailabilityResponse struct { CheckNameResult } -// AttachedDatabaseConfigurationsClientCreateOrUpdateResponse contains the response from method AttachedDatabaseConfigurationsClient.CreateOrUpdate. +// AttachedDatabaseConfigurationsClientCreateOrUpdateResponse contains the response from method AttachedDatabaseConfigurationsClient.BeginCreateOrUpdate. type AttachedDatabaseConfigurationsClientCreateOrUpdateResponse struct { AttachedDatabaseConfiguration } -// AttachedDatabaseConfigurationsClientDeleteResponse contains the response from method AttachedDatabaseConfigurationsClient.Delete. +// AttachedDatabaseConfigurationsClientDeleteResponse contains the response from method AttachedDatabaseConfigurationsClient.BeginDelete. type AttachedDatabaseConfigurationsClientDeleteResponse struct { // placeholder for future response values } @@ -29,7 +29,7 @@ type AttachedDatabaseConfigurationsClientGetResponse struct { AttachedDatabaseConfiguration } -// AttachedDatabaseConfigurationsClientListByClusterResponse contains the response from method AttachedDatabaseConfigurationsClient.ListByCluster. +// AttachedDatabaseConfigurationsClientListByClusterResponse contains the response from method AttachedDatabaseConfigurationsClient.NewListByClusterPager. type AttachedDatabaseConfigurationsClientListByClusterResponse struct { AttachedDatabaseConfigurationListResult } @@ -39,12 +39,12 @@ type ClusterPrincipalAssignmentsClientCheckNameAvailabilityResponse struct { CheckNameResult } -// ClusterPrincipalAssignmentsClientCreateOrUpdateResponse contains the response from method ClusterPrincipalAssignmentsClient.CreateOrUpdate. +// ClusterPrincipalAssignmentsClientCreateOrUpdateResponse contains the response from method ClusterPrincipalAssignmentsClient.BeginCreateOrUpdate. type ClusterPrincipalAssignmentsClientCreateOrUpdateResponse struct { ClusterPrincipalAssignment } -// ClusterPrincipalAssignmentsClientDeleteResponse contains the response from method ClusterPrincipalAssignmentsClient.Delete. +// ClusterPrincipalAssignmentsClientDeleteResponse contains the response from method ClusterPrincipalAssignmentsClient.BeginDelete. type ClusterPrincipalAssignmentsClientDeleteResponse struct { // placeholder for future response values } @@ -54,12 +54,12 @@ type ClusterPrincipalAssignmentsClientGetResponse struct { ClusterPrincipalAssignment } -// ClusterPrincipalAssignmentsClientListResponse contains the response from method ClusterPrincipalAssignmentsClient.List. +// ClusterPrincipalAssignmentsClientListResponse contains the response from method ClusterPrincipalAssignmentsClient.NewListPager. type ClusterPrincipalAssignmentsClientListResponse struct { ClusterPrincipalAssignmentListResult } -// ClustersClientAddLanguageExtensionsResponse contains the response from method ClustersClient.AddLanguageExtensions. +// ClustersClientAddLanguageExtensionsResponse contains the response from method ClustersClient.BeginAddLanguageExtensions. type ClustersClientAddLanguageExtensionsResponse struct { // placeholder for future response values } @@ -69,22 +69,22 @@ type ClustersClientCheckNameAvailabilityResponse struct { CheckNameResult } -// ClustersClientCreateOrUpdateResponse contains the response from method ClustersClient.CreateOrUpdate. +// ClustersClientCreateOrUpdateResponse contains the response from method ClustersClient.BeginCreateOrUpdate. type ClustersClientCreateOrUpdateResponse struct { Cluster } -// ClustersClientDeleteResponse contains the response from method ClustersClient.Delete. +// ClustersClientDeleteResponse contains the response from method ClustersClient.BeginDelete. type ClustersClientDeleteResponse struct { // placeholder for future response values } -// ClustersClientDetachFollowerDatabasesResponse contains the response from method ClustersClient.DetachFollowerDatabases. +// ClustersClientDetachFollowerDatabasesResponse contains the response from method ClustersClient.BeginDetachFollowerDatabases. type ClustersClientDetachFollowerDatabasesResponse struct { // placeholder for future response values } -// ClustersClientDiagnoseVirtualNetworkResponse contains the response from method ClustersClient.DiagnoseVirtualNetwork. +// ClustersClientDiagnoseVirtualNetworkResponse contains the response from method ClustersClient.BeginDiagnoseVirtualNetwork. type ClustersClientDiagnoseVirtualNetworkResponse struct { DiagnoseVirtualNetworkResult } @@ -94,57 +94,57 @@ type ClustersClientGetResponse struct { Cluster } -// ClustersClientListByResourceGroupResponse contains the response from method ClustersClient.ListByResourceGroup. +// ClustersClientListByResourceGroupResponse contains the response from method ClustersClient.NewListByResourceGroupPager. type ClustersClientListByResourceGroupResponse struct { ClusterListResult } -// ClustersClientListFollowerDatabasesResponse contains the response from method ClustersClient.ListFollowerDatabases. +// ClustersClientListFollowerDatabasesResponse contains the response from method ClustersClient.NewListFollowerDatabasesPager. type ClustersClientListFollowerDatabasesResponse struct { FollowerDatabaseListResult } -// ClustersClientListLanguageExtensionsResponse contains the response from method ClustersClient.ListLanguageExtensions. +// ClustersClientListLanguageExtensionsResponse contains the response from method ClustersClient.NewListLanguageExtensionsPager. type ClustersClientListLanguageExtensionsResponse struct { LanguageExtensionsList } -// ClustersClientListOutboundNetworkDependenciesEndpointsResponse contains the response from method ClustersClient.ListOutboundNetworkDependenciesEndpoints. +// ClustersClientListOutboundNetworkDependenciesEndpointsResponse contains the response from method ClustersClient.NewListOutboundNetworkDependenciesEndpointsPager. type ClustersClientListOutboundNetworkDependenciesEndpointsResponse struct { OutboundNetworkDependenciesEndpointListResult } -// ClustersClientListResponse contains the response from method ClustersClient.List. +// ClustersClientListResponse contains the response from method ClustersClient.NewListPager. type ClustersClientListResponse struct { ClusterListResult } -// ClustersClientListSKUsByResourceResponse contains the response from method ClustersClient.ListSKUsByResource. +// ClustersClientListSKUsByResourceResponse contains the response from method ClustersClient.NewListSKUsByResourcePager. type ClustersClientListSKUsByResourceResponse struct { ListResourceSKUsResult } -// ClustersClientListSKUsResponse contains the response from method ClustersClient.ListSKUs. +// ClustersClientListSKUsResponse contains the response from method ClustersClient.NewListSKUsPager. type ClustersClientListSKUsResponse struct { SKUDescriptionList } -// ClustersClientRemoveLanguageExtensionsResponse contains the response from method ClustersClient.RemoveLanguageExtensions. +// ClustersClientRemoveLanguageExtensionsResponse contains the response from method ClustersClient.BeginRemoveLanguageExtensions. type ClustersClientRemoveLanguageExtensionsResponse struct { // placeholder for future response values } -// ClustersClientStartResponse contains the response from method ClustersClient.Start. +// ClustersClientStartResponse contains the response from method ClustersClient.BeginStart. type ClustersClientStartResponse struct { // placeholder for future response values } -// ClustersClientStopResponse contains the response from method ClustersClient.Stop. +// ClustersClientStopResponse contains the response from method ClustersClient.BeginStop. type ClustersClientStopResponse struct { // placeholder for future response values } -// ClustersClientUpdateResponse contains the response from method ClustersClient.Update. +// ClustersClientUpdateResponse contains the response from method ClustersClient.BeginUpdate. type ClustersClientUpdateResponse struct { Cluster } @@ -154,7 +154,7 @@ type DataConnectionsClientCheckNameAvailabilityResponse struct { CheckNameResult } -// DataConnectionsClientCreateOrUpdateResponse contains the response from method DataConnectionsClient.CreateOrUpdate. +// DataConnectionsClientCreateOrUpdateResponse contains the response from method DataConnectionsClient.BeginCreateOrUpdate. type DataConnectionsClientCreateOrUpdateResponse struct { DataConnectionClassification } @@ -169,12 +169,12 @@ func (d *DataConnectionsClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) return nil } -// DataConnectionsClientDataConnectionValidationResponse contains the response from method DataConnectionsClient.DataConnectionValidation. +// DataConnectionsClientDataConnectionValidationResponse contains the response from method DataConnectionsClient.BeginDataConnectionValidation. type DataConnectionsClientDataConnectionValidationResponse struct { DataConnectionValidationListResult } -// DataConnectionsClientDeleteResponse contains the response from method DataConnectionsClient.Delete. +// DataConnectionsClientDeleteResponse contains the response from method DataConnectionsClient.BeginDelete. type DataConnectionsClientDeleteResponse struct { // placeholder for future response values } @@ -194,12 +194,12 @@ func (d *DataConnectionsClientGetResponse) UnmarshalJSON(data []byte) error { return nil } -// DataConnectionsClientListByDatabaseResponse contains the response from method DataConnectionsClient.ListByDatabase. +// DataConnectionsClientListByDatabaseResponse contains the response from method DataConnectionsClient.NewListByDatabasePager. type DataConnectionsClientListByDatabaseResponse struct { DataConnectionListResult } -// DataConnectionsClientUpdateResponse contains the response from method DataConnectionsClient.Update. +// DataConnectionsClientUpdateResponse contains the response from method DataConnectionsClient.BeginUpdate. type DataConnectionsClientUpdateResponse struct { DataConnectionClassification } @@ -219,12 +219,12 @@ type DatabasePrincipalAssignmentsClientCheckNameAvailabilityResponse struct { CheckNameResult } -// DatabasePrincipalAssignmentsClientCreateOrUpdateResponse contains the response from method DatabasePrincipalAssignmentsClient.CreateOrUpdate. +// DatabasePrincipalAssignmentsClientCreateOrUpdateResponse contains the response from method DatabasePrincipalAssignmentsClient.BeginCreateOrUpdate. type DatabasePrincipalAssignmentsClientCreateOrUpdateResponse struct { DatabasePrincipalAssignment } -// DatabasePrincipalAssignmentsClientDeleteResponse contains the response from method DatabasePrincipalAssignmentsClient.Delete. +// DatabasePrincipalAssignmentsClientDeleteResponse contains the response from method DatabasePrincipalAssignmentsClient.BeginDelete. type DatabasePrincipalAssignmentsClientDeleteResponse struct { // placeholder for future response values } @@ -234,7 +234,7 @@ type DatabasePrincipalAssignmentsClientGetResponse struct { DatabasePrincipalAssignment } -// DatabasePrincipalAssignmentsClientListResponse contains the response from method DatabasePrincipalAssignmentsClient.List. +// DatabasePrincipalAssignmentsClientListResponse contains the response from method DatabasePrincipalAssignmentsClient.NewListPager. type DatabasePrincipalAssignmentsClientListResponse struct { DatabasePrincipalAssignmentListResult } @@ -249,7 +249,7 @@ type DatabasesClientCheckNameAvailabilityResponse struct { CheckNameResult } -// DatabasesClientCreateOrUpdateResponse contains the response from method DatabasesClient.CreateOrUpdate. +// DatabasesClientCreateOrUpdateResponse contains the response from method DatabasesClient.BeginCreateOrUpdate. type DatabasesClientCreateOrUpdateResponse struct { DatabaseClassification } @@ -264,7 +264,7 @@ func (d *DatabasesClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error return nil } -// DatabasesClientDeleteResponse contains the response from method DatabasesClient.Delete. +// DatabasesClientDeleteResponse contains the response from method DatabasesClient.BeginDelete. type DatabasesClientDeleteResponse struct { // placeholder for future response values } @@ -284,12 +284,12 @@ func (d *DatabasesClientGetResponse) UnmarshalJSON(data []byte) error { return nil } -// DatabasesClientListByClusterResponse contains the response from method DatabasesClient.ListByCluster. +// DatabasesClientListByClusterResponse contains the response from method DatabasesClient.NewListByClusterPager. type DatabasesClientListByClusterResponse struct { DatabaseListResult } -// DatabasesClientListPrincipalsResponse contains the response from method DatabasesClient.ListPrincipals. +// DatabasesClientListPrincipalsResponse contains the response from method DatabasesClient.NewListPrincipalsPager. type DatabasesClientListPrincipalsResponse struct { DatabasePrincipalListResult } @@ -299,7 +299,7 @@ type DatabasesClientRemovePrincipalsResponse struct { DatabasePrincipalListResult } -// DatabasesClientUpdateResponse contains the response from method DatabasesClient.Update. +// DatabasesClientUpdateResponse contains the response from method DatabasesClient.BeginUpdate. type DatabasesClientUpdateResponse struct { DatabaseClassification } @@ -319,12 +319,12 @@ type ManagedPrivateEndpointsClientCheckNameAvailabilityResponse struct { CheckNameResult } -// ManagedPrivateEndpointsClientCreateOrUpdateResponse contains the response from method ManagedPrivateEndpointsClient.CreateOrUpdate. +// ManagedPrivateEndpointsClientCreateOrUpdateResponse contains the response from method ManagedPrivateEndpointsClient.BeginCreateOrUpdate. type ManagedPrivateEndpointsClientCreateOrUpdateResponse struct { ManagedPrivateEndpoint } -// ManagedPrivateEndpointsClientDeleteResponse contains the response from method ManagedPrivateEndpointsClient.Delete. +// ManagedPrivateEndpointsClientDeleteResponse contains the response from method ManagedPrivateEndpointsClient.BeginDelete. type ManagedPrivateEndpointsClientDeleteResponse struct { // placeholder for future response values } @@ -334,17 +334,17 @@ type ManagedPrivateEndpointsClientGetResponse struct { ManagedPrivateEndpoint } -// ManagedPrivateEndpointsClientListResponse contains the response from method ManagedPrivateEndpointsClient.List. +// ManagedPrivateEndpointsClientListResponse contains the response from method ManagedPrivateEndpointsClient.NewListPager. type ManagedPrivateEndpointsClientListResponse struct { ManagedPrivateEndpointListResult } -// ManagedPrivateEndpointsClientUpdateResponse contains the response from method ManagedPrivateEndpointsClient.Update. +// ManagedPrivateEndpointsClientUpdateResponse contains the response from method ManagedPrivateEndpointsClient.BeginUpdate. type ManagedPrivateEndpointsClientUpdateResponse struct { ManagedPrivateEndpoint } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } @@ -359,12 +359,12 @@ type OperationsResultsLocationClientGetResponse struct { // placeholder for future response values } -// PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.CreateOrUpdate. +// PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate. type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { PrivateEndpointConnection } -// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete. +// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete. type PrivateEndpointConnectionsClientDeleteResponse struct { // placeholder for future response values } @@ -374,7 +374,7 @@ type PrivateEndpointConnectionsClientGetResponse struct { PrivateEndpointConnection } -// PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.List. +// PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.NewListPager. type PrivateEndpointConnectionsClientListResponse struct { PrivateEndpointConnectionListResult } @@ -384,22 +384,27 @@ type PrivateLinkResourcesClientGetResponse struct { PrivateLinkResource } -// PrivateLinkResourcesClientListResponse contains the response from method PrivateLinkResourcesClient.List. +// PrivateLinkResourcesClientListResponse contains the response from method PrivateLinkResourcesClient.NewListPager. type PrivateLinkResourcesClientListResponse struct { PrivateLinkResourceListResult } +// SKUsClientListResponse contains the response from method SKUsClient.NewListPager. +type SKUsClientListResponse struct { + SKUDescriptionList +} + // ScriptsClientCheckNameAvailabilityResponse contains the response from method ScriptsClient.CheckNameAvailability. type ScriptsClientCheckNameAvailabilityResponse struct { CheckNameResult } -// ScriptsClientCreateOrUpdateResponse contains the response from method ScriptsClient.CreateOrUpdate. +// ScriptsClientCreateOrUpdateResponse contains the response from method ScriptsClient.BeginCreateOrUpdate. type ScriptsClientCreateOrUpdateResponse struct { Script } -// ScriptsClientDeleteResponse contains the response from method ScriptsClient.Delete. +// ScriptsClientDeleteResponse contains the response from method ScriptsClient.BeginDelete. type ScriptsClientDeleteResponse struct { // placeholder for future response values } @@ -409,12 +414,12 @@ type ScriptsClientGetResponse struct { Script } -// ScriptsClientListByDatabaseResponse contains the response from method ScriptsClient.ListByDatabase. +// ScriptsClientListByDatabaseResponse contains the response from method ScriptsClient.NewListByDatabasePager. type ScriptsClientListByDatabaseResponse struct { ScriptListResult } -// ScriptsClientUpdateResponse contains the response from method ScriptsClient.Update. +// ScriptsClientUpdateResponse contains the response from method ScriptsClient.BeginUpdate. type ScriptsClientUpdateResponse struct { Script } diff --git a/sdk/resourcemanager/kusto/armkusto/scripts_client.go b/sdk/resourcemanager/kusto/armkusto/scripts_client.go index f303d5e50b86..06c1059931cc 100644 --- a/sdk/resourcemanager/kusto/armkusto/scripts_client.go +++ b/sdk/resourcemanager/kusto/armkusto/scripts_client.go @@ -32,10 +32,10 @@ type ScriptsClient struct { } // NewScriptsClient creates a new instance of ScriptsClient with the specified values. -// subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewScriptsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScriptsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewScriptsClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Checks that the script name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ScriptsClientCheckNameAvailabilityOptions contains the optional parameters for the ScriptsClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ScriptsClientCheckNameAvailabilityOptions contains the optional parameters for the ScriptsClient.CheckNameAvailability +// method. func (client *ScriptsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName ScriptCheckNameRequest, options *ScriptsClientCheckNameAvailabilityOptions) (ScriptsClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, clusterName, databaseName, scriptName, options) if err != nil { @@ -104,7 +105,7 @@ func (client *ScriptsClient) checkNameAvailabilityCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, scriptName) @@ -121,14 +122,15 @@ func (client *ScriptsClient) checkNameAvailabilityHandleResponse(resp *http.Resp // BeginCreateOrUpdate - Creates a Kusto database script. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ScriptsClientBeginCreateOrUpdateOptions contains the optional parameters for the ScriptsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ScriptsClientBeginCreateOrUpdateOptions contains the optional parameters for the ScriptsClient.BeginCreateOrUpdate +// method. func (client *ScriptsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, parameters Script, options *ScriptsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ScriptsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, clusterName, databaseName, scriptName, parameters, options) @@ -143,7 +145,8 @@ func (client *ScriptsClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Creates a Kusto database script. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ScriptsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, parameters Script, options *ScriptsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, databaseName, scriptName, parameters, options) if err != nil { @@ -187,7 +190,7 @@ func (client *ScriptsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -195,12 +198,13 @@ func (client *ScriptsClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Deletes a Kusto principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ScriptsClientBeginDeleteOptions contains the optional parameters for the ScriptsClient.BeginDelete method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ScriptsClientBeginDeleteOptions contains the optional parameters for the ScriptsClient.BeginDelete method. func (client *ScriptsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, options *ScriptsClientBeginDeleteOptions) (*runtime.Poller[ScriptsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, clusterName, databaseName, scriptName, options) @@ -215,7 +219,8 @@ func (client *ScriptsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a Kusto principalAssignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ScriptsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, options *ScriptsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, databaseName, scriptName, options) if err != nil { @@ -259,7 +264,7 @@ func (client *ScriptsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,12 +272,13 @@ func (client *ScriptsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets a Kusto cluster database script. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ScriptsClientGetOptions contains the optional parameters for the ScriptsClient.Get method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ScriptsClientGetOptions contains the optional parameters for the ScriptsClient.Get method. func (client *ScriptsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, options *ScriptsClientGetOptions) (ScriptsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, databaseName, scriptName, options) if err != nil { @@ -316,7 +322,7 @@ func (client *ScriptsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,11 +338,13 @@ func (client *ScriptsClient) getHandleResponse(resp *http.Response) (ScriptsClie } // NewListByDatabasePager - Returns the list of database scripts for given database. -// Generated from API version 2022-07-07 -// 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. -// options - ScriptsClientListByDatabaseOptions contains the optional parameters for the ScriptsClient.ListByDatabase method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ScriptsClientListByDatabaseOptions contains the optional parameters for the ScriptsClient.NewListByDatabasePager +// method. func (client *ScriptsClient) NewListByDatabasePager(resourceGroupName string, clusterName string, databaseName string, options *ScriptsClientListByDatabaseOptions) *runtime.Pager[ScriptsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ScriptsClientListByDatabaseResponse]{ More: func(page ScriptsClientListByDatabaseResponse) bool { @@ -383,7 +391,7 @@ func (client *ScriptsClient) listByDatabaseCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -400,13 +408,14 @@ func (client *ScriptsClient) listByDatabaseHandleResponse(resp *http.Response) ( // BeginUpdate - Updates a database script. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 -// 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. -// options - ScriptsClientBeginUpdateOptions contains the optional parameters for the ScriptsClient.BeginUpdate method. +// +// Generated from API version 2022-12-29 +// - 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. +// - options - ScriptsClientBeginUpdateOptions contains the optional parameters for the ScriptsClient.BeginUpdate method. func (client *ScriptsClient) BeginUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, parameters Script, options *ScriptsClientBeginUpdateOptions) (*runtime.Poller[ScriptsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, clusterName, databaseName, scriptName, parameters, options) @@ -421,7 +430,8 @@ func (client *ScriptsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Updates a database script. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-07 +// +// Generated from API version 2022-12-29 func (client *ScriptsClient) update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, scriptName string, parameters Script, options *ScriptsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, databaseName, scriptName, parameters, options) if err != nil { @@ -465,7 +475,7 @@ func (client *ScriptsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-07") + reqQP.Set("api-version", "2022-12-29") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/kusto/armkusto/scripts_client_example_test.go b/sdk/resourcemanager/kusto/armkusto/scripts_client_example_test.go deleted file mode 100644 index 4139234e0846..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/scripts_client_example_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armkusto_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoScriptsListByDatabase.json -func ExampleScriptsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewScriptsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("kustorptest", "kustoCluster", "Kustodatabase8", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoScriptsGet.json -func ExampleScriptsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewScriptsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", "kustoScript", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoScriptsCreateOrUpdate.json -func ExampleScriptsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewScriptsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "kustoScript", armkusto.Script{ - Properties: &armkusto.ScriptProperties{ - ContinueOnErrors: to.Ptr(true), - ForceUpdateTag: to.Ptr("2bcf3c21-ffd1-4444-b9dd-e52e00ee53fe"), - ScriptURL: to.Ptr("https://mysa.blob.core.windows.net/container/script.txt"), - ScriptURLSasToken: to.Ptr("?sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=********************************"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoScriptsUpdate.json -func ExampleScriptsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewScriptsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "kustoScript", armkusto.Script{ - Properties: &armkusto.ScriptProperties{ - ContinueOnErrors: to.Ptr(true), - ForceUpdateTag: to.Ptr("2bcf3c21-ffd1-4444-b9dd-e52e00ee53fe"), - ScriptURL: to.Ptr("https://mysa.blob.core.windows.net/container/script.txt"), - ScriptURLSasToken: to.Ptr("?sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=********************************"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoScriptsDelete.json -func ExampleScriptsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewScriptsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "kustoScript", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-07-07/examples/KustoScriptsCheckNameAvailability.json -func ExampleScriptsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armkusto.NewScriptsClient("12345678-1234-1234-1234-123456789098", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, "kustorptest", "kustoCluster", "db", armkusto.ScriptCheckNameRequest{ - Name: to.Ptr("kustoScriptName1"), - Type: to.Ptr("Microsoft.Kusto/clusters/databases/scripts"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/kusto/armkusto/skus_client.go b/sdk/resourcemanager/kusto/armkusto/skus_client.go new file mode 100644 index 000000000000..1e22eda934c1 --- /dev/null +++ b/sdk/resourcemanager/kusto/armkusto/skus_client.go @@ -0,0 +1,115 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armkusto + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// SKUsClient contains the methods for the SKUs group. +// Don't use this type directly, use NewSKUsClient() instead. +type SKUsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewSKUsClient creates a new instance of SKUsClient with the specified values. +// - subscriptionID - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID +// forms part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SKUsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &SKUsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Lists eligible region SKUs for Kusto resource provider by Azure region. +// +// Generated from API version 2022-12-29 +// - location - Azure location (region) name. +// - options - SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. +func (client *SKUsClient) NewListPager(location string, options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{ + More: func(page SKUsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *SKUsClientListResponse) (SKUsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, location, options) + if err != nil { + return SKUsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SKUsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SKUsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SKUsClient) listCreateRequest(ctx context.Context, location string, options *SKUsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/skus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-12-29") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SKUsClient) listHandleResponse(resp *http.Response) (SKUsClientListResponse, error) { + result := SKUsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SKUDescriptionList); err != nil { + return SKUsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/kusto/armkusto/time_rfc3339.go b/sdk/resourcemanager/kusto/armkusto/time_rfc3339.go index 7c93879d0f3d..ad076a47550d 100644 --- a/sdk/resourcemanager/kusto/armkusto/time_rfc3339.go +++ b/sdk/resourcemanager/kusto/armkusto/time_rfc3339.go @@ -62,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) {