diff --git a/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md b/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md index 446ec05db61a..0d6586f5ac9d 100644 --- a/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md +++ b/sdk/resourcemanager/kusto/armkusto/CHANGELOG.md @@ -1,9 +1,52 @@ # Release History +## 1.1.0 (2022-09-15) +### Features Added + +- New const `AzureSKUNameStandardEC8AsV51TBPS` +- New const `AzureSKUNameStandardEC8AdsV5` +- New const `AzureSKUNameStandardL8AsV3` +- New const `AzureSKUNameStandardL8SV3` +- New const `AzureSKUNameStandardE8DV5` +- New const `AzureSKUNameStandardE16DV4` +- New const `AzureSKUNameStandardL16AsV3` +- New const `AzureSKUNameStandardEC16AsV54TBPS` +- New const `AzureSKUNameStandardEC16AsV53TBPS` +- New const `AzureSKUNameStandardE8DV4` +- New const `DatabaseShareOriginDirect` +- New const `AzureSKUNameStandardE2DV4` +- New const `AzureSKUNameStandardE2DV5` +- New const `AzureSKUNameStandardL16SV3` +- New const `DatabaseShareOriginDataShare` +- New const `AzureSKUNameStandardE16DV5` +- New const `CallerRoleAdmin` +- New const `DatabaseShareOriginOther` +- New const `AzureSKUNameStandardEC8AsV52TBPS` +- New const `AzureSKUNameStandardE4DV4` +- New const `AzureSKUNameStandardEC16AdsV5` +- New const `CallerRoleNone` +- New const `AzureSKUNameStandardE4DV5` +- New type alias `CallerRole` +- New type alias `DatabaseShareOrigin` +- New function `PossibleDatabaseShareOriginValues() []DatabaseShareOrigin` +- New function `PossibleCallerRoleValues() []CallerRole` +- New field `CallerRole` in struct `DatabasesClientBeginCreateOrUpdateOptions` +- New field `DatabaseShareOrigin` in struct `FollowerDatabaseDefinition` +- New field `TableLevelSharingProperties` in struct `FollowerDatabaseDefinition` +- New field `DatabaseNameOverride` in struct `AttachedDatabaseConfigurationProperties` +- New field `DatabaseNamePrefix` in struct `AttachedDatabaseConfigurationProperties` +- New field `OriginalDatabaseName` in struct `ReadOnlyFollowingDatabaseProperties` +- New field `TableLevelSharingProperties` in struct `ReadOnlyFollowingDatabaseProperties` +- New field `DatabaseShareOrigin` in struct `ReadOnlyFollowingDatabaseProperties` +- New field `RetrievalStartDate` in struct `IotHubConnectionProperties` +- New field `RetrievalStartDate` in struct `EventHubConnectionProperties` +- New field `CallerRole` in struct `DatabasesClientBeginUpdateOptions` + + ## 1.0.0 (2022-05-17) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/kusto/armkusto` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). \ No newline at end of file +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_attacheddatabaseconfigurations_client.go b/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client.go similarity index 97% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_attacheddatabaseconfigurations_client.go rename to sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client.go index 093240918da7..cd1507803254 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_attacheddatabaseconfigurations_client.go +++ b/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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. @@ -98,7 +99,7 @@ func (client *AttachedDatabaseConfigurationsClient) checkNameAvailabilityCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resourceName) @@ -115,7 +116,7 @@ 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-02-01 +// 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. @@ -136,7 +137,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -176,7 +177,7 @@ func (client *AttachedDatabaseConfigurationsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -184,7 +185,7 @@ 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-02-01 +// 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. @@ -204,7 +205,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -244,7 +245,7 @@ func (client *AttachedDatabaseConfigurationsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +253,7 @@ 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-02-01 +// 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. @@ -297,7 +298,7 @@ func (client *AttachedDatabaseConfigurationsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,8 +314,7 @@ func (client *AttachedDatabaseConfigurationsClient) getHandleResponse(resp *http } // NewListByClusterPager - Returns the list of attached database configurations of the given Kusto cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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 @@ -361,7 +361,7 @@ func (client *AttachedDatabaseConfigurationsClient) listByClusterCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_attacheddatabaseconfigurations_client_test.go b/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client_example_test.go similarity index 68% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_attacheddatabaseconfigurations_client_test.go rename to sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client_example_test.go index 57600abc00f0..669f9f7bff79 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_attacheddatabaseconfigurations_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/attacheddatabaseconfigurations_client_example_test.go @@ -17,7 +17,7 @@ import ( "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-02-01/examples/KustoAttachedDatabaseConfigurationCheckNameAvailability.json +// 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 { @@ -28,14 +28,10 @@ func ExampleAttachedDatabaseConfigurationsClient_CheckNameAvailability() { 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) + 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) } @@ -43,7 +39,7 @@ func ExampleAttachedDatabaseConfigurationsClient_CheckNameAvailability() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoAttachedDatabaseConfigurationsListByCluster.json +// 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 { @@ -54,9 +50,7 @@ func ExampleAttachedDatabaseConfigurationsClient_NewListByClusterPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByClusterPager("kustorptest", - "kustoCluster2", - nil) + pager := client.NewListByClusterPager("kustorptest", "kustoCluster2", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -69,7 +63,7 @@ func ExampleAttachedDatabaseConfigurationsClient_NewListByClusterPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoAttachedDatabaseConfigurationsGet.json +// 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 { @@ -80,11 +74,7 @@ func ExampleAttachedDatabaseConfigurationsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "kustorptest", - "kustoCluster2", - "attachedDatabaseConfigurationsTest", - nil) + res, err := client.Get(ctx, "kustorptest", "kustoCluster2", "attachedDatabaseConfigurationsTest", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -92,7 +82,7 @@ func ExampleAttachedDatabaseConfigurationsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoAttachedDatabaseConfigurationsCreateOrUpdate.json +// 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 { @@ -103,33 +93,29 @@ func ExampleAttachedDatabaseConfigurationsClient_BeginCreateOrUpdate() { 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"), - 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")}, - }, + 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) + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -141,7 +127,7 @@ func ExampleAttachedDatabaseConfigurationsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoAttachedDatabaseConfigurationsDelete.json +// 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 { @@ -152,11 +138,7 @@ func ExampleAttachedDatabaseConfigurationsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, - "kustorptest", - "kustoCluster", - "attachedDatabaseConfigurationsTest", - nil) + poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "attachedDatabaseConfigurationsTest", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/kusto/armkusto/autorest.md b/sdk/resourcemanager/kusto/armkusto/autorest.md index 6eee797f12cd..58e093ec42f1 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azure-kusto/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/azure-kusto/resource-manager/readme.go.md +- 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 license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -``` \ No newline at end of file +module-version: 1.1.0 +``` diff --git a/sdk/resourcemanager/kusto/armkusto/build.go b/sdk/resourcemanager/kusto/armkusto/build.go index 2591582b8479..f854893b621d 100644 --- a/sdk/resourcemanager/kusto/armkusto/build.go +++ b/sdk/resourcemanager/kusto/armkusto/build.go @@ -2,6 +2,6 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/kusto/armkusto +//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate -removeUnreferencedTypes resourcemanager/kusto/armkusto package armkusto diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_clusterprincipalassignments_client.go b/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client.go similarity index 97% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_clusterprincipalassignments_client.go rename to sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client.go index 429128af58fc..00ad4729bf3f 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_clusterprincipalassignments_client.go +++ b/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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. @@ -98,7 +99,7 @@ func (client *ClusterPrincipalAssignmentsClient) checkNameAvailabilityCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, principalAssignmentName) @@ -115,7 +116,7 @@ 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-02-01 +// 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. @@ -136,7 +137,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -176,7 +177,7 @@ func (client *ClusterPrincipalAssignmentsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -184,7 +185,7 @@ 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-02-01 +// 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. @@ -204,7 +205,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -244,7 +245,7 @@ func (client *ClusterPrincipalAssignmentsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +253,7 @@ 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-02-01 +// 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. @@ -297,7 +298,7 @@ func (client *ClusterPrincipalAssignmentsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,8 +314,7 @@ func (client *ClusterPrincipalAssignmentsClient) getHandleResponse(resp *http.Re } // NewListPager - Lists all Kusto cluster principalAssignments. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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 @@ -361,7 +361,7 @@ func (client *ClusterPrincipalAssignmentsClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_clusterprincipalassignments_client_test.go b/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client_example_test.go similarity index 76% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_clusterprincipalassignments_client_test.go rename to sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client_example_test.go index 03d8f46450da..ab792e3e0cce 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_clusterprincipalassignments_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/clusterprincipalassignments_client_example_test.go @@ -17,7 +17,7 @@ import ( "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-02-01/examples/KustoClusterPrincipalAssignmentsCheckNameAvailability.json +// 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 { @@ -28,14 +28,10 @@ func ExampleClusterPrincipalAssignmentsClient_CheckNameAvailability() { 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) + 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) } @@ -43,7 +39,7 @@ func ExampleClusterPrincipalAssignmentsClient_CheckNameAvailability() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClusterPrincipalAssignmentsGet.json +// 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 { @@ -54,11 +50,7 @@ func ExampleClusterPrincipalAssignmentsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "kustorptest", - "kustoCluster", - "kustoprincipal1", - nil) + res, err := client.Get(ctx, "kustorptest", "kustoCluster", "kustoprincipal1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -66,7 +58,7 @@ func ExampleClusterPrincipalAssignmentsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClusterPrincipalAssignmentsCreateOrUpdate.json +// 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 { @@ -77,19 +69,14 @@ func ExampleClusterPrincipalAssignmentsClient_BeginCreateOrUpdate() { 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"), - }, + 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) + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -101,7 +88,7 @@ func ExampleClusterPrincipalAssignmentsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClusterPrincipalAssignmentsDelete.json +// 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 { @@ -112,11 +99,7 @@ func ExampleClusterPrincipalAssignmentsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, - "kustorptest", - "kustoCluster", - "kustoprincipal1", - nil) + poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "kustoprincipal1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -126,7 +109,7 @@ func ExampleClusterPrincipalAssignmentsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClusterPrincipalAssignmentsList.json +// 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 { @@ -137,9 +120,7 @@ func ExampleClusterPrincipalAssignmentsClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("kustorptest", - "kustoCluster", - nil) + pager := client.NewListPager("kustorptest", "kustoCluster", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_clusters_client.go b/sdk/resourcemanager/kusto/armkusto/clusters_client.go similarity index 96% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_clusters_client.go rename to sdk/resourcemanager/kusto/armkusto/clusters_client.go index cd4bc9e38ca1..e3ee7c907aad 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_clusters_client.go +++ b/sdk/resourcemanager/kusto/armkusto/clusters_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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. @@ -77,7 +78,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -113,7 +114,7 @@ func (client *ClustersClient) addLanguageExtensionsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, languageExtensionsToAdd) @@ -121,7 +122,7 @@ 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-02-01 +// 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 @@ -157,7 +158,7 @@ func (client *ClustersClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, clusterName) @@ -174,7 +175,7 @@ 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-02-01 +// 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. @@ -194,7 +195,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -230,7 +231,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -244,7 +245,7 @@ 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-02-01 +// 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. @@ -262,7 +263,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -298,7 +299,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,7 +307,7 @@ 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-02-01 +// 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. @@ -326,7 +327,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -362,7 +363,7 @@ func (client *ClustersClient) detachFollowerDatabasesCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, followerDatabaseToRemove) @@ -371,7 +372,7 @@ 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-02-01 +// 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 @@ -393,7 +394,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -429,7 +430,7 @@ func (client *ClustersClient) diagnoseVirtualNetworkCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -437,7 +438,7 @@ 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-02-01 +// 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. @@ -476,7 +477,7 @@ func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -492,8 +493,7 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl } // NewListPager - Lists all Kusto clusters within a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-07-07 // options - ClustersClientListOptions contains the optional parameters for the ClustersClient.List method. func (client *ClustersClient) NewListPager(options *ClustersClientListOptions) *runtime.Pager[ClustersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ClustersClientListResponse]{ @@ -529,7 +529,7 @@ func (client *ClustersClient) listCreateRequest(ctx context.Context, options *Cl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -545,8 +545,7 @@ func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersC } // NewListByResourceGroupPager - Lists all Kusto clusters within a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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. @@ -588,7 +587,7 @@ func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -605,8 +604,7 @@ 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. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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 @@ -653,7 +651,7 @@ func (client *ClustersClient) listFollowerDatabasesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -669,8 +667,7 @@ func (client *ClustersClient) listFollowerDatabasesHandleResponse(resp *http.Res } // NewListLanguageExtensionsPager - Returns 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-02-01 +// 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 @@ -717,7 +714,7 @@ func (client *ClustersClient) listLanguageExtensionsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -733,8 +730,7 @@ func (client *ClustersClient) listLanguageExtensionsHandleResponse(resp *http.Re } // NewListOutboundNetworkDependenciesEndpointsPager - Gets the network endpoints of all outbound dependencies of a Kusto cluster -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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 @@ -787,7 +783,7 @@ func (client *ClustersClient) listOutboundNetworkDependenciesEndpointsCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -803,8 +799,7 @@ func (client *ClustersClient) listOutboundNetworkDependenciesEndpointsHandleResp } // NewListSKUsPager - Lists eligible SKUs for Kusto resource provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-07-07 // options - ClustersClientListSKUsOptions contains the optional parameters for the ClustersClient.ListSKUs method. func (client *ClustersClient) NewListSKUsPager(options *ClustersClientListSKUsOptions) *runtime.Pager[ClustersClientListSKUsResponse] { return runtime.NewPager(runtime.PagingHandler[ClustersClientListSKUsResponse]{ @@ -840,7 +835,7 @@ func (client *ClustersClient) listSKUsCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -856,8 +851,7 @@ func (client *ClustersClient) listSKUsHandleResponse(resp *http.Response) (Clust } // NewListSKUsByResourcePager - Returns the SKUs available for the provided resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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 @@ -904,7 +898,7 @@ func (client *ClustersClient) listSKUsByResourceCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -921,7 +915,7 @@ 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-02-01 +// 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. @@ -941,7 +935,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -977,7 +971,7 @@ func (client *ClustersClient) removeLanguageExtensionsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, languageExtensionsToRemove) @@ -985,7 +979,7 @@ 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-02-01 +// 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. @@ -1003,7 +997,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -1039,7 +1033,7 @@ func (client *ClustersClient) startCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1047,7 +1041,7 @@ 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-02-01 +// 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. @@ -1065,7 +1059,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -1101,7 +1095,7 @@ func (client *ClustersClient) stopCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1109,7 +1103,7 @@ 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-02-01 +// 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. @@ -1128,7 +1122,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -1164,7 +1158,7 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") 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/ze_generated_example_clusters_client_test.go b/sdk/resourcemanager/kusto/armkusto/clusters_client_example_test.go similarity index 68% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_clusters_client_test.go rename to sdk/resourcemanager/kusto/armkusto/clusters_client_example_test.go index e25cbd946e47..b93747636454 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_clusters_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/clusters_client_example_test.go @@ -17,7 +17,7 @@ import ( "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-02-01/examples/KustoClustersGet.json +// 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 { @@ -28,10 +28,7 @@ func ExampleClustersClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "kustorptest", - "kustoCluster", - nil) + res, err := client.Get(ctx, "kustorptest", "kustoCluster", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -39,7 +36,7 @@ func ExampleClustersClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClustersCreateOrUpdate.json +// 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 { @@ -50,33 +47,29 @@ func ExampleClustersClient_BeginCreateOrUpdate() { 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), - }, + 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), }, - &armkusto.ClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) + 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) } @@ -88,7 +81,7 @@ func ExampleClustersClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClustersUpdate.json +// 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 { @@ -99,13 +92,9 @@ func ExampleClustersClient_BeginUpdate() { 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("*")}) + 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) } @@ -117,7 +106,7 @@ func ExampleClustersClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClustersDelete.json +// 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 { @@ -128,10 +117,7 @@ func ExampleClustersClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, - "kustorptest", - "kustoCluster2", - nil) + poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster2", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -141,7 +127,7 @@ func ExampleClustersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClustersStop.json +// 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 { @@ -152,10 +138,7 @@ func ExampleClustersClient_BeginStop() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginStop(ctx, - "kustorptest", - "kustoCluster2", - nil) + poller, err := client.BeginStop(ctx, "kustorptest", "kustoCluster2", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -165,7 +148,7 @@ func ExampleClustersClient_BeginStop() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClustersStart.json +// 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 { @@ -176,10 +159,7 @@ func ExampleClustersClient_BeginStart() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginStart(ctx, - "kustorptest", - "kustoCluster2", - nil) + poller, err := client.BeginStart(ctx, "kustorptest", "kustoCluster2", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -189,7 +169,7 @@ func ExampleClustersClient_BeginStart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClusterListFollowerDatabases.json +// 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 { @@ -200,9 +180,7 @@ func ExampleClustersClient_NewListFollowerDatabasesPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListFollowerDatabasesPager("kustorptest", - "kustoCluster", - nil) + pager := client.NewListFollowerDatabasesPager("kustorptest", "kustoCluster", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -215,7 +193,7 @@ func ExampleClustersClient_NewListFollowerDatabasesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClusterDetachFollowerDatabases.json +// 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 { @@ -226,14 +204,10 @@ func ExampleClustersClient_BeginDetachFollowerDatabases() { 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) + 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) } @@ -243,7 +217,7 @@ func ExampleClustersClient_BeginDetachFollowerDatabases() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClustersDiagnoseVirtualNetwork.json +// 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 { @@ -254,10 +228,7 @@ func ExampleClustersClient_BeginDiagnoseVirtualNetwork() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDiagnoseVirtualNetwork(ctx, - "kustorptest", - "kustoCluster", - nil) + poller, err := client.BeginDiagnoseVirtualNetwork(ctx, "kustorptest", "kustoCluster", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -269,7 +240,7 @@ func ExampleClustersClient_BeginDiagnoseVirtualNetwork() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClustersListByResourceGroup.json +// 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 { @@ -280,8 +251,7 @@ func ExampleClustersClient_NewListByResourceGroupPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByResourceGroupPager("kustorptest", - nil) + pager := client.NewListByResourceGroupPager("kustorptest", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -294,7 +264,7 @@ func ExampleClustersClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClustersList.json +// 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 { @@ -318,7 +288,31 @@ func ExampleClustersClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClustersCheckNameAvailability.json +// 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 { @@ -329,13 +323,10 @@ func ExampleClustersClient_CheckNameAvailability() { 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) + 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) } @@ -343,7 +334,31 @@ func ExampleClustersClient_CheckNameAvailability() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoOutboundNetworkDependenciesList.json +// 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 { @@ -354,9 +369,7 @@ func ExampleClustersClient_NewListOutboundNetworkDependenciesEndpointsPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListOutboundNetworkDependenciesEndpointsPager("kustorptest", - "kustoCluster", - nil) + pager := client.NewListOutboundNetworkDependenciesEndpointsPager("kustorptest", "kustoCluster", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -369,7 +382,7 @@ func ExampleClustersClient_NewListOutboundNetworkDependenciesEndpointsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClusterListLanguageExtensions.json +// 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 { @@ -380,9 +393,7 @@ func ExampleClustersClient_NewListLanguageExtensionsPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListLanguageExtensionsPager("kustorptest", - "kustoCluster", - nil) + pager := client.NewListLanguageExtensionsPager("kustorptest", "kustoCluster", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -395,7 +406,7 @@ func ExampleClustersClient_NewListLanguageExtensionsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClusterAddLanguageExtensions.json +// 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 { @@ -406,19 +417,15 @@ func ExampleClustersClient_BeginAddLanguageExtensions() { 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) + 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) } @@ -428,7 +435,7 @@ func ExampleClustersClient_BeginAddLanguageExtensions() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoClusterRemoveLanguageExtensions.json +// 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 { @@ -439,19 +446,15 @@ func ExampleClustersClient_BeginRemoveLanguageExtensions() { 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) + 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) } diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_constants.go b/sdk/resourcemanager/kusto/armkusto/constants.go similarity index 89% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_constants.go rename to sdk/resourcemanager/kusto/armkusto/constants.go index 17a471b9b5da..7cce5ba10834 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_constants.go +++ b/sdk/resourcemanager/kusto/armkusto/constants.go @@ -5,12 +5,13 @@ // 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 const ( moduleName = "armkusto" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0" ) // AzureSKUName - SKU name. @@ -36,14 +37,20 @@ const ( AzureSKUNameStandardE16AsV44TBPS AzureSKUName = "Standard_E16as_v4+4TB_PS" AzureSKUNameStandardE16AsV53TBPS AzureSKUName = "Standard_E16as_v5+3TB_PS" AzureSKUNameStandardE16AsV54TBPS AzureSKUName = "Standard_E16as_v5+4TB_PS" + AzureSKUNameStandardE16DV4 AzureSKUName = "Standard_E16d_v4" + AzureSKUNameStandardE16DV5 AzureSKUName = "Standard_E16d_v5" AzureSKUNameStandardE16SV43TBPS AzureSKUName = "Standard_E16s_v4+3TB_PS" AzureSKUNameStandardE16SV44TBPS AzureSKUName = "Standard_E16s_v4+4TB_PS" AzureSKUNameStandardE16SV53TBPS AzureSKUName = "Standard_E16s_v5+3TB_PS" AzureSKUNameStandardE16SV54TBPS AzureSKUName = "Standard_E16s_v5+4TB_PS" AzureSKUNameStandardE2AV4 AzureSKUName = "Standard_E2a_v4" AzureSKUNameStandardE2AdsV5 AzureSKUName = "Standard_E2ads_v5" + AzureSKUNameStandardE2DV4 AzureSKUName = "Standard_E2d_v4" + AzureSKUNameStandardE2DV5 AzureSKUName = "Standard_E2d_v5" AzureSKUNameStandardE4AV4 AzureSKUName = "Standard_E4a_v4" AzureSKUNameStandardE4AdsV5 AzureSKUName = "Standard_E4ads_v5" + AzureSKUNameStandardE4DV4 AzureSKUName = "Standard_E4d_v4" + AzureSKUNameStandardE4DV5 AzureSKUName = "Standard_E4d_v5" AzureSKUNameStandardE64IV3 AzureSKUName = "Standard_E64i_v3" AzureSKUNameStandardE80IDsV4 AzureSKUName = "Standard_E80ids_v4" AzureSKUNameStandardE8AV4 AzureSKUName = "Standard_E8a_v4" @@ -52,15 +59,27 @@ const ( AzureSKUNameStandardE8AsV42TBPS AzureSKUName = "Standard_E8as_v4+2TB_PS" AzureSKUNameStandardE8AsV51TBPS AzureSKUName = "Standard_E8as_v5+1TB_PS" AzureSKUNameStandardE8AsV52TBPS AzureSKUName = "Standard_E8as_v5+2TB_PS" + AzureSKUNameStandardE8DV4 AzureSKUName = "Standard_E8d_v4" + AzureSKUNameStandardE8DV5 AzureSKUName = "Standard_E8d_v5" AzureSKUNameStandardE8SV41TBPS AzureSKUName = "Standard_E8s_v4+1TB_PS" AzureSKUNameStandardE8SV42TBPS AzureSKUName = "Standard_E8s_v4+2TB_PS" AzureSKUNameStandardE8SV51TBPS AzureSKUName = "Standard_E8s_v5+1TB_PS" AzureSKUNameStandardE8SV52TBPS AzureSKUName = "Standard_E8s_v5+2TB_PS" + AzureSKUNameStandardEC16AdsV5 AzureSKUName = "Standard_EC16ads_v5" + AzureSKUNameStandardEC16AsV53TBPS AzureSKUName = "Standard_EC16as_v5+3TB_PS" + AzureSKUNameStandardEC16AsV54TBPS AzureSKUName = "Standard_EC16as_v5+4TB_PS" + AzureSKUNameStandardEC8AdsV5 AzureSKUName = "Standard_EC8ads_v5" + AzureSKUNameStandardEC8AsV51TBPS AzureSKUName = "Standard_EC8as_v5+1TB_PS" + AzureSKUNameStandardEC8AsV52TBPS AzureSKUName = "Standard_EC8as_v5+2TB_PS" + AzureSKUNameStandardL16AsV3 AzureSKUName = "Standard_L16as_v3" AzureSKUNameStandardL16S AzureSKUName = "Standard_L16s" AzureSKUNameStandardL16SV2 AzureSKUName = "Standard_L16s_v2" + AzureSKUNameStandardL16SV3 AzureSKUName = "Standard_L16s_v3" AzureSKUNameStandardL4S AzureSKUName = "Standard_L4s" + AzureSKUNameStandardL8AsV3 AzureSKUName = "Standard_L8as_v3" AzureSKUNameStandardL8S AzureSKUName = "Standard_L8s" AzureSKUNameStandardL8SV2 AzureSKUName = "Standard_L8s_v2" + AzureSKUNameStandardL8SV3 AzureSKUName = "Standard_L8s_v3" ) // PossibleAzureSKUNameValues returns the possible values for the AzureSKUName const type. @@ -85,14 +104,20 @@ func PossibleAzureSKUNameValues() []AzureSKUName { AzureSKUNameStandardE16AsV44TBPS, AzureSKUNameStandardE16AsV53TBPS, AzureSKUNameStandardE16AsV54TBPS, + AzureSKUNameStandardE16DV4, + AzureSKUNameStandardE16DV5, AzureSKUNameStandardE16SV43TBPS, AzureSKUNameStandardE16SV44TBPS, AzureSKUNameStandardE16SV53TBPS, AzureSKUNameStandardE16SV54TBPS, AzureSKUNameStandardE2AV4, AzureSKUNameStandardE2AdsV5, + AzureSKUNameStandardE2DV4, + AzureSKUNameStandardE2DV5, AzureSKUNameStandardE4AV4, AzureSKUNameStandardE4AdsV5, + AzureSKUNameStandardE4DV4, + AzureSKUNameStandardE4DV5, AzureSKUNameStandardE64IV3, AzureSKUNameStandardE80IDsV4, AzureSKUNameStandardE8AV4, @@ -101,15 +126,27 @@ func PossibleAzureSKUNameValues() []AzureSKUName { AzureSKUNameStandardE8AsV42TBPS, AzureSKUNameStandardE8AsV51TBPS, AzureSKUNameStandardE8AsV52TBPS, + AzureSKUNameStandardE8DV4, + AzureSKUNameStandardE8DV5, AzureSKUNameStandardE8SV41TBPS, AzureSKUNameStandardE8SV42TBPS, AzureSKUNameStandardE8SV51TBPS, AzureSKUNameStandardE8SV52TBPS, + AzureSKUNameStandardEC16AdsV5, + AzureSKUNameStandardEC16AsV53TBPS, + AzureSKUNameStandardEC16AsV54TBPS, + AzureSKUNameStandardEC8AdsV5, + AzureSKUNameStandardEC8AsV51TBPS, + AzureSKUNameStandardEC8AsV52TBPS, + AzureSKUNameStandardL16AsV3, AzureSKUNameStandardL16S, AzureSKUNameStandardL16SV2, + AzureSKUNameStandardL16SV3, AzureSKUNameStandardL4S, + AzureSKUNameStandardL8AsV3, AzureSKUNameStandardL8S, AzureSKUNameStandardL8SV2, + AzureSKUNameStandardL8SV3, } } @@ -163,6 +200,21 @@ func PossibleBlobStorageEventTypeValues() []BlobStorageEventType { } } +type CallerRole string + +const ( + CallerRoleAdmin CallerRole = "Admin" + CallerRoleNone CallerRole = "None" +) + +// PossibleCallerRoleValues returns the possible values for the CallerRole const type. +func PossibleCallerRoleValues() []CallerRole { + return []CallerRole{ + CallerRoleAdmin, + CallerRoleNone, + } +} + // ClusterNetworkAccessFlag - Whether or not to restrict outbound network access. Value is optional but if passed in, must // be 'Enabled' or 'Disabled' type ClusterNetworkAccessFlag string @@ -309,6 +361,24 @@ func PossibleDatabaseRoutingValues() []DatabaseRouting { } } +// DatabaseShareOrigin - The origin of the following setup. +type DatabaseShareOrigin string + +const ( + DatabaseShareOriginDataShare DatabaseShareOrigin = "DataShare" + DatabaseShareOriginDirect DatabaseShareOrigin = "Direct" + DatabaseShareOriginOther DatabaseShareOrigin = "Other" +) + +// PossibleDatabaseShareOriginValues returns the possible values for the DatabaseShareOrigin const type. +func PossibleDatabaseShareOriginValues() []DatabaseShareOrigin { + return []DatabaseShareOrigin{ + DatabaseShareOriginDataShare, + DatabaseShareOriginDirect, + DatabaseShareOriginOther, + } +} + // DefaultPrincipalsModificationKind - The default principals modification kind type DefaultPrincipalsModificationKind string diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_databaseprincipalassignments_client.go b/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client.go similarity index 97% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_databaseprincipalassignments_client.go rename to sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client.go index 73cf213e378c..5fec23d4d448 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_databaseprincipalassignments_client.go +++ b/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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. @@ -103,7 +104,7 @@ func (client *DatabasePrincipalAssignmentsClient) checkNameAvailabilityCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, principalAssignmentName) @@ -120,7 +121,7 @@ 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-02-01 +// 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. @@ -142,7 +143,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -186,7 +187,7 @@ func (client *DatabasePrincipalAssignmentsClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -194,7 +195,7 @@ 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-02-01 +// 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. @@ -215,7 +216,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -259,7 +260,7 @@ func (client *DatabasePrincipalAssignmentsClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +268,7 @@ 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-02-01 +// 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. @@ -317,7 +318,7 @@ func (client *DatabasePrincipalAssignmentsClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,8 +334,7 @@ func (client *DatabasePrincipalAssignmentsClient) getHandleResponse(resp *http.R } // NewListPager - Lists all Kusto cluster database principalAssignments. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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. @@ -386,7 +386,7 @@ func (client *DatabasePrincipalAssignmentsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_databaseprincipalassignments_client_test.go b/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client_example_test.go similarity index 75% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_databaseprincipalassignments_client_test.go rename to sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client_example_test.go index 2942301ec0e7..0d2e926ec06e 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_databaseprincipalassignments_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/databaseprincipalassignments_client_example_test.go @@ -17,7 +17,7 @@ import ( "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-02-01/examples/KustoDatabasePrincipalAssignmentsCheckNameAvailability.json +// 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 { @@ -28,15 +28,10 @@ func ExampleDatabasePrincipalAssignmentsClient_CheckNameAvailability() { 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) + 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) } @@ -44,7 +39,7 @@ func ExampleDatabasePrincipalAssignmentsClient_CheckNameAvailability() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabasePrincipalAssignmentsGet.json +// 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 { @@ -55,12 +50,7 @@ func ExampleDatabasePrincipalAssignmentsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "kustorptest", - "kustoCluster", - "Kustodatabase8", - "kustoprincipal1", - nil) + res, err := client.Get(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", "kustoprincipal1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -68,7 +58,7 @@ func ExampleDatabasePrincipalAssignmentsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabasePrincipalAssignmentsCreateOrUpdate.json +// 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 { @@ -79,20 +69,14 @@ func ExampleDatabasePrincipalAssignmentsClient_BeginCreateOrUpdate() { 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"), - }, + 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) + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -104,7 +88,7 @@ func ExampleDatabasePrincipalAssignmentsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabasePrincipalAssignmentsDelete.json +// 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 { @@ -115,12 +99,7 @@ func ExampleDatabasePrincipalAssignmentsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, - "kustorptest", - "kustoCluster", - "Kustodatabase8", - "kustoprincipal1", - nil) + poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", "kustoprincipal1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -130,7 +109,7 @@ func ExampleDatabasePrincipalAssignmentsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabasePrincipalAssignmentsList.json +// 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 { @@ -141,10 +120,7 @@ func ExampleDatabasePrincipalAssignmentsClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("kustorptest", - "kustoCluster", - "Kustodatabase8", - nil) + pager := client.NewListPager("kustorptest", "kustoCluster", "Kustodatabase8", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_databases_client.go b/sdk/resourcemanager/kusto/armkusto/databases_client.go similarity index 96% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_databases_client.go rename to sdk/resourcemanager/kusto/armkusto/databases_client.go index 99e80377d2e8..d2e04eff9fbd 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_databases_client.go +++ b/sdk/resourcemanager/kusto/armkusto/databases_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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. @@ -102,7 +103,7 @@ func (client *DatabasesClient) addPrincipalsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, databasePrincipalsToAdd) @@ -119,7 +120,7 @@ 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-02-01 +// 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. @@ -160,7 +161,7 @@ func (client *DatabasesClient) checkNameAvailabilityCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resourceName) @@ -177,7 +178,7 @@ 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-02-01 +// 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. @@ -198,7 +199,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -238,7 +239,10 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") + if options != nil && options.CallerRole != nil { + reqQP.Set("callerRole", string(*options.CallerRole)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -246,7 +250,7 @@ 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-02-01 +// 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. @@ -265,7 +269,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -305,7 +309,7 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,7 +317,7 @@ 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-02-01 +// 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. @@ -357,7 +361,7 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,8 +377,7 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases } // NewListByClusterPager - Returns the list of databases of the given Kusto cluster. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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. @@ -420,7 +423,7 @@ func (client *DatabasesClient) listByClusterCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -436,8 +439,7 @@ func (client *DatabasesClient) listByClusterHandleResponse(resp *http.Response) } // NewListPrincipalsPager - Returns a list of database principals of the given Kusto cluster and database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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. @@ -489,7 +491,7 @@ func (client *DatabasesClient) listPrincipalsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -506,7 +508,7 @@ 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-02-01 +// 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. @@ -552,7 +554,7 @@ func (client *DatabasesClient) removePrincipalsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, databasePrincipalsToRemove) @@ -569,7 +571,7 @@ 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-02-01 +// 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. @@ -589,7 +591,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -629,7 +631,10 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") + if options != nil && options.CallerRole != nil { + reqQP.Set("callerRole", string(*options.CallerRole)) + } 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/ze_generated_example_databases_client_test.go b/sdk/resourcemanager/kusto/armkusto/databases_client_example_test.go similarity index 57% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_databases_client_test.go rename to sdk/resourcemanager/kusto/armkusto/databases_client_example_test.go index 729a8af69ecf..41d31e201f33 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_databases_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/databases_client_example_test.go @@ -17,7 +17,7 @@ import ( "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-02-01/examples/KustoDatabasesCheckNameAvailability.json +// 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 { @@ -28,14 +28,10 @@ func ExampleDatabasesClient_CheckNameAvailability() { 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) + 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) } @@ -43,7 +39,7 @@ func ExampleDatabasesClient_CheckNameAvailability() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabasesListByCluster.json +// 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 { @@ -54,9 +50,7 @@ func ExampleDatabasesClient_NewListByClusterPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByClusterPager("kustorptest", - "kustoCluster", - nil) + pager := client.NewListByClusterPager("kustorptest", "kustoCluster", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -69,7 +63,7 @@ func ExampleDatabasesClient_NewListByClusterPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabasesGet.json +// 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 { @@ -80,11 +74,7 @@ func ExampleDatabasesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "kustorptest", - "kustoCluster", - "KustoDatabase8", - nil) + res, err := client.Get(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -92,8 +82,8 @@ func ExampleDatabasesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabaseReadonlyUpdate.json -func ExampleDatabasesClient_BeginCreateOrUpdate() { +// 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) @@ -103,18 +93,42 @@ func ExampleDatabasesClient_BeginCreateOrUpdate() { 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"), - }, + 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"), }, - nil) + }, &armkusto.DatabasesClientBeginCreateOrUpdateOptions{CallerRole: to.Ptr(armkusto.CallerRoleAdmin)}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -126,7 +140,7 @@ func ExampleDatabasesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabasesUpdate.json +// 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 { @@ -137,17 +151,12 @@ func ExampleDatabasesClient_BeginUpdate() { 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"), - }, + poller, err := client.BeginUpdate(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", &armkusto.ReadWriteDatabase{ + Kind: to.Ptr(armkusto.KindReadWrite), + Properties: &armkusto.ReadWriteDatabaseProperties{ + HotCachePeriod: to.Ptr("P1D"), }, - nil) + }, &armkusto.DatabasesClientBeginUpdateOptions{CallerRole: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -159,7 +168,7 @@ func ExampleDatabasesClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabasesDelete.json +// 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 { @@ -170,11 +179,7 @@ func ExampleDatabasesClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, - "kustorptest", - "kustoCluster", - "KustoDatabase8", - nil) + poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -184,7 +189,7 @@ func ExampleDatabasesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabaseListPrincipals.json +// 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 { @@ -195,10 +200,7 @@ func ExampleDatabasesClient_NewListPrincipalsPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPrincipalsPager("kustorptest", - "kustoCluster", - "KustoDatabase8", - nil) + pager := client.NewListPrincipalsPager("kustorptest", "kustoCluster", "KustoDatabase8", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -211,7 +213,7 @@ func ExampleDatabasesClient_NewListPrincipalsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabaseAddPrincipals.json +// 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 { @@ -222,38 +224,33 @@ func ExampleDatabasesClient_AddPrincipals() { 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) + 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) } @@ -261,7 +258,7 @@ func ExampleDatabasesClient_AddPrincipals() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoDatabaseRemovePrincipals.json +// 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 { @@ -272,38 +269,33 @@ func ExampleDatabasesClient_RemovePrincipals() { 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) + 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) } diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_dataconnections_client.go b/sdk/resourcemanager/kusto/armkusto/dataconnections_client.go similarity index 97% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_dataconnections_client.go rename to sdk/resourcemanager/kusto/armkusto/dataconnections_client.go index 95a211acfdf6..c8184118fdf9 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_dataconnections_client.go +++ b/sdk/resourcemanager/kusto/armkusto/dataconnections_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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. @@ -103,7 +104,7 @@ func (client *DataConnectionsClient) checkNameAvailabilityCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, dataConnectionName) @@ -120,7 +121,7 @@ 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-02-01 +// 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. @@ -142,7 +143,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -186,7 +187,7 @@ func (client *DataConnectionsClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -194,7 +195,7 @@ 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-02-01 +// 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. @@ -217,7 +218,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -257,7 +258,7 @@ func (client *DataConnectionsClient) dataConnectionValidationCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -265,7 +266,7 @@ 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-02-01 +// 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. @@ -286,7 +287,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -330,7 +331,7 @@ func (client *DataConnectionsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,7 +339,7 @@ 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-02-01 +// 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. @@ -387,7 +388,7 @@ func (client *DataConnectionsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -403,8 +404,7 @@ func (client *DataConnectionsClient) getHandleResponse(resp *http.Response) (Dat } // NewListByDatabasePager - Returns the list of data connections of the given Kusto database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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. @@ -456,7 +456,7 @@ func (client *DataConnectionsClient) listByDatabaseCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -473,7 +473,7 @@ 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-02-01 +// 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. @@ -495,7 +495,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 +539,7 @@ func (client *DataConnectionsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") 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 new file mode 100644 index 000000000000..bbb9fd34d938 --- /dev/null +++ b/sdk/resourcemanager/kusto/armkusto/dataconnections_client_example_test.go @@ -0,0 +1,341 @@ +//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 26d349535ff1..e0ab412ef86b 100644 --- a/sdk/resourcemanager/kusto/armkusto/go.mod +++ b/sdk/resourcemanager/kusto/armkusto/go.mod @@ -4,12 +4,12 @@ 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.0.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 ) require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.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 diff --git a/sdk/resourcemanager/kusto/armkusto/go.sum b/sdk/resourcemanager/kusto/armkusto/go.sum index ed5b814680ee..8828b17b1853 100644 --- a/sdk/resourcemanager/kusto/armkusto/go.sum +++ b/sdk/resourcemanager/kusto/armkusto/go.sum @@ -1,11 +1,11 @@ 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.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= +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.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +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= diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_managedprivateendpoints_client.go b/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client.go similarity index 97% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_managedprivateendpoints_client.go rename to sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client.go index 4f6b5148c271..cf168cd9b051 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_managedprivateendpoints_client.go +++ b/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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. @@ -98,7 +99,7 @@ func (client *ManagedPrivateEndpointsClient) checkNameAvailabilityCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resourceName) @@ -115,7 +116,7 @@ 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-02-01 +// 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. @@ -136,7 +137,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -176,7 +177,7 @@ func (client *ManagedPrivateEndpointsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -184,7 +185,7 @@ 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-02-01 +// 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. @@ -204,7 +205,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -244,7 +245,7 @@ func (client *ManagedPrivateEndpointsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +253,7 @@ 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-02-01 +// 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. @@ -297,7 +298,7 @@ func (client *ManagedPrivateEndpointsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,8 +314,7 @@ func (client *ManagedPrivateEndpointsClient) getHandleResponse(resp *http.Respon } // NewListPager - Returns the list of managed private endpoints. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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 @@ -361,7 +361,7 @@ func (client *ManagedPrivateEndpointsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -378,7 +378,7 @@ 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-02-01 +// 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. @@ -399,7 +399,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 +439,7 @@ func (client *ManagedPrivateEndpointsClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") 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/ze_generated_example_managedprivateendpoints_client_test.go b/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client_example_test.go similarity index 72% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_managedprivateendpoints_client_test.go rename to sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client_example_test.go index baf710b02e90..3953fd8a87db 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_managedprivateendpoints_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/managedprivateendpoints_client_example_test.go @@ -17,7 +17,7 @@ import ( "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-02-01/examples/KustoManagedPrivateEndpointsCheckNameAvailability.json +// 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 { @@ -28,14 +28,10 @@ func ExampleManagedPrivateEndpointsClient_CheckNameAvailability() { 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) + 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) } @@ -43,7 +39,7 @@ func ExampleManagedPrivateEndpointsClient_CheckNameAvailability() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoManagedPrivateEndpointsList.json +// 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 { @@ -54,9 +50,7 @@ func ExampleManagedPrivateEndpointsClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("kustorptest", - "kustoCluster", - nil) + pager := client.NewListPager("kustorptest", "kustoCluster", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -69,7 +63,7 @@ func ExampleManagedPrivateEndpointsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoManagedPrivateEndpointsGet.json +// 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 { @@ -80,11 +74,7 @@ func ExampleManagedPrivateEndpointsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "kustorptest", - "kustoCluster", - "managedPrivateEndpointTest", - nil) + res, err := client.Get(ctx, "kustorptest", "kustoCluster", "managedPrivateEndpointTest", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -92,7 +82,7 @@ func ExampleManagedPrivateEndpointsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoManagedPrivateEndpointsCreateOrUpdate.json +// 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 { @@ -103,18 +93,13 @@ func ExampleManagedPrivateEndpointsClient_BeginCreateOrUpdate() { 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."), - }, + 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) + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -126,7 +111,7 @@ func ExampleManagedPrivateEndpointsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoManagedPrivateEndpointsUpdate.json +// 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 { @@ -137,18 +122,13 @@ func ExampleManagedPrivateEndpointsClient_BeginUpdate() { 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."), - }, + 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) + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -160,7 +140,7 @@ func ExampleManagedPrivateEndpointsClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoManagedPrivateEndpointsDelete.json +// 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 { @@ -171,11 +151,7 @@ func ExampleManagedPrivateEndpointsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, - "kustorptest", - "kustoCluster", - "managedPrivateEndpointTest", - nil) + poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "managedPrivateEndpointTest", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_models.go b/sdk/resourcemanager/kusto/armkusto/models.go similarity index 95% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_models.go rename to sdk/resourcemanager/kusto/armkusto/models.go index 5e61674f33f8..7e74ffe8c0ef 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_models.go +++ b/sdk/resourcemanager/kusto/armkusto/models.go @@ -5,6 +5,7 @@ // 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 @@ -52,6 +53,13 @@ type AttachedDatabaseConfigurationProperties struct { // REQUIRED; The default principals modification kind DefaultPrincipalsModificationKind *DefaultPrincipalsModificationKind `json:"defaultPrincipalsModificationKind,omitempty"` + // Overrides the original database name. Relevant only when attaching to a specific database. + DatabaseNameOverride *string `json:"databaseNameOverride,omitempty"` + + // Adds a prefix to the attached databases name. When following an entire cluster, that prefix would be added to all of the + // databases original names from leader cluster. + DatabaseNamePrefix *string `json:"databaseNamePrefix,omitempty"` + // Table level sharing specifications TableLevelSharingProperties *TableLevelSharingProperties `json:"tableLevelSharingProperties,omitempty"` @@ -68,7 +76,8 @@ type AttachedDatabaseConfigurationsCheckNameRequest struct { // REQUIRED; Attached database resource name. Name *string `json:"name,omitempty"` - // REQUIRED; The type of resource, for instance Microsoft.Kusto/clusters/attachedDatabaseConfigurations. + // CONSTANT; The type of resource, for instance Microsoft.Kusto/clusters/attachedDatabaseConfigurations. + // Field has constant value "Microsoft.Kusto/clusters/attachedDatabaseConfigurations", any specified value is ignored. Type *string `json:"type,omitempty"` } @@ -167,27 +176,6 @@ type CheckNameResult struct { Reason *Reason `json:"reason,omitempty"` } -// CloudError - An error response from Kusto. -type CloudError struct { - // An error response from Kusto. - Error *CloudErrorBody `json:"error,omitempty"` -} - -// CloudErrorBody - An error response from Kusto. -type CloudErrorBody struct { - // An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - - // A list of additional details about the error. - Details []*CloudErrorBody `json:"details,omitempty"` - - // A message describing the error, intended to be suitable for displaying in a user interface. - Message *string `json:"message,omitempty"` - - // The target of the particular error. For example, the name of the property in error. - Target *string `json:"target,omitempty"` -} - // Cluster - Class representing a Kusto cluster. type Cluster struct { // REQUIRED; The geo-location where the resource lives @@ -229,7 +217,8 @@ type ClusterCheckNameRequest struct { // REQUIRED; Cluster name. Name *string `json:"name,omitempty"` - // REQUIRED; The type of resource, Microsoft.Kusto/clusters. + // CONSTANT; The type of resource, Microsoft.Kusto/clusters. + // Field has constant value "Microsoft.Kusto/clusters", any specified value is ignored. Type *string `json:"type,omitempty"` } @@ -259,7 +248,8 @@ type ClusterPrincipalAssignmentCheckNameRequest struct { // REQUIRED; Principal Assignment resource name. Name *string `json:"name,omitempty"` - // REQUIRED; The type of resource, Microsoft.Kusto/clusters/principalAssignments. + // CONSTANT; The type of resource, Microsoft.Kusto/clusters/principalAssignments. + // Field has constant value "Microsoft.Kusto/clusters/principalAssignments", any specified value is ignored. Type *string `json:"type,omitempty"` } @@ -592,7 +582,8 @@ type DataConnectionCheckNameRequest struct { // REQUIRED; Data Connection name. Name *string `json:"name,omitempty"` - // REQUIRED; The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. + // CONSTANT; The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. + // Field has constant value "Microsoft.Kusto/clusters/databases/dataConnections", any specified value is ignored. Type *string `json:"type,omitempty"` } @@ -746,7 +737,8 @@ type DatabasePrincipalAssignmentCheckNameRequest struct { // REQUIRED; Principal Assignment resource name. Name *string `json:"name,omitempty"` - // REQUIRED; The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. + // CONSTANT; The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. + // Field has constant value "Microsoft.Kusto/clusters/databases/principalAssignments", any specified value is ignored. Type *string `json:"type,omitempty"` } @@ -842,6 +834,9 @@ type DatabasesClientAddPrincipalsOptions struct { // DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate // method. type DatabasesClientBeginCreateOrUpdateOptions struct { + // By default, any user who run operation on a database become an Admin on it. This property allows the caller to exclude + // the caller from Admins list. + CallerRole *CallerRole // Resumes the LRO from the provided token. ResumeToken string } @@ -854,6 +849,9 @@ type DatabasesClientBeginDeleteOptions struct { // DatabasesClientBeginUpdateOptions contains the optional parameters for the DatabasesClient.BeginUpdate method. type DatabasesClientBeginUpdateOptions struct { + // By default, any user who run operation on a database become an Admin on it. This property allows the caller to exclude + // the caller from Admins list. + CallerRole *CallerRole // Resumes the LRO from the provided token. ResumeToken string } @@ -930,8 +928,7 @@ type EventGridConnectionProperties struct { // A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file IgnoreFirstRecord *bool `json:"ignoreFirstRecord,omitempty"` - // Empty for non-managed identity based data connection. For system assigned identity, provide cluster resource Id. For user - // assigned identity (UAI) provide the UAI resource Id. + // The resource ID of a managed identity (system or user assigned) to be used to authenticate with event hub and storage account. ManagedIdentityResourceID *string `json:"managedIdentityResourceId,omitempty"` // The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. @@ -999,13 +996,16 @@ type EventHubConnectionProperties struct { // System properties of the event hub EventSystemProperties []*string `json:"eventSystemProperties,omitempty"` - // Empty for non-managed identity based data connection. For system assigned identity, provide cluster resource Id. For user - // assigned identity (UAI) provide the UAI resource Id. + // The resource ID of a managed identity (system or user assigned) to be used to authenticate with event hub. ManagedIdentityResourceID *string `json:"managedIdentityResourceId,omitempty"` // The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. MappingRuleName *string `json:"mappingRuleName,omitempty"` + // When defined, the data connection retrieves existing Event hub events created since the Retrieval start date. It can only + // retrieve events retained by the Event hub, based on its retention period. + RetrievalStartDate *time.Time `json:"retrievalStartDate,omitempty"` + // The table where the data should be ingested. Optionally the table information can be added to each message. TableName *string `json:"tableName,omitempty"` @@ -1058,6 +1058,12 @@ type FollowerDatabaseDefinition struct { // READ-ONLY; The database name owned by this cluster that was followed. * in case following all databases. DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` + + // READ-ONLY; The origin of the following setup. + DatabaseShareOrigin *DatabaseShareOrigin `json:"databaseShareOrigin,omitempty" azure:"ro"` + + // READ-ONLY; Table level sharing specifications + TableLevelSharingProperties *TableLevelSharingProperties `json:"tableLevelSharingProperties,omitempty" azure:"ro"` } // FollowerDatabaseListResult - The list Kusto database principals operation response. @@ -1108,6 +1114,10 @@ type IotHubConnectionProperties struct { // The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. MappingRuleName *string `json:"mappingRuleName,omitempty"` + // When defined, the data connection retrieves existing Event hub events created since the Retrieval start date. It can only + // retrieve events retained by the Event hub, based on its retention period. + RetrievalStartDate *time.Time `json:"retrievalStartDate,omitempty"` + // The table where the data should be ingested. Optionally the table information can be added to each message. TableName *string `json:"tableName,omitempty"` @@ -1227,7 +1237,8 @@ type ManagedPrivateEndpointsCheckNameRequest struct { // REQUIRED; Managed private endpoint resource name. Name *string `json:"name,omitempty"` - // REQUIRED; The type of resource, for instance Microsoft.Kusto/clusters/managedPrivateEndpoints. + // CONSTANT; The type of resource, for instance Microsoft.Kusto/clusters/managedPrivateEndpoints. + // Field has constant value "Microsoft.Kusto/clusters/managedPrivateEndpoints", any specified value is ignored. Type *string `json:"type,omitempty"` } @@ -1558,19 +1569,6 @@ type PrivateLinkServiceConnectionStateProperty struct { ActionsRequired *string `json:"actionsRequired,omitempty" azure:"ro"` } -// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a -// location -type ProxyResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `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"` -} - // ReadOnlyFollowingDatabase - Class representing a read only following database. type ReadOnlyFollowingDatabase struct { // REQUIRED; Kind of the database @@ -1611,9 +1609,15 @@ type ReadOnlyFollowingDatabaseProperties struct { // READ-ONLY; The name of the attached database configuration cluster AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty" azure:"ro"` + // READ-ONLY; The origin of the following setup. + DatabaseShareOrigin *DatabaseShareOrigin `json:"databaseShareOrigin,omitempty" azure:"ro"` + // READ-ONLY; The name of the leader cluster LeaderClusterResourceID *string `json:"leaderClusterResourceId,omitempty" azure:"ro"` + // READ-ONLY; The original database name, before databaseNameOverride or databaseNamePrefix where applied. + OriginalDatabaseName *string `json:"originalDatabaseName,omitempty" azure:"ro"` + // READ-ONLY; The principals modification kind of the database PrincipalsModificationKind *PrincipalsModificationKind `json:"principalsModificationKind,omitempty" azure:"ro"` @@ -1625,6 +1629,9 @@ type ReadOnlyFollowingDatabaseProperties struct { // READ-ONLY; The statistics of the database. Statistics *DatabaseStatistics `json:"statistics,omitempty" azure:"ro"` + + // READ-ONLY; Table level sharing specifications + TableLevelSharingProperties *TableLevelSharingProperties `json:"tableLevelSharingProperties,omitempty" azure:"ro"` } // ReadWriteDatabase - Class representing a read write database. @@ -1677,18 +1684,6 @@ type ReadWriteDatabaseProperties struct { Statistics *DatabaseStatistics `json:"statistics,omitempty" azure:"ro"` } -// Resource - Common fields that are returned in the response for all Azure Resource Manager resources -type Resource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `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"` -} - // SKUDescription - The Kusto SKU description of given resource type type SKUDescription struct { // READ-ONLY; Locations and zones @@ -1748,7 +1743,8 @@ type ScriptCheckNameRequest struct { // REQUIRED; Script name. Name *string `json:"name,omitempty"` - // REQUIRED; The type of resource, Microsoft.Kusto/clusters/databases/scripts. + // CONSTANT; The type of resource, Microsoft.Kusto/clusters/databases/scripts. + // Field has constant value "Microsoft.Kusto/clusters/databases/scripts", any specified value is ignored. Type *string `json:"type,omitempty"` } @@ -1856,25 +1852,6 @@ type TableLevelSharingProperties struct { TablesToInclude []*string `json:"tablesToInclude,omitempty"` } -// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' -// and a 'location' -type TrackedResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,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"` -} - // TrustedExternalTenant - Represents a tenant ID that is trusted by the cluster. type TrustedExternalTenant struct { // GUID representing an external tenant. diff --git a/sdk/resourcemanager/kusto/armkusto/models_serde.go b/sdk/resourcemanager/kusto/armkusto/models_serde.go new file mode 100644 index 000000000000..cf67173e736a --- /dev/null +++ b/sdk/resourcemanager/kusto/armkusto/models_serde.go @@ -0,0 +1,3492 @@ +//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 ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AcceptedAudiences. +func (a AcceptedAudiences) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AcceptedAudiences. +func (a *AcceptedAudiences) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AttachedDatabaseConfiguration. +func (a AttachedDatabaseConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AttachedDatabaseConfiguration. +func (a *AttachedDatabaseConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AttachedDatabaseConfigurationListResult. +func (a AttachedDatabaseConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AttachedDatabaseConfigurationListResult. +func (a *AttachedDatabaseConfigurationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AttachedDatabaseConfigurationProperties. +func (a AttachedDatabaseConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "attachedDatabaseNames", a.AttachedDatabaseNames) + populate(objectMap, "clusterResourceId", a.ClusterResourceID) + populate(objectMap, "databaseName", a.DatabaseName) + populate(objectMap, "databaseNameOverride", a.DatabaseNameOverride) + populate(objectMap, "databaseNamePrefix", a.DatabaseNamePrefix) + populate(objectMap, "defaultPrincipalsModificationKind", a.DefaultPrincipalsModificationKind) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "tableLevelSharingProperties", a.TableLevelSharingProperties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AttachedDatabaseConfigurationProperties. +func (a *AttachedDatabaseConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "attachedDatabaseNames": + err = unpopulate(val, "AttachedDatabaseNames", &a.AttachedDatabaseNames) + delete(rawMsg, key) + case "clusterResourceId": + err = unpopulate(val, "ClusterResourceID", &a.ClusterResourceID) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &a.DatabaseName) + delete(rawMsg, key) + case "databaseNameOverride": + err = unpopulate(val, "DatabaseNameOverride", &a.DatabaseNameOverride) + delete(rawMsg, key) + case "databaseNamePrefix": + err = unpopulate(val, "DatabaseNamePrefix", &a.DatabaseNamePrefix) + delete(rawMsg, key) + case "defaultPrincipalsModificationKind": + err = unpopulate(val, "DefaultPrincipalsModificationKind", &a.DefaultPrincipalsModificationKind) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "tableLevelSharingProperties": + err = unpopulate(val, "TableLevelSharingProperties", &a.TableLevelSharingProperties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AttachedDatabaseConfigurationsCheckNameRequest. +func (a AttachedDatabaseConfigurationsCheckNameRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", a.Name) + objectMap["type"] = "Microsoft.Kusto/clusters/attachedDatabaseConfigurations" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AttachedDatabaseConfigurationsCheckNameRequest. +func (a *AttachedDatabaseConfigurationsCheckNameRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureCapacity. +func (a AzureCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "default", a.Default) + populate(objectMap, "maximum", a.Maximum) + populate(objectMap, "minimum", a.Minimum) + populate(objectMap, "scaleType", a.ScaleType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCapacity. +func (a *AzureCapacity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "default": + err = unpopulate(val, "Default", &a.Default) + delete(rawMsg, key) + case "maximum": + err = unpopulate(val, "Maximum", &a.Maximum) + delete(rawMsg, key) + case "minimum": + err = unpopulate(val, "Minimum", &a.Minimum) + delete(rawMsg, key) + case "scaleType": + err = unpopulate(val, "ScaleType", &a.ScaleType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureResourceSKU. +func (a AzureResourceSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", a.Capacity) + populate(objectMap, "resourceType", a.ResourceType) + populate(objectMap, "sku", a.SKU) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceSKU. +func (a *AzureResourceSKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &a.Capacity) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &a.ResourceType) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureSKU. +func (a AzureSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", a.Capacity) + populate(objectMap, "name", a.Name) + populate(objectMap, "tier", a.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSKU. +func (a *AzureSKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &a.Capacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &a.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameRequest. +func (c CheckNameRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameRequest. +func (c *CheckNameRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "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 CheckNameResult. +func (c CheckNameResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", c.Message) + populate(objectMap, "name", c.Name) + populate(objectMap, "nameAvailable", c.NameAvailable) + populate(objectMap, "reason", c.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameResult. +func (c *CheckNameResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &c.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "sku", c.SKU) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + populate(objectMap, "zones", c.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Cluster. +func (c *Cluster) UnmarshalJSON(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 "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &c.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &c.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &c.Zones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterCheckNameRequest. +func (c ClusterCheckNameRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + objectMap["type"] = "Microsoft.Kusto/clusters" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCheckNameRequest. +func (c *ClusterCheckNameRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "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 ClusterListResult. +func (c ClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterListResult. +func (c *ClusterListResult) UnmarshalJSON(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 "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterPrincipalAssignment. +func (c ClusterPrincipalAssignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + 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 ClusterPrincipalAssignment. +func (c *ClusterPrincipalAssignment) UnmarshalJSON(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 "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 ClusterPrincipalAssignmentCheckNameRequest. +func (c ClusterPrincipalAssignmentCheckNameRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + objectMap["type"] = "Microsoft.Kusto/clusters/principalAssignments" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPrincipalAssignmentCheckNameRequest. +func (c *ClusterPrincipalAssignmentCheckNameRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "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 ClusterPrincipalAssignmentListResult. +func (c ClusterPrincipalAssignmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPrincipalAssignmentListResult. +func (c *ClusterPrincipalAssignmentListResult) UnmarshalJSON(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 "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterPrincipalProperties. +func (c ClusterPrincipalProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aadObjectId", c.AADObjectID) + populate(objectMap, "principalId", c.PrincipalID) + populate(objectMap, "principalName", c.PrincipalName) + populate(objectMap, "principalType", c.PrincipalType) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "role", c.Role) + populate(objectMap, "tenantId", c.TenantID) + populate(objectMap, "tenantName", c.TenantName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPrincipalProperties. +func (c *ClusterPrincipalProperties) UnmarshalJSON(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 "aadObjectId": + err = unpopulate(val, "AADObjectID", &c.AADObjectID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &c.PrincipalID) + delete(rawMsg, key) + case "principalName": + err = unpopulate(val, "PrincipalName", &c.PrincipalName) + delete(rawMsg, key) + case "principalType": + err = unpopulate(val, "PrincipalType", &c.PrincipalType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &c.Role) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &c.TenantID) + delete(rawMsg, key) + case "tenantName": + err = unpopulate(val, "TenantName", &c.TenantName) + 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 ClusterProperties. +func (c ClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "acceptedAudiences", c.AcceptedAudiences) + populate(objectMap, "allowedFqdnList", c.AllowedFqdnList) + populate(objectMap, "allowedIpRangeList", c.AllowedIPRangeList) + populate(objectMap, "dataIngestionUri", c.DataIngestionURI) + populate(objectMap, "enableAutoStop", c.EnableAutoStop) + populate(objectMap, "enableDiskEncryption", c.EnableDiskEncryption) + populate(objectMap, "enableDoubleEncryption", c.EnableDoubleEncryption) + populate(objectMap, "enablePurge", c.EnablePurge) + populate(objectMap, "enableStreamingIngest", c.EnableStreamingIngest) + populate(objectMap, "engineType", c.EngineType) + populate(objectMap, "keyVaultProperties", c.KeyVaultProperties) + populate(objectMap, "languageExtensions", c.LanguageExtensions) + populate(objectMap, "optimizedAutoscale", c.OptimizedAutoscale) + populate(objectMap, "privateEndpointConnections", c.PrivateEndpointConnections) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "publicIPType", c.PublicIPType) + populate(objectMap, "publicNetworkAccess", c.PublicNetworkAccess) + populate(objectMap, "restrictOutboundNetworkAccess", c.RestrictOutboundNetworkAccess) + populate(objectMap, "state", c.State) + populate(objectMap, "stateReason", c.StateReason) + populate(objectMap, "trustedExternalTenants", c.TrustedExternalTenants) + populate(objectMap, "uri", c.URI) + populate(objectMap, "virtualClusterGraduationProperties", c.VirtualClusterGraduationProperties) + populate(objectMap, "virtualNetworkConfiguration", c.VirtualNetworkConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterProperties. +func (c *ClusterProperties) UnmarshalJSON(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 "acceptedAudiences": + err = unpopulate(val, "AcceptedAudiences", &c.AcceptedAudiences) + delete(rawMsg, key) + case "allowedFqdnList": + err = unpopulate(val, "AllowedFqdnList", &c.AllowedFqdnList) + delete(rawMsg, key) + case "allowedIpRangeList": + err = unpopulate(val, "AllowedIPRangeList", &c.AllowedIPRangeList) + delete(rawMsg, key) + case "dataIngestionUri": + err = unpopulate(val, "DataIngestionURI", &c.DataIngestionURI) + delete(rawMsg, key) + case "enableAutoStop": + err = unpopulate(val, "EnableAutoStop", &c.EnableAutoStop) + delete(rawMsg, key) + case "enableDiskEncryption": + err = unpopulate(val, "EnableDiskEncryption", &c.EnableDiskEncryption) + delete(rawMsg, key) + case "enableDoubleEncryption": + err = unpopulate(val, "EnableDoubleEncryption", &c.EnableDoubleEncryption) + delete(rawMsg, key) + case "enablePurge": + err = unpopulate(val, "EnablePurge", &c.EnablePurge) + delete(rawMsg, key) + case "enableStreamingIngest": + err = unpopulate(val, "EnableStreamingIngest", &c.EnableStreamingIngest) + delete(rawMsg, key) + case "engineType": + err = unpopulate(val, "EngineType", &c.EngineType) + delete(rawMsg, key) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &c.KeyVaultProperties) + delete(rawMsg, key) + case "languageExtensions": + err = unpopulate(val, "LanguageExtensions", &c.LanguageExtensions) + delete(rawMsg, key) + case "optimizedAutoscale": + err = unpopulate(val, "OptimizedAutoscale", &c.OptimizedAutoscale) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &c.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "publicIPType": + err = unpopulate(val, "PublicIPType", &c.PublicIPType) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &c.PublicNetworkAccess) + delete(rawMsg, key) + case "restrictOutboundNetworkAccess": + err = unpopulate(val, "RestrictOutboundNetworkAccess", &c.RestrictOutboundNetworkAccess) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + delete(rawMsg, key) + case "stateReason": + err = unpopulate(val, "StateReason", &c.StateReason) + delete(rawMsg, key) + case "trustedExternalTenants": + err = unpopulate(val, "TrustedExternalTenants", &c.TrustedExternalTenants) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &c.URI) + delete(rawMsg, key) + case "virtualClusterGraduationProperties": + err = unpopulate(val, "VirtualClusterGraduationProperties", &c.VirtualClusterGraduationProperties) + delete(rawMsg, key) + case "virtualNetworkConfiguration": + err = unpopulate(val, "VirtualNetworkConfiguration", &c.VirtualNetworkConfiguration) + 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 ClusterUpdate. +func (c ClusterUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "sku", c.SKU) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterUpdate. +func (c *ClusterUpdate) UnmarshalJSON(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 "identity": + err = unpopulate(val, "Identity", &c.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &c.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties. +func (c ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", c.ClientID) + populate(objectMap, "principalId", c.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties. +func (c *ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties) UnmarshalJSON(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 "clientId": + err = unpopulate(val, "ClientID", &c.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &c.PrincipalID) + 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{}) + populate(objectMap, "id", d.ID) + objectMap["kind"] = d.Kind + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnection. +func (d *DataConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataConnectionCheckNameRequest. +func (d DataConnectionCheckNameRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", d.Name) + objectMap["type"] = "Microsoft.Kusto/clusters/databases/dataConnections" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectionCheckNameRequest. +func (d *DataConnectionCheckNameRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataConnectionListResult. +func (d DataConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectionListResult. +func (d *DataConnectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + d.Value, err = unmarshalDataConnectionClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataConnectionValidation. +func (d DataConnectionValidation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataConnectionName", d.DataConnectionName) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectionValidation. +func (d *DataConnectionValidation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataConnectionName": + err = unpopulate(val, "DataConnectionName", &d.DataConnectionName) + delete(rawMsg, key) + case "properties": + d.Properties, err = unmarshalDataConnectionClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataConnectionValidationListResult. +func (d DataConnectionValidationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectionValidationListResult. +func (d *DataConnectionValidationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataConnectionValidationResult. +func (d DataConnectionValidationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorMessage", d.ErrorMessage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectionValidationResult. +func (d *DataConnectionValidationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &d.ErrorMessage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Database. +func (d Database) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + objectMap["kind"] = d.Kind + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Database. +func (d *Database) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseListResult. +func (d DatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseListResult. +func (d *DatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + d.Value, err = unmarshalDatabaseClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabasePrincipal. +func (d DatabasePrincipal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appId", d.AppID) + populate(objectMap, "email", d.Email) + populate(objectMap, "fqn", d.Fqn) + populate(objectMap, "name", d.Name) + populate(objectMap, "role", d.Role) + populate(objectMap, "tenantName", d.TenantName) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabasePrincipal. +func (d *DatabasePrincipal) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "appId": + err = unpopulate(val, "AppID", &d.AppID) + delete(rawMsg, key) + case "email": + err = unpopulate(val, "Email", &d.Email) + delete(rawMsg, key) + case "fqn": + err = unpopulate(val, "Fqn", &d.Fqn) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &d.Role) + delete(rawMsg, key) + case "tenantName": + err = unpopulate(val, "TenantName", &d.TenantName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalAssignment. +func (d DatabasePrincipalAssignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabasePrincipalAssignment. +func (d *DatabasePrincipalAssignment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalAssignmentCheckNameRequest. +func (d DatabasePrincipalAssignmentCheckNameRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", d.Name) + objectMap["type"] = "Microsoft.Kusto/clusters/databases/principalAssignments" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabasePrincipalAssignmentCheckNameRequest. +func (d *DatabasePrincipalAssignmentCheckNameRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalAssignmentListResult. +func (d DatabasePrincipalAssignmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabasePrincipalAssignmentListResult. +func (d *DatabasePrincipalAssignmentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalListRequest. +func (d DatabasePrincipalListRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabasePrincipalListRequest. +func (d *DatabasePrincipalListRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalListResult. +func (d DatabasePrincipalListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabasePrincipalListResult. +func (d *DatabasePrincipalListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalProperties. +func (d DatabasePrincipalProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aadObjectId", d.AADObjectID) + populate(objectMap, "principalId", d.PrincipalID) + populate(objectMap, "principalName", d.PrincipalName) + populate(objectMap, "principalType", d.PrincipalType) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "role", d.Role) + populate(objectMap, "tenantId", d.TenantID) + populate(objectMap, "tenantName", d.TenantName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabasePrincipalProperties. +func (d *DatabasePrincipalProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aadObjectId": + err = unpopulate(val, "AADObjectID", &d.AADObjectID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &d.PrincipalID) + delete(rawMsg, key) + case "principalName": + err = unpopulate(val, "PrincipalName", &d.PrincipalName) + delete(rawMsg, key) + case "principalType": + err = unpopulate(val, "PrincipalType", &d.PrincipalType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &d.Role) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &d.TenantID) + delete(rawMsg, key) + case "tenantName": + err = unpopulate(val, "TenantName", &d.TenantName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseStatistics. +func (d DatabaseStatistics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "size", d.Size) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseStatistics. +func (d *DatabaseStatistics) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "size": + err = unpopulate(val, "Size", &d.Size) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnoseVirtualNetworkResult. +func (d DiagnoseVirtualNetworkResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "findings", d.Findings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnoseVirtualNetworkResult. +func (d *DiagnoseVirtualNetworkResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "findings": + err = unpopulate(val, "Findings", &d.Findings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointDependency. +func (e EndpointDependency) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "domainName", e.DomainName) + populate(objectMap, "endpointDetails", e.EndpointDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency. +func (e *EndpointDependency) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "domainName": + err = unpopulate(val, "DomainName", &e.DomainName) + delete(rawMsg, key) + case "endpointDetails": + err = unpopulate(val, "EndpointDetails", &e.EndpointDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointDetail. +func (e EndpointDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "port", e.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail. +func (e *EndpointDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "port": + err = unpopulate(val, "Port", &e.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EventGridConnectionProperties. +func (e EventGridConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blobStorageEventType", e.BlobStorageEventType) + populate(objectMap, "consumerGroup", e.ConsumerGroup) + populate(objectMap, "dataFormat", e.DataFormat) + populate(objectMap, "databaseRouting", e.DatabaseRouting) + populate(objectMap, "eventGridResourceId", e.EventGridResourceID) + populate(objectMap, "eventHubResourceId", e.EventHubResourceID) + populate(objectMap, "ignoreFirstRecord", e.IgnoreFirstRecord) + populate(objectMap, "managedIdentityObjectId", e.ManagedIdentityObjectID) + populate(objectMap, "managedIdentityResourceId", e.ManagedIdentityResourceID) + populate(objectMap, "mappingRuleName", e.MappingRuleName) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "storageAccountResourceId", e.StorageAccountResourceID) + populate(objectMap, "tableName", e.TableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventGridConnectionProperties. +func (e *EventGridConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobStorageEventType": + err = unpopulate(val, "BlobStorageEventType", &e.BlobStorageEventType) + delete(rawMsg, key) + case "consumerGroup": + err = unpopulate(val, "ConsumerGroup", &e.ConsumerGroup) + delete(rawMsg, key) + case "dataFormat": + err = unpopulate(val, "DataFormat", &e.DataFormat) + delete(rawMsg, key) + case "databaseRouting": + err = unpopulate(val, "DatabaseRouting", &e.DatabaseRouting) + delete(rawMsg, key) + case "eventGridResourceId": + err = unpopulate(val, "EventGridResourceID", &e.EventGridResourceID) + delete(rawMsg, key) + case "eventHubResourceId": + err = unpopulate(val, "EventHubResourceID", &e.EventHubResourceID) + delete(rawMsg, key) + case "ignoreFirstRecord": + err = unpopulate(val, "IgnoreFirstRecord", &e.IgnoreFirstRecord) + delete(rawMsg, key) + case "managedIdentityObjectId": + err = unpopulate(val, "ManagedIdentityObjectID", &e.ManagedIdentityObjectID) + delete(rawMsg, key) + case "managedIdentityResourceId": + err = unpopulate(val, "ManagedIdentityResourceID", &e.ManagedIdentityResourceID) + delete(rawMsg, key) + case "mappingRuleName": + err = unpopulate(val, "MappingRuleName", &e.MappingRuleName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "storageAccountResourceId": + err = unpopulate(val, "StorageAccountResourceID", &e.StorageAccountResourceID) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &e.TableName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EventGridDataConnection. +func (e EventGridDataConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + objectMap["kind"] = DataConnectionKindEventGrid + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventGridDataConnection. +func (e *EventGridDataConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EventHubConnectionProperties. +func (e EventHubConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "compression", e.Compression) + populate(objectMap, "consumerGroup", e.ConsumerGroup) + populate(objectMap, "dataFormat", e.DataFormat) + populate(objectMap, "databaseRouting", e.DatabaseRouting) + populate(objectMap, "eventHubResourceId", e.EventHubResourceID) + populate(objectMap, "eventSystemProperties", e.EventSystemProperties) + populate(objectMap, "managedIdentityObjectId", e.ManagedIdentityObjectID) + populate(objectMap, "managedIdentityResourceId", e.ManagedIdentityResourceID) + populate(objectMap, "mappingRuleName", e.MappingRuleName) + populate(objectMap, "provisioningState", e.ProvisioningState) + populateTimeRFC3339(objectMap, "retrievalStartDate", e.RetrievalStartDate) + populate(objectMap, "tableName", e.TableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubConnectionProperties. +func (e *EventHubConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "compression": + err = unpopulate(val, "Compression", &e.Compression) + delete(rawMsg, key) + case "consumerGroup": + err = unpopulate(val, "ConsumerGroup", &e.ConsumerGroup) + delete(rawMsg, key) + case "dataFormat": + err = unpopulate(val, "DataFormat", &e.DataFormat) + delete(rawMsg, key) + case "databaseRouting": + err = unpopulate(val, "DatabaseRouting", &e.DatabaseRouting) + delete(rawMsg, key) + case "eventHubResourceId": + err = unpopulate(val, "EventHubResourceID", &e.EventHubResourceID) + delete(rawMsg, key) + case "eventSystemProperties": + err = unpopulate(val, "EventSystemProperties", &e.EventSystemProperties) + delete(rawMsg, key) + case "managedIdentityObjectId": + err = unpopulate(val, "ManagedIdentityObjectID", &e.ManagedIdentityObjectID) + delete(rawMsg, key) + case "managedIdentityResourceId": + err = unpopulate(val, "ManagedIdentityResourceID", &e.ManagedIdentityResourceID) + delete(rawMsg, key) + case "mappingRuleName": + err = unpopulate(val, "MappingRuleName", &e.MappingRuleName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "retrievalStartDate": + err = unpopulateTimeRFC3339(val, "RetrievalStartDate", &e.RetrievalStartDate) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &e.TableName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EventHubDataConnection. +func (e EventHubDataConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + objectMap["kind"] = DataConnectionKindEventHub + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubDataConnection. +func (e *EventHubDataConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FollowerDatabaseDefinition. +func (f FollowerDatabaseDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "attachedDatabaseConfigurationName", f.AttachedDatabaseConfigurationName) + populate(objectMap, "clusterResourceId", f.ClusterResourceID) + populate(objectMap, "databaseName", f.DatabaseName) + populate(objectMap, "databaseShareOrigin", f.DatabaseShareOrigin) + populate(objectMap, "tableLevelSharingProperties", f.TableLevelSharingProperties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FollowerDatabaseDefinition. +func (f *FollowerDatabaseDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "attachedDatabaseConfigurationName": + err = unpopulate(val, "AttachedDatabaseConfigurationName", &f.AttachedDatabaseConfigurationName) + delete(rawMsg, key) + case "clusterResourceId": + err = unpopulate(val, "ClusterResourceID", &f.ClusterResourceID) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &f.DatabaseName) + delete(rawMsg, key) + case "databaseShareOrigin": + err = unpopulate(val, "DatabaseShareOrigin", &f.DatabaseShareOrigin) + delete(rawMsg, key) + case "tableLevelSharingProperties": + err = unpopulate(val, "TableLevelSharingProperties", &f.TableLevelSharingProperties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FollowerDatabaseListResult. +func (f FollowerDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FollowerDatabaseListResult. +func (f *FollowerDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. +func (i *Identity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IotHubConnectionProperties. +func (i IotHubConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "consumerGroup", i.ConsumerGroup) + populate(objectMap, "dataFormat", i.DataFormat) + populate(objectMap, "databaseRouting", i.DatabaseRouting) + populate(objectMap, "eventSystemProperties", i.EventSystemProperties) + populate(objectMap, "iotHubResourceId", i.IotHubResourceID) + populate(objectMap, "mappingRuleName", i.MappingRuleName) + populate(objectMap, "provisioningState", i.ProvisioningState) + populateTimeRFC3339(objectMap, "retrievalStartDate", i.RetrievalStartDate) + populate(objectMap, "sharedAccessPolicyName", i.SharedAccessPolicyName) + populate(objectMap, "tableName", i.TableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IotHubConnectionProperties. +func (i *IotHubConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "consumerGroup": + err = unpopulate(val, "ConsumerGroup", &i.ConsumerGroup) + delete(rawMsg, key) + case "dataFormat": + err = unpopulate(val, "DataFormat", &i.DataFormat) + delete(rawMsg, key) + case "databaseRouting": + err = unpopulate(val, "DatabaseRouting", &i.DatabaseRouting) + delete(rawMsg, key) + case "eventSystemProperties": + err = unpopulate(val, "EventSystemProperties", &i.EventSystemProperties) + delete(rawMsg, key) + case "iotHubResourceId": + err = unpopulate(val, "IotHubResourceID", &i.IotHubResourceID) + delete(rawMsg, key) + case "mappingRuleName": + err = unpopulate(val, "MappingRuleName", &i.MappingRuleName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) + delete(rawMsg, key) + case "retrievalStartDate": + err = unpopulateTimeRFC3339(val, "RetrievalStartDate", &i.RetrievalStartDate) + delete(rawMsg, key) + case "sharedAccessPolicyName": + err = unpopulate(val, "SharedAccessPolicyName", &i.SharedAccessPolicyName) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &i.TableName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IotHubDataConnection. +func (i IotHubDataConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + objectMap["kind"] = DataConnectionKindIotHub + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IotHubDataConnection. +func (i *IotHubDataConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. +func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyName", k.KeyName) + populate(objectMap, "keyVaultUri", k.KeyVaultURI) + populate(objectMap, "keyVersion", k.KeyVersion) + populate(objectMap, "userIdentity", k.UserIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. +func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyName": + err = unpopulate(val, "KeyName", &k.KeyName) + delete(rawMsg, key) + case "keyVaultUri": + err = unpopulate(val, "KeyVaultURI", &k.KeyVaultURI) + delete(rawMsg, key) + case "keyVersion": + err = unpopulate(val, "KeyVersion", &k.KeyVersion) + delete(rawMsg, key) + case "userIdentity": + err = unpopulate(val, "UserIdentity", &k.UserIdentity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LanguageExtension. +func (l LanguageExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "languageExtensionName", l.LanguageExtensionName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LanguageExtension. +func (l *LanguageExtension) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "languageExtensionName": + err = unpopulate(val, "LanguageExtensionName", &l.LanguageExtensionName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LanguageExtensionsList. +func (l LanguageExtensionsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LanguageExtensionsList. +func (l *LanguageExtensionsList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListResourceSKUsResult. +func (l ListResourceSKUsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListResourceSKUsResult. +func (l *ListResourceSKUsResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedPrivateEndpoint. +func (m ManagedPrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedPrivateEndpoint. +func (m *ManagedPrivateEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedPrivateEndpointListResult. +func (m ManagedPrivateEndpointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedPrivateEndpointListResult. +func (m *ManagedPrivateEndpointListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedPrivateEndpointProperties. +func (m ManagedPrivateEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", m.GroupID) + populate(objectMap, "privateLinkResourceId", m.PrivateLinkResourceID) + populate(objectMap, "privateLinkResourceRegion", m.PrivateLinkResourceRegion) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "requestMessage", m.RequestMessage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedPrivateEndpointProperties. +func (m *ManagedPrivateEndpointProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &m.GroupID) + delete(rawMsg, key) + case "privateLinkResourceId": + err = unpopulate(val, "PrivateLinkResourceID", &m.PrivateLinkResourceID) + delete(rawMsg, key) + case "privateLinkResourceRegion": + err = unpopulate(val, "PrivateLinkResourceRegion", &m.PrivateLinkResourceRegion) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "requestMessage": + err = unpopulate(val, "RequestMessage", &m.RequestMessage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedPrivateEndpointsCheckNameRequest. +func (m ManagedPrivateEndpointsCheckNameRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", m.Name) + objectMap["type"] = "Microsoft.Kusto/clusters/managedPrivateEndpoints" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedPrivateEndpointsCheckNameRequest. +func (m *ManagedPrivateEndpointsCheckNameRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", &o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationResult. +func (o OperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", o.EndTime) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "percentComplete", o.PercentComplete) + populate(objectMap, "properties", o.Properties) + populateTimeRFC3339(objectMap, "startTime", o.StartTime) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResult. +func (o *OperationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &o.PercentComplete) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationResultErrorProperties. +func (o OperationResultErrorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", o.Code) + populate(objectMap, "message", o.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultErrorProperties. +func (o *OperationResultErrorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &o.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &o.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationResultProperties. +func (o OperationResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "operationKind", o.OperationKind) + populate(objectMap, "operationState", o.OperationState) + populate(objectMap, "provisioningState", o.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultProperties. +func (o *OperationResultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "operationKind": + err = unpopulate(val, "OperationKind", &o.OperationKind) + delete(rawMsg, key) + case "operationState": + err = unpopulate(val, "OperationState", &o.OperationState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OptimizedAutoscale. +func (o OptimizedAutoscale) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "isEnabled", o.IsEnabled) + populate(objectMap, "maximum", o.Maximum) + populate(objectMap, "minimum", o.Minimum) + populate(objectMap, "version", o.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OptimizedAutoscale. +func (o *OptimizedAutoscale) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "isEnabled": + err = unpopulate(val, "IsEnabled", &o.IsEnabled) + delete(rawMsg, key) + case "maximum": + err = unpopulate(val, "Maximum", &o.Maximum) + delete(rawMsg, key) + case "minimum": + err = unpopulate(val, "Minimum", &o.Minimum) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &o.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundNetworkDependenciesEndpoint. +func (o OutboundNetworkDependenciesEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", o.Etag) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundNetworkDependenciesEndpoint. +func (o *OutboundNetworkDependenciesEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &o.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundNetworkDependenciesEndpointListResult. +func (o OutboundNetworkDependenciesEndpointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundNetworkDependenciesEndpointListResult. +func (o *OutboundNetworkDependenciesEndpointListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundNetworkDependenciesEndpointProperties. +func (o OutboundNetworkDependenciesEndpointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "category", o.Category) + populate(objectMap, "endpoints", o.Endpoints) + populate(objectMap, "provisioningState", o.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundNetworkDependenciesEndpointProperties. +func (o *OutboundNetworkDependenciesEndpointProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "category": + err = unpopulate(val, "Category", &o.Category) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &o.Endpoints) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointProperty. +func (p PrivateEndpointProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperty. +func (p *PrivateEndpointProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionStateProperty. +func (p PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionStateProperty. +func (p *PrivateLinkServiceConnectionStateProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReadOnlyFollowingDatabase. +func (r ReadOnlyFollowingDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + objectMap["kind"] = KindReadOnlyFollowing + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReadOnlyFollowingDatabase. +func (r *ReadOnlyFollowingDatabase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReadOnlyFollowingDatabaseProperties. +func (r ReadOnlyFollowingDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "attachedDatabaseConfigurationName", r.AttachedDatabaseConfigurationName) + populate(objectMap, "databaseShareOrigin", r.DatabaseShareOrigin) + populate(objectMap, "hotCachePeriod", r.HotCachePeriod) + populate(objectMap, "leaderClusterResourceId", r.LeaderClusterResourceID) + populate(objectMap, "originalDatabaseName", r.OriginalDatabaseName) + populate(objectMap, "principalsModificationKind", r.PrincipalsModificationKind) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "softDeletePeriod", r.SoftDeletePeriod) + populate(objectMap, "statistics", r.Statistics) + populate(objectMap, "tableLevelSharingProperties", r.TableLevelSharingProperties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReadOnlyFollowingDatabaseProperties. +func (r *ReadOnlyFollowingDatabaseProperties) UnmarshalJSON(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 "attachedDatabaseConfigurationName": + err = unpopulate(val, "AttachedDatabaseConfigurationName", &r.AttachedDatabaseConfigurationName) + delete(rawMsg, key) + case "databaseShareOrigin": + err = unpopulate(val, "DatabaseShareOrigin", &r.DatabaseShareOrigin) + delete(rawMsg, key) + case "hotCachePeriod": + err = unpopulate(val, "HotCachePeriod", &r.HotCachePeriod) + delete(rawMsg, key) + case "leaderClusterResourceId": + err = unpopulate(val, "LeaderClusterResourceID", &r.LeaderClusterResourceID) + delete(rawMsg, key) + case "originalDatabaseName": + err = unpopulate(val, "OriginalDatabaseName", &r.OriginalDatabaseName) + delete(rawMsg, key) + case "principalsModificationKind": + err = unpopulate(val, "PrincipalsModificationKind", &r.PrincipalsModificationKind) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "softDeletePeriod": + err = unpopulate(val, "SoftDeletePeriod", &r.SoftDeletePeriod) + delete(rawMsg, key) + case "statistics": + err = unpopulate(val, "Statistics", &r.Statistics) + delete(rawMsg, key) + case "tableLevelSharingProperties": + err = unpopulate(val, "TableLevelSharingProperties", &r.TableLevelSharingProperties) + 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 ReadWriteDatabase. +func (r ReadWriteDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + objectMap["kind"] = KindReadWrite + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReadWriteDatabase. +func (r *ReadWriteDatabase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReadWriteDatabaseProperties. +func (r ReadWriteDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hotCachePeriod", r.HotCachePeriod) + populate(objectMap, "isFollowed", r.IsFollowed) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "softDeletePeriod", r.SoftDeletePeriod) + populate(objectMap, "statistics", r.Statistics) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReadWriteDatabaseProperties. +func (r *ReadWriteDatabaseProperties) UnmarshalJSON(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 "hotCachePeriod": + err = unpopulate(val, "HotCachePeriod", &r.HotCachePeriod) + delete(rawMsg, key) + case "isFollowed": + err = unpopulate(val, "IsFollowed", &r.IsFollowed) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "softDeletePeriod": + err = unpopulate(val, "SoftDeletePeriod", &r.SoftDeletePeriod) + delete(rawMsg, key) + case "statistics": + err = unpopulate(val, "Statistics", &r.Statistics) + 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{}) + populate(objectMap, "locationInfo", s.LocationInfo) + populate(objectMap, "locations", s.Locations) + populate(objectMap, "name", s.Name) + populate(objectMap, "resourceType", s.ResourceType) + populate(objectMap, "restrictions", s.Restrictions) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUDescription. +func (s *SKUDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "locationInfo": + err = unpopulate(val, "LocationInfo", &s.LocationInfo) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &s.Locations) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &s.ResourceType) + delete(rawMsg, key) + case "restrictions": + err = unpopulate(val, "Restrictions", &s.Restrictions) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUDescriptionList. +func (s SKUDescriptionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUDescriptionList. +func (s *SKUDescriptionList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKULocationInfoItem. +func (s SKULocationInfoItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "location", s.Location) + populate(objectMap, "zones", s.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKULocationInfoItem. +func (s *SKULocationInfoItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &s.Zones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Script. +func (s Script) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Script. +func (s *Script) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScriptCheckNameRequest. +func (s ScriptCheckNameRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + objectMap["type"] = "Microsoft.Kusto/clusters/databases/scripts" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptCheckNameRequest. +func (s *ScriptCheckNameRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScriptListResult. +func (s ScriptListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptListResult. +func (s *ScriptListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScriptProperties. +func (s ScriptProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "continueOnErrors", s.ContinueOnErrors) + populate(objectMap, "forceUpdateTag", s.ForceUpdateTag) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "scriptContent", s.ScriptContent) + populate(objectMap, "scriptUrl", s.ScriptURL) + populate(objectMap, "scriptUrlSasToken", s.ScriptURLSasToken) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptProperties. +func (s *ScriptProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "continueOnErrors": + err = unpopulate(val, "ContinueOnErrors", &s.ContinueOnErrors) + delete(rawMsg, key) + case "forceUpdateTag": + err = unpopulate(val, "ForceUpdateTag", &s.ForceUpdateTag) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "scriptContent": + err = unpopulate(val, "ScriptContent", &s.ScriptContent) + delete(rawMsg, key) + case "scriptUrl": + err = unpopulate(val, "ScriptURL", &s.ScriptURL) + delete(rawMsg, key) + case "scriptUrlSasToken": + err = unpopulate(val, "ScriptURLSasToken", &s.ScriptURLSasToken) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TableLevelSharingProperties. +func (t TableLevelSharingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "externalTablesToExclude", t.ExternalTablesToExclude) + populate(objectMap, "externalTablesToInclude", t.ExternalTablesToInclude) + populate(objectMap, "materializedViewsToExclude", t.MaterializedViewsToExclude) + populate(objectMap, "materializedViewsToInclude", t.MaterializedViewsToInclude) + populate(objectMap, "tablesToExclude", t.TablesToExclude) + populate(objectMap, "tablesToInclude", t.TablesToInclude) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TableLevelSharingProperties. +func (t *TableLevelSharingProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "externalTablesToExclude": + err = unpopulate(val, "ExternalTablesToExclude", &t.ExternalTablesToExclude) + delete(rawMsg, key) + case "externalTablesToInclude": + err = unpopulate(val, "ExternalTablesToInclude", &t.ExternalTablesToInclude) + delete(rawMsg, key) + case "materializedViewsToExclude": + err = unpopulate(val, "MaterializedViewsToExclude", &t.MaterializedViewsToExclude) + delete(rawMsg, key) + case "materializedViewsToInclude": + err = unpopulate(val, "MaterializedViewsToInclude", &t.MaterializedViewsToInclude) + delete(rawMsg, key) + case "tablesToExclude": + err = unpopulate(val, "TablesToExclude", &t.TablesToExclude) + delete(rawMsg, key) + case "tablesToInclude": + err = unpopulate(val, "TablesToInclude", &t.TablesToInclude) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrustedExternalTenant. +func (t TrustedExternalTenant) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrustedExternalTenant. +func (t *TrustedExternalTenant) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkConfiguration. +func (v VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataManagementPublicIpId", v.DataManagementPublicIPID) + populate(objectMap, "enginePublicIpId", v.EnginePublicIPID) + populate(objectMap, "subnetId", v.SubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkConfiguration. +func (v *VirtualNetworkConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataManagementPublicIpId": + err = unpopulate(val, "DataManagementPublicIPID", &v.DataManagementPublicIPID) + delete(rawMsg, key) + case "enginePublicIpId": + err = unpopulate(val, "EnginePublicIPID", &v.EnginePublicIPID) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &v.SubnetID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_operations_client.go b/sdk/resourcemanager/kusto/armkusto/operations_client.go similarity index 96% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_operations_client.go rename to sdk/resourcemanager/kusto/armkusto/operations_client.go index f17e6146d8fb..222dae3dfed2 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_operations_client.go +++ b/sdk/resourcemanager/kusto/armkusto/operations_client.go @@ -5,6 +5,7 @@ // 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 @@ -49,8 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists available operations for the Microsoft.Kusto provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// Generated from API version 2022-07-07 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/kusto/armkusto/operations_client_example_test.go similarity index 95% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_operations_client_test.go rename to sdk/resourcemanager/kusto/armkusto/operations_client_example_test.go index 223dc8576200..3802aa9a81be 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/operations_client_example_test.go @@ -16,7 +16,7 @@ import ( "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-02-01/examples/KustoOperationsList.json +// 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 { diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_operationsresults_client.go b/sdk/resourcemanager/kusto/armkusto/operationsresults_client.go similarity index 97% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_operationsresults_client.go rename to sdk/resourcemanager/kusto/armkusto/operationsresults_client.go index 58d7c34f544f..492bf6f19a0f 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_operationsresults_client.go +++ b/sdk/resourcemanager/kusto/armkusto/operationsresults_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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. @@ -96,7 +97,7 @@ func (client *OperationsResultsClient) getCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_operationsresults_client_test.go b/sdk/resourcemanager/kusto/armkusto/operationsresults_client_example_test.go similarity index 88% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_operationsresults_client_test.go rename to sdk/resourcemanager/kusto/armkusto/operationsresults_client_example_test.go index 090b019a854e..a31dee940278 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_operationsresults_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/operationsresults_client_example_test.go @@ -16,7 +16,7 @@ import ( "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-02-01/examples/KustoOperationResultsGet.json +// 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 { @@ -27,10 +27,7 @@ func ExampleOperationsResultsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "westus", - "30972f1b-b61d-4fd8-bd34-3dcfa24670f3", - nil) + res, 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/zz_generated_operationsresultslocation_client.go b/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client.go similarity index 97% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_operationsresultslocation_client.go rename to sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client.go index 554a0ca8a009..cd609d632f1d 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_operationsresultslocation_client.go +++ b/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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 @@ -97,7 +98,7 @@ func (client *OperationsResultsLocationClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_operationsresultslocation_client_test.go b/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client_example_test.go similarity index 88% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_operationsresultslocation_client_test.go rename to sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client_example_test.go index 60fdbc9c3bc0..64d4ddad84cd 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_operationsresultslocation_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/operationsresultslocation_client_example_test.go @@ -16,7 +16,7 @@ import ( "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-02-01/examples/KustoOperationResultsOperationResultResponseTypeGet.json +// 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 { @@ -27,10 +27,7 @@ func ExampleOperationsResultsLocationClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Get(ctx, - "westus", - "30972f1b-b61d-4fd8-bd34-3dcfa24670f3", - nil) + _, 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/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/kusto/armkusto/polymorphic_helpers.go similarity index 99% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/kusto/armkusto/polymorphic_helpers.go index 8f3cce7c73a3..5a3fcf0c6a37 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/kusto/armkusto/polymorphic_helpers.go @@ -5,6 +5,7 @@ // 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 diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client.go similarity index 97% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_privateendpointconnections_client.go rename to sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client.go index 22d18174477b..10109982cf53 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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. @@ -77,7 +78,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -117,7 +118,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,7 +126,7 @@ 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-02-01 +// 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. @@ -145,7 +146,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -185,7 +186,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +194,7 @@ 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-02-01 +// 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. @@ -238,7 +239,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,8 +255,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res } // NewListPager - Returns the list of private endpoint connections. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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 @@ -302,7 +302,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client_example_test.go similarity index 79% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_privateendpointconnections_client_test.go rename to sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client_example_test.go index 818fb70f4cfa..97bcb8757876 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_privateendpointconnections_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/privateendpointconnections_client_example_test.go @@ -17,7 +17,7 @@ import ( "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-02-01/examples/KustoPrivateEndpointConnectionsList.json +// 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 { @@ -28,9 +28,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("kustorptest", - "kustoCluster", - nil) + pager := client.NewListPager("kustorptest", "kustoCluster", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -43,7 +41,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoPrivateEndpointConnectionsGet.json +// 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 { @@ -54,11 +52,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "kustorptest", - "kustoCluster", - "privateEndpointTest", - nil) + res, err := client.Get(ctx, "kustorptest", "kustoCluster", "privateEndpointTest", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -66,7 +60,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoPrivateEndpointConnectionsCreateOrUpdate.json +// 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 { @@ -77,19 +71,14 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { 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"), - }, + 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) + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -101,7 +90,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoPrivateEndpointConnectionsDelete.json +// 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 { @@ -112,11 +101,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, - "kustorptest", - "kustoCluster", - "privateEndpointTest", - nil) + poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "privateEndpointTest", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client.go similarity index 97% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_privatelinkresources_client.go rename to sdk/resourcemanager/kusto/armkusto/privatelinkresources_client.go index 5df3cb88a2e0..ba57c8b90a98 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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. @@ -102,7 +103,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,8 +119,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) } // NewListPager - Returns the list of private link resources. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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 @@ -166,7 +166,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client_example_test.go similarity index 87% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_privatelinkresources_client_test.go rename to sdk/resourcemanager/kusto/armkusto/privatelinkresources_client_example_test.go index 980bcd286258..06de1ee9c92e 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_privatelinkresources_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/privatelinkresources_client_example_test.go @@ -16,7 +16,7 @@ import ( "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-02-01/examples/KustoPrivateLinkResourcesList.json +// 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 { @@ -27,9 +27,7 @@ func ExamplePrivateLinkResourcesClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("kustorptest", - "kustoCluster", - nil) + pager := client.NewListPager("kustorptest", "kustoCluster", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -42,7 +40,7 @@ func ExamplePrivateLinkResourcesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoPrivateLinkResourcesGet.json +// 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 { @@ -53,11 +51,7 @@ func ExamplePrivateLinkResourcesClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "kustorptest", - "kustoCluster", - "cluster", - nil) + res, err := client.Get(ctx, "kustorptest", "kustoCluster", "cluster", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_response_types.go b/sdk/resourcemanager/kusto/armkusto/response_types.go similarity index 99% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_response_types.go rename to sdk/resourcemanager/kusto/armkusto/response_types.go index 35e84b8aa6ab..94941215874a 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_response_types.go +++ b/sdk/resourcemanager/kusto/armkusto/response_types.go @@ -5,6 +5,7 @@ // 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 diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_scripts_client.go b/sdk/resourcemanager/kusto/armkusto/scripts_client.go similarity index 97% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_scripts_client.go rename to sdk/resourcemanager/kusto/armkusto/scripts_client.go index 573b2b6797ce..f303d5e50b86 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_scripts_client.go +++ b/sdk/resourcemanager/kusto/armkusto/scripts_client.go @@ -5,6 +5,7 @@ // 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 @@ -57,7 +58,7 @@ 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-02-01 +// 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. @@ -103,7 +104,7 @@ func (client *ScriptsClient) checkNameAvailabilityCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, scriptName) @@ -120,7 +121,7 @@ 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-02-01 +// 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. @@ -142,7 +143,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -186,7 +187,7 @@ func (client *ScriptsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -194,7 +195,7 @@ 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-02-01 +// 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. @@ -214,7 +215,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 { @@ -258,7 +259,7 @@ func (client *ScriptsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +267,7 @@ 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-02-01 +// 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. @@ -315,7 +316,7 @@ func (client *ScriptsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,8 +332,7 @@ func (client *ScriptsClient) getHandleResponse(resp *http.Response) (ScriptsClie } // NewListByDatabasePager - Returns the list of database scripts for given database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// 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. @@ -383,7 +383,7 @@ func (client *ScriptsClient) listByDatabaseCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -400,7 +400,7 @@ 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-02-01 +// 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. @@ -421,7 +421,7 @@ 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-02-01 +// Generated from API version 2022-07-07 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 +465,7 @@ func (client *ScriptsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2022-07-07") 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/ze_generated_example_scripts_client_test.go b/sdk/resourcemanager/kusto/armkusto/scripts_client_example_test.go similarity index 69% rename from sdk/resourcemanager/kusto/armkusto/ze_generated_example_scripts_client_test.go rename to sdk/resourcemanager/kusto/armkusto/scripts_client_example_test.go index 5da36345975b..4139234e0846 100644 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_scripts_client_test.go +++ b/sdk/resourcemanager/kusto/armkusto/scripts_client_example_test.go @@ -17,7 +17,7 @@ import ( "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-02-01/examples/KustoScriptsListByDatabase.json +// 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 { @@ -28,10 +28,7 @@ func ExampleScriptsClient_NewListByDatabasePager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByDatabasePager("kustorptest", - "kustoCluster", - "Kustodatabase8", - nil) + pager := client.NewListByDatabasePager("kustorptest", "kustoCluster", "Kustodatabase8", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -44,7 +41,7 @@ func ExampleScriptsClient_NewListByDatabasePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoScriptsGet.json +// 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 { @@ -55,12 +52,7 @@ func ExampleScriptsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "kustorptest", - "kustoCluster", - "Kustodatabase8", - "kustoScript", - nil) + res, err := client.Get(ctx, "kustorptest", "kustoCluster", "Kustodatabase8", "kustoScript", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -68,7 +60,7 @@ func ExampleScriptsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoScriptsCreateOrUpdate.json +// 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 { @@ -79,20 +71,14 @@ func ExampleScriptsClient_BeginCreateOrUpdate() { 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=********************************"), - }, + 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) + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -104,7 +90,7 @@ func ExampleScriptsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoScriptsUpdate.json +// 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 { @@ -115,20 +101,14 @@ func ExampleScriptsClient_BeginUpdate() { 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=********************************"), - }, + 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) + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -140,7 +120,7 @@ func ExampleScriptsClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoScriptsDelete.json +// 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 { @@ -151,12 +131,7 @@ func ExampleScriptsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, - "kustorptest", - "kustoCluster", - "KustoDatabase8", - "kustoScript", - nil) + poller, err := client.BeginDelete(ctx, "kustorptest", "kustoCluster", "KustoDatabase8", "kustoScript", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -166,7 +141,7 @@ func ExampleScriptsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-02-01/examples/KustoScriptsCheckNameAvailability.json +// 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 { @@ -177,15 +152,10 @@ func ExampleScriptsClient_CheckNameAvailability() { 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) + 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) } diff --git a/sdk/resourcemanager/kusto/armkusto/zz_generated_time_rfc3339.go b/sdk/resourcemanager/kusto/armkusto/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/kusto/armkusto/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/kusto/armkusto/time_rfc3339.go index a1552d559cc7..7c93879d0f3d 100644 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/kusto/armkusto/time_rfc3339.go @@ -5,6 +5,7 @@ // 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 diff --git a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_dataconnections_client_test.go b/sdk/resourcemanager/kusto/armkusto/ze_generated_example_dataconnections_client_test.go deleted file mode 100644 index 8db12eda9282..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/ze_generated_example_dataconnections_client_test.go +++ /dev/null @@ -1,250 +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-02-01/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-02-01/examples/KustoDataConnectionEventGridValidationAsync.json -func ExampleDataConnectionsClient_BeginDataConnectionValidation() { - 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-02-01/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-02-01/examples/KustoDataConnectionsEventGridGet.json -func ExampleDataConnectionsClient_Get() { - 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-02-01/examples/KustoDataConnectionsCreateOrUpdate.json -func ExampleDataConnectionsClient_BeginCreateOrUpdate() { - 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-02-01/examples/KustoDataConnectionsEventGridUpdate.json -func ExampleDataConnectionsClient_BeginUpdate() { - 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-02-01/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/zz_generated_models_serde.go b/sdk/resourcemanager/kusto/armkusto/zz_generated_models_serde.go deleted file mode 100644 index 1db3a91a4c4f..000000000000 --- a/sdk/resourcemanager/kusto/armkusto/zz_generated_models_serde.go +++ /dev/null @@ -1,652 +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 - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AttachedDatabaseConfigurationProperties. -func (a AttachedDatabaseConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "attachedDatabaseNames", a.AttachedDatabaseNames) - populate(objectMap, "clusterResourceId", a.ClusterResourceID) - populate(objectMap, "databaseName", a.DatabaseName) - populate(objectMap, "defaultPrincipalsModificationKind", a.DefaultPrincipalsModificationKind) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "tableLevelSharingProperties", a.TableLevelSharingProperties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Cluster. -func (c Cluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - populate(objectMap, "zones", c.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ClusterProperties. -func (c ClusterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "acceptedAudiences", c.AcceptedAudiences) - populate(objectMap, "allowedFqdnList", c.AllowedFqdnList) - populate(objectMap, "allowedIpRangeList", c.AllowedIPRangeList) - populate(objectMap, "dataIngestionUri", c.DataIngestionURI) - populate(objectMap, "enableAutoStop", c.EnableAutoStop) - populate(objectMap, "enableDiskEncryption", c.EnableDiskEncryption) - populate(objectMap, "enableDoubleEncryption", c.EnableDoubleEncryption) - populate(objectMap, "enablePurge", c.EnablePurge) - populate(objectMap, "enableStreamingIngest", c.EnableStreamingIngest) - populate(objectMap, "engineType", c.EngineType) - populate(objectMap, "keyVaultProperties", c.KeyVaultProperties) - populate(objectMap, "languageExtensions", c.LanguageExtensions) - populate(objectMap, "optimizedAutoscale", c.OptimizedAutoscale) - populate(objectMap, "privateEndpointConnections", c.PrivateEndpointConnections) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "publicIPType", c.PublicIPType) - populate(objectMap, "publicNetworkAccess", c.PublicNetworkAccess) - populate(objectMap, "restrictOutboundNetworkAccess", c.RestrictOutboundNetworkAccess) - populate(objectMap, "state", c.State) - populate(objectMap, "stateReason", c.StateReason) - populate(objectMap, "trustedExternalTenants", c.TrustedExternalTenants) - populate(objectMap, "uri", c.URI) - populate(objectMap, "virtualClusterGraduationProperties", c.VirtualClusterGraduationProperties) - populate(objectMap, "virtualNetworkConfiguration", c.VirtualNetworkConfiguration) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ClusterUpdate. -func (c ClusterUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DataConnection. -func (d DataConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - objectMap["kind"] = d.Kind - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectionListResult. -func (d *DataConnectionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - d.Value, err = unmarshalDataConnectionClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DataConnectionValidation. -func (d DataConnectionValidation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataConnectionName", d.DataConnectionName) - populate(objectMap, "properties", d.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectionValidation. -func (d *DataConnectionValidation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataConnectionName": - err = unpopulate(val, "DataConnectionName", &d.DataConnectionName) - delete(rawMsg, key) - case "properties": - d.Properties, err = unmarshalDataConnectionClassification(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Database. -func (d Database) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - objectMap["kind"] = d.Kind - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseListResult. -func (d *DatabaseListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - d.Value, err = unmarshalDatabaseClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabasePrincipalListRequest. -func (d DatabasePrincipalListRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EndpointDependency. -func (e EndpointDependency) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "domainName", e.DomainName) - populate(objectMap, "endpointDetails", e.EndpointDetails) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EventGridDataConnection. -func (e EventGridDataConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - objectMap["kind"] = DataConnectionKindEventGrid - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventGridDataConnection. -func (e *EventGridDataConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &e.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EventHubConnectionProperties. -func (e EventHubConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "compression", e.Compression) - populate(objectMap, "consumerGroup", e.ConsumerGroup) - populate(objectMap, "dataFormat", e.DataFormat) - populate(objectMap, "databaseRouting", e.DatabaseRouting) - populate(objectMap, "eventHubResourceId", e.EventHubResourceID) - populate(objectMap, "eventSystemProperties", e.EventSystemProperties) - populate(objectMap, "managedIdentityObjectId", e.ManagedIdentityObjectID) - populate(objectMap, "managedIdentityResourceId", e.ManagedIdentityResourceID) - populate(objectMap, "mappingRuleName", e.MappingRuleName) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "tableName", e.TableName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EventHubDataConnection. -func (e EventHubDataConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - objectMap["kind"] = DataConnectionKindEventHub - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EventHubDataConnection. -func (e *EventHubDataConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &e.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Identity. -func (i Identity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", i.PrincipalID) - populate(objectMap, "tenantId", i.TenantID) - populate(objectMap, "type", i.Type) - populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IotHubConnectionProperties. -func (i IotHubConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "consumerGroup", i.ConsumerGroup) - populate(objectMap, "dataFormat", i.DataFormat) - populate(objectMap, "databaseRouting", i.DatabaseRouting) - populate(objectMap, "eventSystemProperties", i.EventSystemProperties) - populate(objectMap, "iotHubResourceId", i.IotHubResourceID) - populate(objectMap, "mappingRuleName", i.MappingRuleName) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "sharedAccessPolicyName", i.SharedAccessPolicyName) - populate(objectMap, "tableName", i.TableName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IotHubDataConnection. -func (i IotHubDataConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - objectMap["kind"] = DataConnectionKindIotHub - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IotHubDataConnection. -func (i *IotHubDataConnection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &i.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &i.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type LanguageExtensionsList. -func (l LanguageExtensionsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedPrivateEndpoint. -func (m ManagedPrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResult. -func (o *OperationResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &o.Error) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &o.PercentComplete) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &o.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OutboundNetworkDependenciesEndpointProperties. -func (o OutboundNetworkDependenciesEndpointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "category", o.Category) - populate(objectMap, "endpoints", o.Endpoints) - populate(objectMap, "provisioningState", o.ProvisioningState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ReadOnlyFollowingDatabase. -func (r ReadOnlyFollowingDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - objectMap["kind"] = KindReadOnlyFollowing - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ReadOnlyFollowingDatabase. -func (r *ReadOnlyFollowingDatabase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &r.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ReadWriteDatabase. -func (r ReadWriteDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - objectMap["kind"] = KindReadWrite - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ReadWriteDatabase. -func (r *ReadWriteDatabase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &r.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Script. -func (s Script) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TableLevelSharingProperties. -func (t TableLevelSharingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "externalTablesToExclude", t.ExternalTablesToExclude) - populate(objectMap, "externalTablesToInclude", t.ExternalTablesToInclude) - populate(objectMap, "materializedViewsToExclude", t.MaterializedViewsToExclude) - populate(objectMap, "materializedViewsToInclude", t.MaterializedViewsToInclude) - populate(objectMap, "tablesToExclude", t.TablesToExclude) - populate(objectMap, "tablesToInclude", t.TablesToInclude) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}